Skip to content
Permalink
Browse files
ethtool: extend ringparam setting/getting API with rx_buf_len
Add two new parameters kernel_ringparam and extack for
.get_ringparam and .set_ringparam to extend more ring params
through netlink.

Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
  • Loading branch information
Hao Chen authored and intel-lab-lkp committed Nov 17, 2021
1 parent faf14a9 commit da4c6abe75add01de642c7b12fd4268cd9c5f14e
Show file tree
Hide file tree
Showing 99 changed files with 617 additions and 212 deletions.
@@ -1441,7 +1441,9 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
}

static void vector_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct vector_private *vp = netdev_priv(netdev);

@@ -20,7 +20,9 @@ static void c_can_get_drvinfo(struct net_device *netdev,
}

static void c_can_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct c_can_priv *priv = netdev_priv(netdev);

@@ -1138,7 +1138,9 @@ typhoon_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
}

static void
typhoon_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
typhoon_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
ering->rx_max_pending = RXENT_ENTRIES;
ering->tx_max_pending = TXLO_ENTRIES - 1;
@@ -465,7 +465,9 @@ static void ena_get_drvinfo(struct net_device *dev,
}

static void ena_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct ena_adapter *adapter = netdev_priv(netdev);

@@ -476,7 +478,9 @@ static void ena_get_ringparam(struct net_device *netdev,
}

static int ena_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct ena_adapter *adapter = netdev_priv(netdev);
u32 new_tx_size, new_rx_size;
@@ -860,7 +860,9 @@ static int pcnet32_nway_reset(struct net_device *dev)
}

static void pcnet32_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct pcnet32_private *lp = netdev_priv(dev);

@@ -871,7 +873,9 @@ static void pcnet32_get_ringparam(struct net_device *dev,
}

static int pcnet32_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct pcnet32_private *lp = netdev_priv(dev);
unsigned long flags;
@@ -619,8 +619,11 @@ static int xgbe_get_module_eeprom(struct net_device *netdev,
return pdata->phy_if.module_eeprom(pdata, eeprom, data);
}

static void xgbe_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ringparam)
static void
xgbe_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ringparam,
struct kernel_ethtool_ringparam *kernel_ringparam,
struct netlink_ext_ack *extack)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);

@@ -631,7 +634,9 @@ static void xgbe_get_ringparam(struct net_device *netdev,
}

static int xgbe_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ringparam)
struct ethtool_ringparam *ringparam,
struct kernel_ethtool_ringparam *kernel_ringparam,
struct netlink_ext_ack *extack)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
unsigned int rx, tx;
@@ -812,7 +812,9 @@ static int aq_ethtool_set_pauseparam(struct net_device *ndev,
}

static void aq_get_ringparam(struct net_device *ndev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct aq_nic_s *aq_nic = netdev_priv(ndev);
struct aq_nic_cfg_s *cfg;
@@ -827,7 +829,9 @@ static void aq_get_ringparam(struct net_device *ndev,
}

static int aq_set_ringparam(struct net_device *ndev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct aq_nic_s *aq_nic = netdev_priv(ndev);
const struct aq_hw_caps_s *hw_caps;
@@ -3438,7 +3438,9 @@ static void atl1_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
}

static void atl1_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct atl1_adapter *adapter = netdev_priv(netdev);
struct atl1_tpd_ring *txdr = &adapter->tpd_ring;
@@ -3451,7 +3453,9 @@ static void atl1_get_ringparam(struct net_device *netdev,
}

static int atl1_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct atl1_adapter *adapter = netdev_priv(netdev);
struct atl1_tpd_ring *tpdr = &adapter->tpd_ring;
@@ -1961,7 +1961,9 @@ static int b44_set_link_ksettings(struct net_device *dev,
}

static void b44_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct b44 *bp = netdev_priv(dev);

@@ -1972,7 +1974,9 @@ static void b44_get_ringparam(struct net_device *dev,
}

static int b44_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct b44 *bp = netdev_priv(dev);

@@ -1497,8 +1497,11 @@ static int bcm_enet_set_link_ksettings(struct net_device *dev,
}
}

