mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
net: wangxun: move ethtool_ops.set_channels into libwx
Since function ops wx->setup_tc() is set in txgbe and ngbe, ethtool_ops.set_channels can be implemented in libwx to reduce duplicated code. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://patch.msgid.link/20260407025616.33652-6-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
d48df7e7c3
commit
b736ebed93
|
|
@ -555,7 +555,7 @@ int wx_set_channels(struct net_device *dev,
|
|||
|
||||
wx->ring_feature[RING_F_RSS].limit = count;
|
||||
|
||||
return 0;
|
||||
return wx->setup_tc(dev, netdev_get_num_tc(dev));
|
||||
}
|
||||
EXPORT_SYMBOL(wx_set_channels);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,19 +68,6 @@ static int ngbe_set_ringparam(struct net_device *netdev,
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ngbe_set_channels(struct net_device *dev,
|
||||
struct ethtool_channels *ch)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = wx_set_channels(dev, ch);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* use setup TC to update any traffic class queue mapping */
|
||||
return ngbe_setup_tc(dev, netdev_get_num_tc(dev));
|
||||
}
|
||||
|
||||
static const struct ethtool_ops ngbe_ethtool_ops = {
|
||||
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
|
||||
ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ |
|
||||
|
|
@ -104,7 +91,7 @@ static const struct ethtool_ops ngbe_ethtool_ops = {
|
|||
.get_coalesce = wx_get_coalesce,
|
||||
.set_coalesce = wx_set_coalesce,
|
||||
.get_channels = wx_get_channels,
|
||||
.set_channels = ngbe_set_channels,
|
||||
.set_channels = wx_set_channels,
|
||||
.get_rxfh_fields = wx_get_rxfh_fields,
|
||||
.set_rxfh_fields = wx_set_rxfh_fields,
|
||||
.get_rxfh_indir_size = wx_rss_indir_size,
|
||||
|
|
|
|||
|
|
@ -91,19 +91,6 @@ static int txgbe_set_ringparam(struct net_device *netdev,
|
|||
return err;
|
||||
}
|
||||
|
||||
static int txgbe_set_channels(struct net_device *dev,
|
||||
struct ethtool_channels *ch)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = wx_set_channels(dev, ch);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* use setup TC to update any traffic class queue mapping */
|
||||
return txgbe_setup_tc(dev, netdev_get_num_tc(dev));
|
||||
}
|
||||
|
||||
static int txgbe_get_ethtool_fdir_entry(struct txgbe *txgbe,
|
||||
struct ethtool_rxnfc *cmd)
|
||||
{
|
||||
|
|
@ -587,7 +574,7 @@ static const struct ethtool_ops txgbe_ethtool_ops = {
|
|||
.get_coalesce = wx_get_coalesce,
|
||||
.set_coalesce = wx_set_coalesce,
|
||||
.get_channels = wx_get_channels,
|
||||
.set_channels = txgbe_set_channels,
|
||||
.set_channels = wx_set_channels,
|
||||
.get_rxnfc = txgbe_get_rxnfc,
|
||||
.set_rxnfc = txgbe_set_rxnfc,
|
||||
.get_rx_ring_count = txgbe_get_rx_ring_count,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user