From: Rahul Lakkireddy Date: Tue, 19 Jan 2016 10:17:08 +0000 (+0530) Subject: cxgbe: fix setting wrong MTU X-Git-Tag: spdx-start~7422 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5a9e303a389fae047c6904609d798f7e9f130faa;p=dpdk.git cxgbe: fix setting wrong MTU 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 Signed-off-by: Kumar Sanghvi --- diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index 4abe246d80..36f7e377a1 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -162,6 +162,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: Fixed setting wrong device MTU.** + + Fixed an incorrect device MTU being set due to ethernet header and + CRC lengths being added twice. + * **aesni_mb: Fixed wrong return value when creating a device.** cryptodev_aesni_mb_init() was returning the device id of the device created, diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index 552b11f229..684a761887 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -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