Skip to content

Commit

Permalink
net/bnxt: cleanup MTU setting
Browse files Browse the repository at this point in the history
[ upstream commit 89670e3b0f852615c29c510d5f6c04d147675c7e ]

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: daef48e ("net/bnxt: support set MTU")

Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
  • Loading branch information
Damodharam Ammepalli authored and cpaelzer committed Jul 7, 2022
1 parent 6986cbb commit ccdd69c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions drivers/net/bnxt/bnxt_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,10 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
}
#endif

/* Is there a change in mtu setting? */
if (eth_dev->data->dev_conf.rxmode.max_rx_pkt_len == new_pkt_size)
return rc;

if (new_mtu > RTE_ETHER_MTU) {
bp->flags |= BNXT_FLAG_JUMBO;
bp->eth_dev->data->dev_conf.rxmode.offloads |=
Expand All @@ -2438,10 +2442,6 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
bp->flags &= ~BNXT_FLAG_JUMBO;
}

/* Is there a change in mtu setting? */
if (eth_dev->data->dev_conf.rxmode.max_rx_pkt_len == new_pkt_size)
return rc;

for (i = 0; i < bp->nr_vnics; i++) {
struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
uint16_t size = 0;
Expand Down
4 changes: 0 additions & 4 deletions drivers/net/bnxt/bnxt_rxq.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
}
eth_dev->data->rx_queue_state[queue_idx] = queue_state;

/* 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(rxq);
Expand Down

0 comments on commit ccdd69c

Please sign in to comment.