aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-01-18 18:05:11 -0800
committerJakub Kicinski <kuba@kernel.org>2025-01-20 11:44:57 -0800
commit3c836451ca9041cfb32a7d8f59ea15b3b991bbb3 (patch)
treefacfeb1770fa0568599b159a391ace671d2957d5 /drivers/net/netdevsim
parentMerge branch 'af_unix-set-skb-drop-reason-in-every-kfree_skb-path' (diff)
downloadlinux-3c836451ca9041cfb32a7d8f59ea15b3b991bbb3.tar.gz
linux-3c836451ca9041cfb32a7d8f59ea15b3b991bbb3.zip
net: move HDS config from ethtool state
Separate the HDS config from the ethtool state struct. The HDS config contains just simple parameters, not state. Having it as a separate struct will make it easier to clone / copy and also long term potentially make it per-queue. Reviewed-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250119020518.1962249-2-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/netdevsim')
-rw-r--r--drivers/net/netdevsim/ethtool.c9
-rw-r--r--drivers/net/netdevsim/netdev.c10
2 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/netdevsim/ethtool.c b/drivers/net/netdevsim/ethtool.c
index 12163635b759..189793debdb7 100644
--- a/drivers/net/netdevsim/ethtool.c
+++ b/drivers/net/netdevsim/ethtool.c
@@ -3,6 +3,7 @@
#include <linux/debugfs.h>
#include <linux/random.h>
+#include <net/netdev_queues.h>
#include "netdevsim.h"
@@ -71,8 +72,8 @@ static void nsim_get_ringparam(struct net_device *dev,
struct netdevsim *ns = netdev_priv(dev);
memcpy(ring, &ns->ethtool.ring, sizeof(ns->ethtool.ring));
- kernel_ring->tcp_data_split = dev->ethtool->hds_config;
- kernel_ring->hds_thresh = dev->ethtool->hds_thresh;
+ kernel_ring->tcp_data_split = dev->cfg->hds_config;
+ kernel_ring->hds_thresh = dev->cfg->hds_thresh;
kernel_ring->hds_thresh_max = NSIM_HDS_THRESHOLD_MAX;
if (kernel_ring->tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
@@ -190,8 +191,8 @@ static void nsim_ethtool_ring_init(struct netdevsim *ns)
ns->ethtool.ring.rx_mini_max_pending = 4096;
ns->ethtool.ring.tx_max_pending = 4096;
- ns->netdev->ethtool->hds_config = ETHTOOL_TCP_DATA_SPLIT_UNKNOWN;
- ns->netdev->ethtool->hds_thresh = 0;
+ ns->netdev->cfg->hds_config = ETHTOOL_TCP_DATA_SPLIT_UNKNOWN;
+ ns->netdev->cfg->hds_thresh = 0;
}
void nsim_ethtool_init(struct netdevsim *ns)
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index f92b05ccdca9..42f247cbdcee 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -55,10 +55,10 @@ static int nsim_forward_skb(struct net_device *dev, struct sk_buff *skb,
static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct netdevsim *ns = netdev_priv(dev);
- struct ethtool_netdev_state *ethtool;
struct net_device *peer_dev;
unsigned int len = skb->len;
struct netdevsim *peer_ns;
+ struct netdev_config *cfg;
struct nsim_rq *rq;
int rxq;
@@ -76,11 +76,11 @@ static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev)
rxq = rxq % peer_dev->num_rx_queues;
rq = peer_ns->rq[rxq];
- ethtool = peer_dev->ethtool;
+ cfg = peer_dev->cfg;
if (skb_is_nonlinear(skb) &&
- (ethtool->hds_config != ETHTOOL_TCP_DATA_SPLIT_ENABLED ||
- (ethtool->hds_config == ETHTOOL_TCP_DATA_SPLIT_ENABLED &&
- ethtool->hds_thresh > len)))
+ (cfg->hds_config != ETHTOOL_TCP_DATA_SPLIT_ENABLED ||
+ (cfg->hds_config == ETHTOOL_TCP_DATA_SPLIT_ENABLED &&
+ cfg->hds_thresh > len)))
skb_linearize(skb);
skb_tx_timestamp(skb);