Skip to content

Commit

Permalink
net/cnxk: fix MTU limit
Browse files Browse the repository at this point in the history
[ upstream commit 402de2fd8729b61a3ace67c597e99893acb426d4 ]

Device can support maximum frame size up to 9212 bytes. While configuring
MTU, overhead is considered as ethernet header size, CRC and
2 * (VLAN tags) which translates to 26 bytes.

Exposed overhead to the user via rte_eth_dev_info() is 18 bytes which were
leading to set wrong Rx frame size.

Fixes: 8589ec2 ("net/cnxk: support MTU set")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
  • Loading branch information
SunilKumarKori authored and bluca committed Mar 13, 2024
1 parent edf3fc5 commit a2ec8fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/cnxk/cnxk_ethdev_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ cnxk_nix_info_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *devinfo)
devinfo->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;
devinfo->max_mac_addrs = dev->max_mac_entries;
devinfo->max_vfs = pci_dev->max_vfs;
devinfo->max_mtu = devinfo->max_rx_pktlen -
(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN);
devinfo->max_mtu = devinfo->max_rx_pktlen - CNXK_NIX_L2_OVERHEAD;
devinfo->min_mtu = devinfo->min_rx_bufsize - CNXK_NIX_L2_OVERHEAD;

devinfo->rx_offload_capa = dev->rx_offload_capa;
Expand Down

0 comments on commit a2ec8fb

Please sign in to comment.