[dpdk-dev,2/2] cxgbe: fix setting wrong device mtu
Commit Message
max_rx_pkt_len already includes ETHER_HDR_LEN and ETHER_CRC_LEN for the
mtu. But, the firmware also adds ETHER_HDR_LEN and ETHER_CRC_LEN to the
mtu specified. Fix by subtracting these values from the mtu before
passing it to firmware.
Fixes: 4b2eff452d2e ("cxgbe: enable jumbo frames")
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
---
doc/guides/rel_notes/release_2_3.rst | 5 +++++
drivers/net/cxgbe/cxgbe_main.c | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
@@ -21,6 +21,11 @@ Drivers
table that gets overwritten by subsequent port 1's part of the rss
table due to incorrect size allocated for each entry in the table.
+* **cxgbe: fix setting wrong device mtu**
+
+ Fixed an incorrect device mtu being set due to ethernet header and
+ crc lengths being added twice.
+
Libraries
~~~~~~~~~
@@ -855,7 +855,10 @@ int link_start(struct port_info *pi)
{
struct adapter *adapter = pi->adapter;
int ret;
- unsigned int mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len;
+ unsigned int mtu;
+
+ mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
+ (ETHER_HDR_LEN + ETHER_CRC_LEN);
/*
* We do not set address filters and promiscuity here, the stack does