diff options
author | Gerhard Engleder <gerhard@engleder-embedded.com> | 2022-11-30 20:37:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-02 10:47:49 +0000 |
commit | 4f661ccfcac70f3838f7e5ca53ac51c86e1acbb1 (patch) | |
tree | 06279bd30b0eb805911d2674d017df0a9e0163c8 /drivers | |
parent | 91644df1ba01dd584d6f0fb2b2abd9014d484957 (diff) | |
download | linux-4f661ccfcac70f3838f7e5ca53ac51c86e1acbb1.tar.bz2 |
tsnep: Add ethtool::get_channels support
Allow user space to read number of TX and RX queue. This is useful for
device dependent qdisc configurations like TAPRIO with hardware offload.
Also ethtool::get_per_queue_coalesce / set_per_queue_coalesce requires
that interface.
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/engleder/tsnep_ethtool.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/engleder/tsnep_ethtool.c b/drivers/net/ethernet/engleder/tsnep_ethtool.c index c2640e88f347..517ac8de32bb 100644 --- a/drivers/net/ethernet/engleder/tsnep_ethtool.c +++ b/drivers/net/ethernet/engleder/tsnep_ethtool.c @@ -288,6 +288,17 @@ static int tsnep_ethtool_set_rxnfc(struct net_device *netdev, } } +static void tsnep_ethtool_get_channels(struct net_device *netdev, + struct ethtool_channels *ch) +{ + struct tsnep_adapter *adapter = netdev_priv(netdev); + + ch->max_rx = adapter->num_rx_queues; + ch->max_tx = adapter->num_tx_queues; + ch->rx_count = adapter->num_rx_queues; + ch->tx_count = adapter->num_tx_queues; +} + static int tsnep_ethtool_get_ts_info(struct net_device *netdev, struct ethtool_ts_info *info) { @@ -327,6 +338,7 @@ const struct ethtool_ops tsnep_ethtool_ops = { .get_sset_count = tsnep_ethtool_get_sset_count, .get_rxnfc = tsnep_ethtool_get_rxnfc, .set_rxnfc = tsnep_ethtool_set_rxnfc, + .get_channels = tsnep_ethtool_get_channels, .get_ts_info = tsnep_ethtool_get_ts_info, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings, |