From a1a716c1c645e1bfbc30f9ef6ba68473646bcf4e Mon Sep 17 00:00:00 2001 From: Qingmin Liu Date: Mon, 30 Apr 2018 18:06:10 -0700 Subject: [PATCH] net/bnxt: set MTU in dev config for jumbo packets 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 Signed-off-by: Scott Branden Reviewed-by: Jay Ding Reviewed-by: Randy Schacher Reviewed-by: Ajit Khaparde Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e443ee3043..df4bed47fb 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -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; } -- 2.20.1