diff options
author | Jiawen Wu <jiawenwu@trustnetic.com> | 2024-01-03 10:08:51 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-04 10:49:35 +0000 |
commit | 883b5984a5d2900468af5ab979cae90547a78da4 (patch) | |
tree | 0f425cbcc2d505c61e3c503eec4f6dd9faa47c17 /drivers/net/ethernet/wangxun/libwx/wx_ethtool.c | |
parent | 2fe2ca09da953bac778eab5dfb309b4e7d274b1a (diff) |
net: wangxun: add ethtool_ops for ring parameters
Support to query RX/TX depth with ethtool -g, and change RX/TX depth
with ethtool -G.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wangxun/libwx/wx_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/wangxun/libwx/wx_ethtool.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c index e010303174df..225ce36586f8 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c @@ -229,3 +229,21 @@ int wx_set_pauseparam(struct net_device *netdev, return phylink_ethtool_set_pauseparam(wx->phylink, pause); } EXPORT_SYMBOL(wx_set_pauseparam); + +void wx_get_ringparam(struct net_device *netdev, + struct ethtool_ringparam *ring, + struct kernel_ethtool_ringparam *kernel_ring, + struct netlink_ext_ack *extack) +{ + struct wx *wx = netdev_priv(netdev); + + ring->rx_max_pending = WX_MAX_RXD; + ring->tx_max_pending = WX_MAX_TXD; + ring->rx_mini_max_pending = 0; + ring->rx_jumbo_max_pending = 0; + ring->rx_pending = wx->rx_ring_count; + ring->tx_pending = wx->tx_ring_count; + ring->rx_mini_pending = 0; + ring->rx_jumbo_pending = 0; +} +EXPORT_SYMBOL(wx_get_ringparam); |