From: Damodharam Ammepalli <damodharam.ammepa...@broadcom.com> Minor cleanup in bnxt_mtu_set_op() to move pre-mature setting of jumbo flag post mtu check and remove a redundant mtu set operation from rxq vnic configs.
Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: sta...@dpdk.org Signed-off-by: Damodharam Ammepalli <damodharam.ammepa...@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khapa...@broadcom.com> Reviewed-by: Somnath Kotur <somnath.ko...@broadcom.com> --- drivers/net/bnxt/bnxt_ethdev.c | 8 ++++---- drivers/net/bnxt/bnxt_rxq.c | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f040cdc..e275d3a 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3037,15 +3037,15 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) if (!eth_dev->data->nb_rx_queues) return -ENOTSUP; + /* Is there a change in mtu setting? */ + if (eth_dev->data->mtu == new_mtu) + return 0; + if (new_mtu > RTE_ETHER_MTU) bp->flags |= BNXT_FLAG_JUMBO; else bp->flags &= ~BNXT_FLAG_JUMBO; - /* Is there a change in mtu setting? */ - if (eth_dev->data->mtu == new_mtu) - return 0; - for (i = 0; i < bp->nr_vnics; i++) { struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; uint16_t size = 0; diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index f4b6417..fabbbd4 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -402,10 +402,6 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, rxq->rx_started = rxq->rx_deferred_start ? false : true; rxq->vnic = BNXT_GET_DEFAULT_VNIC(bp); - /* Configure mtu if it is different from what was configured before */ - if (!queue_idx) - bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu); - return 0; err: bnxt_rx_queue_release_op(eth_dev, queue_idx); -- 2.10.1