mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-15 04:06:18 +00:00
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 <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250119020518.1962249-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e58263e911
commit
928459bbda
3 changed files with 4 additions and 6 deletions
|
@ -835,7 +835,6 @@ static void bnxt_get_ringparam(struct net_device *dev,
|
||||||
ering->rx_jumbo_pending = bp->rx_agg_ring_size;
|
ering->rx_jumbo_pending = bp->rx_agg_ring_size;
|
||||||
ering->tx_pending = bp->tx_ring_size;
|
ering->tx_pending = bp->tx_ring_size;
|
||||||
|
|
||||||
kernel_ering->hds_thresh = dev->cfg->hds_thresh;
|
|
||||||
kernel_ering->hds_thresh_max = BNXT_HDS_THRESHOLD_MAX;
|
kernel_ering->hds_thresh_max = BNXT_HDS_THRESHOLD_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,6 @@ static void nsim_get_ringparam(struct net_device *dev,
|
||||||
struct netdevsim *ns = netdev_priv(dev);
|
struct netdevsim *ns = netdev_priv(dev);
|
||||||
|
|
||||||
memcpy(ring, &ns->ethtool.ring, sizeof(ns->ethtool.ring));
|
memcpy(ring, &ns->ethtool.ring, sizeof(ns->ethtool.ring));
|
||||||
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;
|
kernel_ring->hds_thresh_max = NSIM_HDS_THRESHOLD_MAX;
|
||||||
|
|
||||||
if (kernel_ring->tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
|
if (kernel_ring->tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
|
||||||
|
@ -190,9 +188,6 @@ static void nsim_ethtool_ring_init(struct netdevsim *ns)
|
||||||
ns->ethtool.ring.rx_jumbo_max_pending = 4096;
|
ns->ethtool.ring.rx_jumbo_max_pending = 4096;
|
||||||
ns->ethtool.ring.rx_mini_max_pending = 4096;
|
ns->ethtool.ring.rx_mini_max_pending = 4096;
|
||||||
ns->ethtool.ring.tx_max_pending = 4096;
|
ns->ethtool.ring.tx_max_pending = 4096;
|
||||||
|
|
||||||
ns->netdev->cfg->hds_config = ETHTOOL_TCP_DATA_SPLIT_UNKNOWN;
|
|
||||||
ns->netdev->cfg->hds_thresh = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsim_ethtool_init(struct netdevsim *ns)
|
void nsim_ethtool_init(struct netdevsim *ns)
|
||||||
|
|
|
@ -39,6 +39,10 @@ static int rings_prepare_data(const struct ethnl_req_info *req_base,
|
||||||
ret = ethnl_ops_begin(dev);
|
ret = ethnl_ops_begin(dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
data->kernel_ringparam.tcp_data_split = dev->cfg->hds_config;
|
||||||
|
data->kernel_ringparam.hds_thresh = dev->cfg->hds_thresh;
|
||||||
|
|
||||||
dev->ethtool_ops->get_ringparam(dev, &data->ringparam,
|
dev->ethtool_ops->get_ringparam(dev, &data->ringparam,
|
||||||
&data->kernel_ringparam, info->extack);
|
&data->kernel_ringparam, info->extack);
|
||||||
ethnl_ops_complete(dev);
|
ethnl_ops_complete(dev);
|
||||||
|
|
Loading…
Add table
Reference in a new issue