examples/ip_fragmentation: support big packets
[dpdk.git] / examples / ip_fragmentation / main.c
index 17a877d..8d789b4 100644 (file)
@@ -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) {