X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_fragmentation%2Fmain.c;h=e90a61e35de6e7bf4a9ccf595eb258f36a53129a;hb=474572d2ae5a17b6596053c2630753fe04fc304f;hp=8d789b417ebaa61351fb130c926d97f6be9a926f;hpb=73d2c1d3f33c63410645548809b18de97e563c07;p=dpdk.git diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8d789b417e..e90a61e35d 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -55,6 +55,13 @@ #define IPV4_MTU_DEFAULT ETHER_MTU #define IPV6_MTU_DEFAULT ETHER_MTU +/* + * The overhead from max frame size to MTU. + * We have to consider the max possible overhead. + */ +#define MTU_OVERHEAD \ + (ETHER_HDR_LEN + ETHER_CRC_LEN + 2 * sizeof(struct vlan_hdr)) + /* * Default payload in bytes for the IPv6 packet. */ @@ -938,7 +945,7 @@ main(int argc, char **argv) /* set the mtu to the maximum received packet size */ ret = rte_eth_dev_set_mtu(portid, - local_port_conf.rxmode.max_rx_pkt_len); + local_port_conf.rxmode.max_rx_pkt_len - MTU_OVERHEAD); if (ret < 0) { printf("\n"); rte_exit(EXIT_FAILURE, "Set MTU failed: "