Skip to content

Commit f3ccfda

Browse files
Yufeng Mokuba-moo
authored andcommitted
ethtool: extend coalesce setting uAPI with CQE mode
In order to support more coalesce parameters through netlink, add two new parameter kernel_coal and extack for .set_coalesce and .get_coalesce, then some extra info can return to user with the netlink API. Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 029ee6b commit f3ccfda

File tree

85 files changed

+576
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+576
-202
lines changed

drivers/infiniband/ulp/ipoib/ipoib_ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ static void ipoib_get_drvinfo(struct net_device *netdev,
7272
}
7373

7474
static int ipoib_get_coalesce(struct net_device *dev,
75-
struct ethtool_coalesce *coal)
75+
struct ethtool_coalesce *coal,
76+
struct kernel_ethtool_coalesce *kernel_coal,
77+
struct netlink_ext_ack *extack)
7678
{
7779
struct ipoib_dev_priv *priv = ipoib_priv(dev);
7880

@@ -83,7 +85,9 @@ static int ipoib_get_coalesce(struct net_device *dev,
8385
}
8486

8587
static int ipoib_set_coalesce(struct net_device *dev,
86-
struct ethtool_coalesce *coal)
88+
struct ethtool_coalesce *coal,
89+
struct kernel_ethtool_coalesce *kernel_coal,
90+
struct netlink_ext_ack *extack)
8791
{
8892
struct ipoib_dev_priv *priv = ipoib_priv(dev);
8993
int ret;

drivers/net/ethernet/amazon/ena/ena_ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ static int ena_get_link_ksettings(struct net_device *netdev,
357357
}
358358

359359
static int ena_get_coalesce(struct net_device *net_dev,
360-
struct ethtool_coalesce *coalesce)
360+
struct ethtool_coalesce *coalesce,
361+
struct kernel_ethtool_coalesce *kernel_coal,
362+
struct netlink_ext_ack *extack)
361363
{
362364
struct ena_adapter *adapter = netdev_priv(net_dev);
363365
struct ena_com_dev *ena_dev = adapter->ena_dev;
@@ -402,7 +404,9 @@ static void ena_update_rx_rings_nonadaptive_intr_moderation(struct ena_adapter *
402404
}
403405

404406
static int ena_set_coalesce(struct net_device *net_dev,
405-
struct ethtool_coalesce *coalesce)
407+
struct ethtool_coalesce *coalesce,
408+
struct kernel_ethtool_coalesce *kernel_coal,
409+
struct netlink_ext_ack *extack)
406410
{
407411
struct ena_adapter *adapter = netdev_priv(net_dev);
408412
struct ena_com_dev *ena_dev = adapter->ena_dev;

drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,9 @@ static void xgbe_set_msglevel(struct net_device *netdev, u32 msglevel)
428428
}
429429

430430
static int xgbe_get_coalesce(struct net_device *netdev,
431-
struct ethtool_coalesce *ec)
431+
struct ethtool_coalesce *ec,
432+
struct kernel_ethtool_coalesce *kernel_coal,
433+
struct netlink_ext_ack *extack)
432434
{
433435
struct xgbe_prv_data *pdata = netdev_priv(netdev);
434436

@@ -443,7 +445,9 @@ static int xgbe_get_coalesce(struct net_device *netdev,
443445
}
444446

445447
static int xgbe_set_coalesce(struct net_device *netdev,
446-
struct ethtool_coalesce *ec)
448+
struct ethtool_coalesce *ec,
449+
struct kernel_ethtool_coalesce *kernel_coal,
450+
struct netlink_ext_ack *extack)
447451
{
448452
struct xgbe_prv_data *pdata = netdev_priv(netdev);
449453
struct xgbe_hw_if *hw_if = &pdata->hw_if;

drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ static int aq_ethtool_set_rxnfc(struct net_device *ndev,
547547
}
548548

549549
static int aq_ethtool_get_coalesce(struct net_device *ndev,
550-
struct ethtool_coalesce *coal)
550+
struct ethtool_coalesce *coal,
551+
struct kernel_ethtool_coalesce *kernel_coal,
552+
struct netlink_ext_ack *extack)
551553
{
552554
struct aq_nic_s *aq_nic = netdev_priv(ndev);
553555
struct aq_nic_cfg_s *cfg;
@@ -571,7 +573,9 @@ static int aq_ethtool_get_coalesce(struct net_device *ndev,
571573
}
572574

573575
static int aq_ethtool_set_coalesce(struct net_device *ndev,
574-
struct ethtool_coalesce *coal)
576+
struct ethtool_coalesce *coal,
577+
struct kernel_ethtool_coalesce *kernel_coal,
578+
struct netlink_ext_ack *extack)
575579
{
576580
struct aq_nic_s *aq_nic = netdev_priv(ndev);
577581
struct aq_nic_cfg_s *cfg;

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,9 @@ static void bcm_sysport_set_tx_coalesce(struct bcm_sysport_tx_ring *ring,
607607
}
608608

609609
static int bcm_sysport_get_coalesce(struct net_device *dev,
610-
struct ethtool_coalesce *ec)
610+
struct ethtool_coalesce *ec,
611+
struct kernel_ethtool_coalesce *kernel_coal,
612+
struct netlink_ext_ack *extack)
611613
{
612614
struct bcm_sysport_priv *priv = netdev_priv(dev);
613615
u32 reg;
@@ -627,7 +629,9 @@ static int bcm_sysport_get_coalesce(struct net_device *dev,
627629
}
628630

629631
static int bcm_sysport_set_coalesce(struct net_device *dev,
630-
struct ethtool_coalesce *ec)
632+
struct ethtool_coalesce *ec,
633+
struct kernel_ethtool_coalesce *kernel_coal,
634+
struct netlink_ext_ack *extack)
631635
{
632636
struct bcm_sysport_priv *priv = netdev_priv(dev);
633637
struct dim_cq_moder moder;

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7242,8 +7242,10 @@ bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
72427242
return rc;
72437243
}
72447244

