DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: Felix Marti <felix@chelsio.com>,
	Kumar Sanghvi <kumaras@chelsio.com>,
	Nirranjan Kirubaharan <nirranjan@chelsio.com>
Subject: [dpdk-dev] [PATCH 2/2] cxgbe: fix setting wrong device mtu
Date: Tue, 19 Jan 2016 15:47:08 +0530	[thread overview]
Message-ID: <d06bdadbb50a445fff193027270531905d93a3b5.1453193282.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <cover.1453193282.git.rahul.lakkireddy@chelsio.com>
In-Reply-To: <cover.1453193282.git.rahul.lakkireddy@chelsio.com>

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(-)

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

  parent reply	other threads:[~2016-01-19 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 10:17 [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Rahul Lakkireddy
2016-01-19 10:17 ` [dpdk-dev] [PATCH 1/2] cxgbe: fix segfault due to incorrect size allocated for rss table Rahul Lakkireddy
2016-01-19 10:17 ` Rahul Lakkireddy [this message]
2016-02-12 11:55 ` [dpdk-dev] [PATCH 0/2] cxgbe: Bug fixes for CXGBE PMD Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d06bdadbb50a445fff193027270531905d93a3b5.1453193282.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=felix@chelsio.com \
    --cc=kumaras@chelsio.com \
    --cc=nirranjan@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).