diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2019-10-19 10:03:52 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-21 18:22:09 +0200 |
commit | c871195601793118ab081d82f7ddd987aa6c7da1 (patch) | |
tree | 8650ed0d38b1ec28268d10224becfff27f6c317a /drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | |
parent | net: hns3: minor optimization for barrier in IO path (diff) | |
download | linux-c871195601793118ab081d82f7ddd987aa6c7da1.tar.xz linux-c871195601793118ab081d82f7ddd987aa6c7da1.zip |
net: hns3: introduce ring_to_netdev() in enet module
There are a few places that need to access the netdev of a ring
through ring->tqp->handle->kinfo.netdev, and ring->tqp is a struct
which both in enet and hclge modules, it is better to use the
struct that is only used in enet module.
This patch adds the ring_to_netdev() to access the netdev of ring
through ring->tqp_vector->napi.dev.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.h')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h index 33222847e149..8a88002313fe 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h @@ -607,6 +607,8 @@ static inline bool hns3_nic_resetting(struct net_device *netdev) #define ring_to_dev(ring) ((ring)->dev) +#define ring_to_netdev(ring) ((ring)->tqp_vector->napi.dev) + #define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \ DMA_TO_DEVICE : DMA_FROM_DEVICE) |