7245-
static int
7246-
bnx2_get_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
7245+
static int bnx2_get_coalesce(struct net_device *dev,
7246+
struct ethtool_coalesce *coal,
7247+
struct kernel_ethtool_coalesce *kernel_coal,
7248+
struct netlink_ext_ack *extack)
72477249
{
72487250
struct bnx2 *bp = netdev_priv(dev);
72497251

@@ -7264,8 +7266,10 @@ bnx2_get_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
72647266
return 0;
72657267
}
72667268

7267-
static int
7268-
bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
7269+
static int bnx2_set_coalesce(struct net_device *dev,
7270+
struct ethtool_coalesce *coal,
7271+
struct kernel_ethtool_coalesce *kernel_coal,
7272+
struct netlink_ext_ack *extack)
72697273
{
72707274
struct bnx2 *bp = netdev_priv(dev);
72717275

drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,9 @@ static int bnx2x_set_eeprom(struct net_device *dev,
18781878
}
18791879

18801880
static int bnx2x_get_coalesce(struct net_device *dev,
1881-
struct ethtool_coalesce *coal)
1881+
struct ethtool_coalesce *coal,
1882+
struct kernel_ethtool_coalesce *kernel_coal,
1883+
struct netlink_ext_ack *extack)
18821884
{
18831885
struct bnx2x *bp = netdev_priv(dev);
18841886

@@ -1891,7 +1893,9 @@ static int bnx2x_get_coalesce(struct net_device *dev,
18911893
}
18921894

18931895
static int bnx2x_set_coalesce(struct net_device *dev,
1894-
struct ethtool_coalesce *coal)
1896+
struct ethtool_coalesce *coal,
1897+
struct kernel_ethtool_coalesce *kernel_coal,
1898+
struct netlink_ext_ack *extack)
18951899
{
18961900
struct bnx2x *bp = netdev_priv(dev);
18971901

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ static void bnxt_set_msglevel(struct net_device *dev, u32 value)
4949
}
5050

5151
static int bnxt_get_coalesce(struct net_device *dev,
52-
struct ethtool_coalesce *coal)
52+
struct ethtool_coalesce *coal,
53+
struct kernel_ethtool_coalesce *kernel_coal,
54+
struct netlink_ext_ack *extack)
5355
{
5456
struct bnxt *bp = netdev_priv(dev);
5557
struct bnxt_coal *hw_coal;
@@ -79,7 +81,9 @@ static int bnxt_get_coalesce(struct net_device *dev,
7981
}
8082

8183
static int bnxt_set_coalesce(struct net_device *dev,
82-
struct ethtool_coalesce *coal)
84+
struct ethtool_coalesce *coal,
85+
struct kernel_ethtool_coalesce *kernel_coal,
86+
struct netlink_ext_ack *extack)
8387
{
8488
struct bnxt *bp = netdev_priv(dev);
8589
bool update_stats = false;

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,9 @@ static void bcmgenet_set_msglevel(struct net_device *dev, u32 level)
828828
}
829829

830830
static int bcmgenet_get_coalesce(struct net_device *dev,
831-
struct ethtool_coalesce *ec)
831+
struct ethtool_coalesce *ec,
832+
struct kernel_ethtool_coalesce *kernel_coal,
833+
struct netlink_ext_ack *extack)
832834
{
833835
struct bcmgenet_priv *priv = netdev_priv(dev);
834836
struct bcmgenet_rx_ring *ring;
@@ -890,7 +892,9 @@ static void bcmgenet_set_ring_rx_coalesce(struct bcmgenet_rx_ring *ring,
890892
}
891893

892894
static int bcmgenet_set_coalesce(struct net_device *dev,
893-
struct ethtool_coalesce *ec)
895+
struct ethtool_coalesce *ec,
896+
struct kernel_ethtool_coalesce *kernel_coal,
897+
struct netlink_ext_ack *extack)
894898
{
895899
struct bcmgenet_priv *priv = netdev_priv(dev);
896900
unsigned int i;

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14037,15 +14037,21 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1403714037
return -EOPNOTSUPP;
1403814038
}
1403914039

14040-
static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
14040+
static int tg3_get_coalesce(struct net_device *dev,
14041+
struct ethtool_coalesce *ec,
14042+
struct kernel_ethtool_coalesce *kernel_coal,
14043+
struct netlink_ext_ack *extack)
1404114044
{
1404214045
struct tg3 *tp = netdev_priv(dev);
1404314046

1404414047
memcpy(ec, &tp->coal, sizeof(*ec));
1404514048
return 0;
1404614049
}
1404714050

14048-
static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
14051+
static int tg3_set_coalesce(struct net_device *dev,
14052+
struct ethtool_coalesce *ec,
14053+
struct kernel_ethtool_coalesce *kernel_coal,
14054+
struct netlink_ext_ack *extack)
1404914055
{
1405014056
struct tg3 *tp = netdev_priv(dev);
1405114057
u32 max_rxcoal_tick_int = 0, max_txcoal_tick_int = 0;

0 commit comments

Comments
 (0)