summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNoa Ezra <noae@mellanox.com>2019-01-13 11:37:06 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-15 02:40:41 +0100
commit73d2c1d3f33c63410645548809b18de97e563c07 (patch)
tree8c221c1b38d82e400afaae9fd12ea76f71262a85 /examples
parent7dbbdd3efa6777ac2a3b7cb30d1e8ebec9e5e2fd (diff)
downloaddpdk-next-eventdev-73d2c1d3f33c63410645548809b18de97e563c07.zip
dpdk-next-eventdev-73d2c1d3f33c63410645548809b18de97e563c07.tar.gz
dpdk-next-eventdev-73d2c1d3f33c63410645548809b18de97e563c07.tar.xz
examples/ip_fragmentation: support big packets
In some vendors the RX and TX configuration must be the same, therefore the MTU size need to be equal to max_rx_pkt_len. The MTU is the largest size packet in bytes that can be sent on the network, therefore before changing this parameter, the NIC could not receive packets larger than 1500 bytes, which is the default MTU size. In addition, scatter-gather need to be enabled in order to receive frames bigger than mbuf size. Signed-off-by: Noa Ezra <noae@mellanox.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/ip_fragmentation/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 17a877d..8d789b4 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -141,6 +141,7 @@ static struct rte_eth_conf port_conf = {
.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
.split_hdr_size = 0,
.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+ DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_JUMBO_FRAME),
},
.txmode = {
@@ -935,6 +936,16 @@ main(int argc, char **argv)
ret, portid);
}
+ /* set the mtu to the maximum received packet size */
+ ret = rte_eth_dev_set_mtu(portid,
+ local_port_conf.rxmode.max_rx_pkt_len);
+ if (ret < 0) {
+ printf("\n");
+ rte_exit(EXIT_FAILURE, "Set MTU failed: "
+ "err=%d, port=%d\n",
+ ret, portid);
+ }
+
ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd,
&nb_txd);
if (ret < 0) {