cxgbe: fix setting wrong MTU
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Tue, 19 Jan 2016 10:17:08 +0000 (15:47 +0530)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 15:52:42 +0000 (16:52 +0100)
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_16_04.rst
drivers/net/cxgbe/cxgbe_main.c

index 4abe246..36f7e37 100644 (file)
@@ -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.
 
   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,
 * **aesni_mb: Fixed wrong return value when creating a device.**
 
   cryptodev_aesni_mb_init() was returning the device id of the device created,
index 552b11f..684a761 100644 (file)
@@ -855,7 +855,10 @@ int link_start(struct port_info *pi)
 {
        struct adapter *adapter = pi->adapter;
        int ret;
 {
        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
 
        /*
         * We do not set address filters and promiscuity here, the stack does