From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>, Joe Damato <joe@dama.to>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
Eric Dumazet <edumazet@google.com>,
Sunil Goutham <sgoutham@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
hariprasad <hkelam@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>
Subject: [PATCH net-next 9/9] octeontx2-pf: use tso_features_check()
Date: Fri, 3 Apr 2026 04:32:37 +0000 [thread overview]
Message-ID: <20260403043237.3909226-10-edumazet@google.com> (raw)
In-Reply-To: <20260403043237.3909226-1-edumazet@google.com>
We must fallback to GSO if a TSO packet has too big headers,
or risk corruptions.
Fixes: 86d7476078b8 ("octeontx2-pf: TCP segmentation offload support")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Sunil Goutham <sgoutham@marvell.com>
Cc: Geetha sowjanya <gakula@marvell.com>
Cc: Subbaraya Sundeep <sbhatta@marvell.com>
Cc: hariprasad <hkelam@marvell.com>
Cc: Bharat Bhushan <bbhushan2@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 1 +
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 2 ++
drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++
4 files changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index ee623476e5ff1ad10a4149a065773fcd7050d970..a6cb0058603a530a11637c054f43cf0c8d129b32 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -17,6 +17,7 @@
#include <linux/bpf_trace.h>
#include <linux/bitfield.h>
#include <net/page_pool/types.h>
+#include <net/tso.h>
#include "otx2_reg.h"
#include "otx2_common.h"
@@ -2924,6 +2925,7 @@ static int otx2_ndo_set_vf_trust(struct net_device *netdev, int vf,
static const struct net_device_ops otx2_netdev_ops = {
.ndo_open = otx2_open,
.ndo_stop = otx2_stop,
+ .ndo_features_check = tso_features_check,
.ndo_start_xmit = otx2_xmit,
.ndo_select_queue = otx2_select_queue,
.ndo_fix_features = otx2_fix_features,
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
index 625bb5a05344c0b6521c28fc28e7390553bc8f84..52cc122bf519589ad0d1f6b079bc3da03063b2f5 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
@@ -936,6 +936,7 @@ static void otx2_sq_append_tso(struct otx2_nic *pfvf, struct otx2_snd_queue *sq,
struct tso_t tso;
hdr_len = tso_start(skb, &tso);
+ DEBUG_NET_WARN_ON_ONCE(hdr_len > TSO_HEADER_SIZE);
/* Map SKB's fragments to DMA.
* It's done here to avoid mapping for every TSO segment's packet.
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
index f4fdbfba866764477d7c72f4f71da9beb0f61f5c..44ba038964e8e4b0843ac38ce9428bf249c0af47 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
@@ -9,6 +9,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/net_tstamp.h>
+#include <net/tso.h>
#include "otx2_common.h"
#include "otx2_reg.h"
@@ -526,6 +527,7 @@ static int otx2vf_set_features(struct net_device *netdev,
static const struct net_device_ops otx2vf_netdev_ops = {
.ndo_open = otx2vf_open,
.ndo_stop = otx2vf_stop,
+ .ndo_features_check = tso_features_check,
.ndo_start_xmit = otx2vf_xmit,
.ndo_select_queue = otx2_select_queue,
.ndo_set_rx_mode = otx2vf_set_rx_mode,
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
index 94f155ffb17f0060e1d1fbba3916948e5578e3a1..75f688013b75cda12522b1e3d708dbcc960502cb 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
@@ -10,6 +10,7 @@
#include <linux/pci.h>
#include <linux/net_tstamp.h>
#include <linux/sort.h>
+#include <net/tso.h>
#include "otx2_common.h"
#include "cn10k.h"
@@ -487,6 +488,7 @@ static int rvu_rep_stop(struct net_device *dev)
static const struct net_device_ops rvu_rep_netdev_ops = {
.ndo_open = rvu_rep_open,
.ndo_stop = rvu_rep_stop,
+ .ndo_features_check = tso_features_check,
.ndo_start_xmit = rvu_rep_xmit,
.ndo_get_stats64 = rvu_rep_get_stats64,
.ndo_change_mtu = rvu_rep_change_mtu,
--
2.53.0.1213.gd9a14994de-goog
prev parent reply other threads:[~2026-04-03 4:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 4:32 [PATCH net-next 0/9] net: safe guard net/core/tso.c users Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 1/9] net: tso: add tso_features_check() Eric Dumazet
2026-04-03 6:41 ` Eric Dumazet
2026-04-03 7:20 ` Eric Dumazet
2026-04-03 20:47 ` Jakub Kicinski
2026-04-03 20:49 ` Eric Dumazet
2026-04-03 21:00 ` Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 2/9] net: mvneta: use tso_features_check() Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 3/9] net: thunderx: " Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 4/9] dpaa2-eth: " Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 5/9] net: enetc: " Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 6/9] net: fec: " Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 7/9] net: mv643xx_eth: " Eric Dumazet
2026-04-03 4:32 ` [PATCH net-next 8/9] net: mvpp2: " Eric Dumazet
2026-04-03 4:32 ` Eric Dumazet [this message]
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=20260403043237.3909226-10-edumazet@google.com \
--to=edumazet@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=joe@dama.to \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.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