diff options
author | Luo bin <luobin9@huawei.com> | 2020-05-14 01:37:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-15 03:38:19 +0300 |
commit | bcab67822d77142c31f69656dd24226f23acc82e (patch) | |
tree | 9f7bebac888366e0451bccc04fea49b8b84988a9 /drivers/net/ethernet/huawei/hinic/hinic_main.c | |
parent | 5a46b062e28f57bffde767437fad3ab1d0cee2c7 (diff) | |
download | linux-bcab67822d77142c31f69656dd24226f23acc82e.tar.xz |
hinic: add set_ringparam ethtool_ops support
support to change TX/RX queue depth with ethtool -G
Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/huawei/hinic/hinic_main.c')
-rw-r--r-- | drivers/net/ethernet/huawei/hinic/hinic_main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c index 3d6569d7bac8..e3ff119fe341 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -372,14 +372,15 @@ static void hinic_enable_rss(struct hinic_dev *nic_dev) netif_err(nic_dev, drv, netdev, "Failed to init rss\n"); } -static int hinic_open(struct net_device *netdev) +int hinic_open(struct net_device *netdev) { struct hinic_dev *nic_dev = netdev_priv(netdev); enum hinic_port_link_state link_state; int err, ret; if (!(nic_dev->flags & HINIC_INTF_UP)) { - err = hinic_hwdev_ifup(nic_dev->hwdev); + err = hinic_hwdev_ifup(nic_dev->hwdev, nic_dev->sq_depth, + nic_dev->rq_depth); if (err) { netif_err(nic_dev, drv, netdev, "Failed - HW interface up\n"); @@ -483,7 +484,7 @@ err_create_txqs: return err; } -static int hinic_close(struct net_device *netdev) +int hinic_close(struct net_device *netdev) { struct hinic_dev *nic_dev = netdev_priv(netdev); unsigned int flags; @@ -1038,6 +1039,8 @@ static int nic_dev_init(struct pci_dev *pdev) nic_dev->rxqs = NULL; nic_dev->tx_weight = tx_weight; nic_dev->rx_weight = rx_weight; + nic_dev->sq_depth = HINIC_SQ_DEPTH; + nic_dev->rq_depth = HINIC_RQ_DEPTH; nic_dev->sriov_info.hwdev = hwdev; nic_dev->sriov_info.pdev = pdev; |