Skip to content

Commit 928459b

Browse files
committed
net: ethtool: populate the default HDS params in the core
The core has the current HDS config, it can pre-populate the values for the drivers. While at it, remove the zero-setting in netdevsim. Zero are the default values since the config is zalloc'ed. Reviewed-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e58263e commit 928459b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,6 @@ static void bnxt_get_ringparam(struct net_device *dev,
835835
ering->rx_jumbo_pending = bp->rx_agg_ring_size;
836836
ering->tx_pending = bp->tx_ring_size;
837837

838-
kernel_ering->hds_thresh = dev->cfg->hds_thresh;
839838
kernel_ering->hds_thresh_max = BNXT_HDS_THRESHOLD_MAX;
840839
}
841840

drivers/net/netdevsim/ethtool.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ static void nsim_get_ringparam(struct net_device *dev,
7272
struct netdevsim *ns = netdev_priv(dev);
7373

7474
memcpy(ring, &ns->ethtool.ring, sizeof(ns->ethtool.ring));
75-
kernel_ring->tcp_data_split = dev->cfg->hds_config;
76-
kernel_ring->hds_thresh = dev->cfg->hds_thresh;
7775
kernel_ring->hds_thresh_max = NSIM_HDS_THRESHOLD_MAX;
7876

7977
if (kernel_ring->tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
@@ -190,9 +188,6 @@ static void nsim_ethtool_ring_init(struct netdevsim *ns)
190188
ns->ethtool.ring.rx_jumbo_max_pending = 4096;
191189
ns->ethtool.ring.rx_mini_max_pending = 4096;
192190
ns->ethtool.ring.tx_max_pending = 4096;
193-
194-
ns->netdev->cfg->hds_config = ETHTOOL_TCP_DATA_SPLIT_UNKNOWN;
195-
ns->netdev->cfg->hds_thresh = 0;
196191
}
197192

198193
void nsim_ethtool_init(struct netdevsim *ns)

net/ethtool/rings.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ static int rings_prepare_data(const struct ethnl_req_info *req_base,
3939
ret = ethnl_ops_begin(dev);
4040
if (ret < 0)
4141
return ret;
42+
43+
data->kernel_ringparam.tcp_data_split = dev->cfg->hds_config;
44+
data->kernel_ringparam.hds_thresh = dev->cfg->hds_thresh;
45+
4246
dev->ethtool_ops->get_ringparam(dev, &data->ringparam,
4347
&data->kernel_ringparam, info->extack);
4448
ethnl_ops_complete(dev);

0 commit comments

Comments
 (0)