From: Jason Xing <kerneljasonxing@gmail.com>
To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
alexandr.lobakin@intel.com, maciej.fijalkowski@intel.com
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
kerneljasonxing@gmail.com, Jason Xing <kernelxing@tencent.com>
Subject: [PATCH net 3/3] ixgbe: add double of VLAN header when computing the max MTU
Date: Sat, 4 Feb 2023 21:35:35 +0800 [thread overview]
Message-ID: <20230204133535.99921-4-kerneljasonxing@gmail.com> (raw)
In-Reply-To: <20230204133535.99921-1-kerneljasonxing@gmail.com>
From: Jason Xing <kernelxing@tencent.com>
Include the second VLAN HLEN into account when computing the maximum
MTU size as other drivers do.
Fixes: fabf1bce103a ("ixgbe: Prevent unsupported configurations with XDP")
Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 ++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index bc68b8f2176d..8736ca4b2628 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -73,6 +73,8 @@
#define IXGBE_RXBUFFER_4K 4096
#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */
+#define IXGBE_PKT_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2))
+
/* Attempt to maximize the headroom available for incoming frames. We
* use a 2K buffer for receives and need 1536/1534 to store the data for
* the frame. This leaves us with 512 bytes of room. From that we need
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 2c1b6eb60436..149f7baf40fe 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6801,8 +6801,7 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
struct ixgbe_adapter *adapter = netdev_priv(netdev);
if (ixgbe_enabled_xdp_adapter(adapter)) {
- int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN +
- VLAN_HLEN;
+ int new_frame_size = new_mtu + IXGBE_PKT_HDR_PAD;
if (new_frame_size > ixgbe_max_xdp_frame_size(adapter)) {
e_warn(probe, "Requested MTU size is not supported with XDP\n");
--
2.37.3
WARNING: multiple messages have this Message-ID (diff)
From: Jason Xing <kerneljasonxing@gmail.com>
To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
alexandr.lobakin@intel.com, maciej.fijalkowski@intel.com
Cc: kerneljasonxing@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
bpf@vger.kernel.org, Jason Xing <kernelxing@tencent.com>
Subject: [Intel-wired-lan] [PATCH net 3/3] ixgbe: add double of VLAN header when computing the max MTU
Date: Sat, 4 Feb 2023 21:35:35 +0800 [thread overview]
Message-ID: <20230204133535.99921-4-kerneljasonxing@gmail.com> (raw)
In-Reply-To: <20230204133535.99921-1-kerneljasonxing@gmail.com>
From: Jason Xing <kernelxing@tencent.com>
Include the second VLAN HLEN into account when computing the maximum
MTU size as other drivers do.
Fixes: fabf1bce103a ("ixgbe: Prevent unsupported configurations with XDP")
Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 ++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index bc68b8f2176d..8736ca4b2628 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -73,6 +73,8 @@
#define IXGBE_RXBUFFER_4K 4096
#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */
+#define IXGBE_PKT_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2))
+
/* Attempt to maximize the headroom available for incoming frames. We
* use a 2K buffer for receives and need 1536/1534 to store the data for
* the frame. This leaves us with 512 bytes of room. From that we need
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 2c1b6eb60436..149f7baf40fe 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6801,8 +6801,7 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
struct ixgbe_adapter *adapter = netdev_priv(netdev);
if (ixgbe_enabled_xdp_adapter(adapter)) {
- int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN +
- VLAN_HLEN;
+ int new_frame_size = new_mtu + IXGBE_PKT_HDR_PAD;
if (new_frame_size > ixgbe_max_xdp_frame_size(adapter)) {
e_warn(probe, "Requested MTU size is not supported with XDP\n");
--
2.37.3
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-02-04 13:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-04 13:35 [PATCH net 0/3] Fix MTU related issues Jason Xing
2023-02-04 13:35 ` [Intel-wired-lan] " Jason Xing
2023-02-04 13:35 ` [PATCH net v3 1/3] ixgbe: allow to increase MTU to 3K with XDP enabled Jason Xing
2023-02-04 13:35 ` [Intel-wired-lan] " Jason Xing
2023-02-07 19:03 ` Tony Nguyen
2023-02-07 19:03 ` [Intel-wired-lan] " Tony Nguyen
2023-02-08 2:09 ` Jason Xing
2023-02-08 2:09 ` [Intel-wired-lan] " Jason Xing
2023-02-04 13:35 ` [PATCH net 2/3] i40e: add double of VLAN header when computing the max MTU Jason Xing
2023-02-04 13:35 ` [Intel-wired-lan] " Jason Xing
2023-02-07 19:03 ` Tony Nguyen
2023-02-07 19:03 ` [Intel-wired-lan] " Tony Nguyen
2023-02-08 2:03 ` Jason Xing
2023-02-08 2:03 ` [Intel-wired-lan] " Jason Xing
2023-02-04 13:35 ` Jason Xing [this message]
2023-02-04 13:35 ` [Intel-wired-lan] [PATCH net 3/3] ixgbe: " Jason Xing
2023-02-09 0:47 ` Jason Xing
2023-02-09 0:47 ` [Intel-wired-lan] " Jason Xing
2023-02-09 1:08 ` Alexander Duyck
2023-02-09 1:08 ` [Intel-wired-lan] " Alexander Duyck
2023-02-09 2:22 ` Jason Xing
2023-02-09 2:22 ` [Intel-wired-lan] " Jason Xing
2023-02-09 2:57 ` Jakub Kicinski
2023-02-09 2:57 ` [Intel-wired-lan] " Jakub Kicinski
-- strict thread matches above, loose matches on Subject: below --
2023-02-14 18:51 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2023-02-14 (ixgbe, i40e) Tony Nguyen
2023-02-14 18:51 ` [PATCH net 3/3] ixgbe: add double of VLAN header when computing the max MTU Tony Nguyen
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=20230204133535.99921-4-kerneljasonxing@gmail.com \
--to=kerneljasonxing@gmail.com \
--cc=alexandr.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=john.fastabend@gmail.com \
--cc=kernelxing@tencent.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.