net/dpaa: support jumbo frames
authorShreyansh Jain <shreyansh.jain@nxp.com>
Thu, 28 Sep 2017 12:29:46 +0000 (17:59 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:50 +0000 (02:49 +0200)
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
doc/guides/nics/features/dpaa.ini
drivers/net/dpaa/dpaa_ethdev.c

index 59ef23d..e62812c 100644 (file)
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Jumbo frame          = Y
 MTU update           = Y
 ARMv8                = Y
 Usage doc            = Y
index 4e07661..1f4f372 100644 (file)
@@ -85,9 +85,10 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
        if (mtu < ETHER_MIN_MTU)
                return -EINVAL;
        if (mtu > ETHER_MAX_LEN)
-               return -1;
+               dev->data->dev_conf.rxmode.jumbo_frame = 1;
+       else
+               dev->data->dev_conf.rxmode.jumbo_frame = 0;
 
-       dev->data->dev_conf.rxmode.jumbo_frame = 0;
        dev->data->dev_conf.rxmode.max_rx_pkt_len = mtu;
 
        fman_if_set_maxfrm(dpaa_intf->fif, mtu);
@@ -100,6 +101,14 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
 {
        PMD_INIT_FUNC_TRACE();
 
+       if (dev->data->dev_conf.rxmode.jumbo_frame == 1) {
+               if (dev->data->dev_conf.rxmode.max_rx_pkt_len <=
+                   DPAA_MAX_RX_PKT_LEN)
+                       return dpaa_mtu_set(dev,
+                               dev->data->dev_conf.rxmode.max_rx_pkt_len);
+               else
+                       return -1;
+       }
        return 0;
 }