diff options
author | Edward Cree <ecree.xilinx@gmail.com> | 2022-07-28 21:57:52 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-07-30 07:22:07 +0300 |
commit | 7267aa6d99f5b82f6d0e4f537d87fa9b6ab86411 (patch) | |
tree | 234b2b6742a2968b41abdd4666b116017f069d43 /drivers/net/ethernet/sfc | |
parent | e37f3b1561a038c0630e7364740d6d55f2b5d5b5 (diff) | |
download | linux-7267aa6d99f5b82f6d0e4f537d87fa9b6ab86411.tar.xz |
sfc: implement ethtool get/set RX ring size for EF100 reps
It's not truly a ring, but the maximum length of the list of queued RX
SKBs is analogous to an RX ring size, so use that API to configure it.
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r-- | drivers/net/ethernet/sfc/ef100_rep.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_rep.c b/drivers/net/ethernet/sfc/ef100_rep.c index eac932710c63..73ae4656a6e7 100644 --- a/drivers/net/ethernet/sfc/ef100_rep.c +++ b/drivers/net/ethernet/sfc/ef100_rep.c @@ -150,10 +150,37 @@ static void efx_ef100_rep_ethtool_set_msglevel(struct net_device *net_dev, efv->msg_enable = msg_enable; } +static void efx_ef100_rep_ethtool_get_ringparam(struct net_device *net_dev, + struct ethtool_ringparam *ring, + struct kernel_ethtool_ringparam *kring, + struct netlink_ext_ack *ext_ack) +{ + struct efx_rep *efv = netdev_priv(net_dev); + + ring->rx_max_pending = U32_MAX; + ring->rx_pending = efv->rx_pring_size; +} + +static int efx_ef100_rep_ethtool_set_ringparam(struct net_device *net_dev, + struct ethtool_ringparam *ring, + struct kernel_ethtool_ringparam *kring, + struct netlink_ext_ack *ext_ack) +{ + struct efx_rep *efv = netdev_priv(net_dev); + + if (ring->rx_mini_pending || ring->rx_jumbo_pending || ring->tx_pending) + return -EINVAL; + + efv->rx_pring_size = ring->rx_pending; + return 0; +} + static const struct ethtool_ops efx_ef100_rep_ethtool_ops = { .get_drvinfo = efx_ef100_rep_get_drvinfo, .get_msglevel = efx_ef100_rep_ethtool_get_msglevel, .set_msglevel = efx_ef100_rep_ethtool_set_msglevel, + .get_ringparam = efx_ef100_rep_ethtool_get_ringparam, + .set_ringparam = efx_ef100_rep_ethtool_set_ringparam, }; static struct efx_rep *efx_ef100_rep_create_netdev(struct efx_nic *efx, |