static void bcm_enet_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
static void
bcm_enet_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bcm_enet_priv *priv;

@@ -1512,7 +1515,9 @@ static void bcm_enet_get_ringparam(struct net_device *dev,
}

static int bcm_enet_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bcm_enet_priv *priv;
int was_running;
@@ -2579,8 +2584,11 @@ static void bcm_enetsw_get_ethtool_stats(struct net_device *netdev,
}
}

static void bcm_enetsw_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
static void
bcm_enetsw_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bcm_enet_priv *priv;

@@ -2595,8 +2603,11 @@ static void bcm_enetsw_get_ringparam(struct net_device *dev,
ering->tx_pending = priv->tx_ring_size;
}

static int bcm_enetsw_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
static int
bcm_enetsw_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bcm_enet_priv *priv;
int was_running;
@@ -7318,7 +7318,9 @@ static int bnx2_set_coalesce(struct net_device *dev,
}

static void
bnx2_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
bnx2_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bnx2 *bp = netdev_priv(dev);

@@ -7389,7 +7391,9 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx, bool reset_irq)
}

static int
bnx2_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
bnx2_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bnx2 *bp = netdev_priv(dev);
int rc;
@@ -1914,7 +1914,9 @@ static int bnx2x_set_coalesce(struct net_device *dev,
}

static void bnx2x_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bnx2x *bp = netdev_priv(dev);

@@ -1938,7 +1940,9 @@ static void bnx2x_get_ringparam(struct net_device *dev,
}

static int bnx2x_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bnx2x *bp = netdev_priv(dev);

@@ -775,7 +775,9 @@ static void bnxt_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
}

static void bnxt_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bnxt *bp = netdev_priv(dev);

@@ -794,7 +796,9 @@ static void bnxt_get_ringparam(struct net_device *dev,
}

static int bnxt_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct bnxt *bp = netdev_priv(dev);

@@ -12390,7 +12390,10 @@ static int tg3_nway_reset(struct net_device *dev)
return r;
}

static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
static void tg3_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct tg3 *tp = netdev_priv(dev);

@@ -12411,7 +12414,10 @@ static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *
ering->tx_pending = tp->napi[0].tx_pending;
}

static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
static int tg3_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct tg3 *tp = netdev_priv(dev);
int i, irq_sync = 0, err = 0;
@@ -405,7 +405,9 @@ static int bnad_set_coalesce(struct net_device *netdev,

static void
bnad_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ringparam)
struct ethtool_ringparam *ringparam,
struct kernel_ethtool_ringparam *kernel_ringparam,
struct netlink_ext_ack *extack)
{
struct bnad *bnad = netdev_priv(netdev);

@@ -418,7 +420,9 @@ bnad_get_ringparam(struct net_device *netdev,

static int
bnad_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ringparam)
struct ethtool_ringparam *ringparam,
struct kernel_ethtool_ringparam *kernel_ringparam,
struct netlink_ext_ack *extack)
{
int i, current_err, err = 0;
struct bnad *bnad = netdev_priv(netdev);
@@ -3135,7 +3135,9 @@ static int macb_set_link_ksettings(struct net_device *netdev,
}

static void macb_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct macb *bp = netdev_priv(netdev);

@@ -3147,7 +3149,9 @@ static void macb_get_ringparam(struct net_device *netdev,
}

static int macb_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{
struct macb *bp = netdev_priv(netdev);
u32 new_rx_size, new_tx_size;
@@ -947,7 +947,9 @@ static int lio_set_phys_id(struct net_device *netdev,

static void
lio_ethtool_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ering)
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
struct lio *lio = GET_LIO(netdev);
struct octeon_device *oct = lio->oct_dev;
@@ -1252,8 +1254,11 @@ static int lio_reset_queues(struct net_device *netdev, uint32_t num_qs)
return 0;
}

static int lio_ethtool_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ering)
static int
lio_ethtool_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ering,
struct kernel_ethtool_ringparam *kernel_ering,
struct netlink_ext_ack *extack)
{
u32 rx_count, tx_count, rx_count_old, tx_count_old;
struct lio *lio = GET_LIO(netdev);

0 comments on commit da4c6ab

Please sign in to comment.