[PATCH v2] pcap: support MTU set
Ido Goshen
Ido at cgstowernetworks.com
Mon May 23 16:52:51 CEST 2022
> -----Original Message-----
> From: Ido Goshen <Ido at cgstowernetworks.com>
> Sent: Monday, 23 May 2022 17:27
> To: Thomas Monjalon <thomas at monjalon.net>; Ferruh Yigit
> <ferruh.yigit at xilinx.com>; Andrew Rybchenko
> <andrew.rybchenko at oktetlabs.ru>
> Cc: dev at dpdk.org; Ido Goshen <Ido at cgstowernetworks.com>
> Subject: [PATCH v2] pcap: support MTU set
> v2:
> preserve pcap behavior to support max size packets by default
> ---
[idog] on top enforcing mtu and giving an option to set it
the v2 of the patch also preserves the default behavior of pcap pmd to rx jumbo packets
By default it will receive jumbo packets (jumbo_9000.pcap as a single 9000 bytes long packet)
cgs at idog-ubuntu:~/dpdk-next-net$ build/app/dpdk-testpmd --no-huge -m1024 -l 0-1 --vdev='net_pcap0,rx_pcap=rx_pcap=pcap/jumbo_9000.pcap,tx_pcap=pcap/file_tx.pcap'
-- --no-flush-rx -i --auto-start
...
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish...
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 1 RX-dropped: 0 RX-total: 1
TX-packets: 1 TX-dropped: 0 TX-total: 1
----------------------------------------------------------------------------
But now it will also nicely reflect it by rte_eth_dev_get_mtu
testpmd> show port info 0
********************* Infos for port 0 *********************
MAC address: 02:70:63:61:70:00
Device name: net_pcap0
Driver name: net_pcap
...
MTU: 65535
In addition it gives option to control the mtu for anyone who wants to reduce it
In testpmd either 'port config mtu' or --max-pkt-len can be used (as for other pmd's)
e.g.
cgs at idog-ubuntu:~/dpdk-next-net$ build/app/dpdk-testpmd --no-huge -m1024 -l 0-1 --vdev='net_pcap0,rx_pcap=rx_pcap=pcap/jumbo_9000.pcap,tx_pcap=pcap/file_tx.pcap'
-- --no-flush-rx -i
...
testpmd> port config mtu 0 1500
testpmd> show port info 0
********************* Infos for port 0 *********************
MAC address: 02:70:63:61:70:00
Device name: net_pcap0
Driver name: net_pcap
...
MTU: 1500
...
testpmd> start
....
testpmd> stop
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 0 RX-dropped: 0 RX-total: 0
RX-error: 1
RX-nombufs: 0
TX-packets: 0 TX-dropped: 0 TX-total: 0
----------------------------------------------------------------------------
More information about the dev
mailing list