From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate3.asicdesigners.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 4A6A68E8E for ; Tue, 19 Jan 2016 11:18:01 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id u0JAHoNA027031; Tue, 19 Jan 2016 02:17:51 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Date: Tue, 19 Jan 2016 15:47:08 +0530 Message-Id: X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Cc: Felix Marti , Kumar Sanghvi , Nirranjan Kirubaharan Subject: [dpdk-dev] [PATCH 2/2] cxgbe: fix setting wrong device mtu X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 10:18:01 -0000 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 --- doc/guides/rel_notes/release_2_3.rst | 5 +++++ drivers/net/cxgbe/cxgbe_main.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst index 4c5843d..15cc572 100644 --- a/doc/guides/rel_notes/release_2_3.rst +++ b/doc/guides/rel_notes/release_2_3.rst @@ -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 ~~~~~~~~~ diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index 632abc2..1683ca5 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 -- 2.5.3