[PATCH net-next 9/9] octeontx2-pf: use tso_features_check()

Eric Dumazet
2026-04-03T04:32:56Z

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