net/bnxt: set MTU in dev config for jumbo packets
authorQingmin Liu <qingmin.liu@broadcom.com>
Tue, 1 May 2018 01:06:10 +0000 (18:06 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:48 +0000 (22:31 +0100)
MTU setting does not take effect after rte_eth_dev_configure
is called with jumbo enable unless it is configured using the
set_mtu dev_op.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index e443ee3..df4bed4 100644 (file)
@@ -151,6 +151,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 
 static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask);
 static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
+static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu);
 
 /***********************/
 
@@ -548,10 +549,12 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
        bp->rx_cp_nr_rings = bp->rx_nr_rings;
        bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
-       if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME)
+       if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
                eth_dev->data->mtu =
                                eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
                                ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE;
+               bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu);
+       }
        return 0;
 }