[PATCH net-next 3/9] net: thunderx: use tso_features_check()

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

Fixes: 4863dea3fab0 ("net: Adding support for Cavium ThunderX network controller")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Sunil Goutham <sgoutham@marvell.com>
---
drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 ++
drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 1 +
2 files changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 1c183827cb9ea1a628433972cb6cb808a5f1cd69..e953b8e00ecbbc30d2b011ee24522445407fc7ab 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -19,6 +19,7 @@
#include <linux/filter.h>
#include <linux/net_tstamp.h>
#include <linux/workqueue.h>
+#include <net/tso.h>

#include "nic_reg.h"
#include "nic.h"
@@ -2077,6 +2078,7 @@ static void nicvf_set_rx_mode(struct net_device *netdev)
static const struct net_device_ops nicvf_netdev_ops = {
.ndo_open = nicvf_open,
.ndo_stop = nicvf_stop,
+ .ndo_features_check = tso_features_check,
.ndo_start_xmit = nicvf_xmit,
.ndo_change_mtu = nicvf_change_mtu,
.ndo_set_mac_address = nicvf_set_mac_address,
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
index 062ac4a5fa12d83d7c83f854996950a7a501f1ae..22f147cc5afb54b19f0fa2e507b28b91b2ffbb0c 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
@@ -1492,6 +1492,7 @@ static int nicvf_sq_append_tso(struct nicvf *nic, struct snd_queue *sq,
int hdr_len;

hdr_len = tso_start(skb, &tso);
+ DEBUG_NET_WARN_ON_ONCE(hdr_len > TSO_HEADER_SIZE);

total_len = skb->len - hdr_len;
while (total_len > 0) {
--
2.53.0.1213.gd9a14994de-goog