Commit 845e0d1d authored by Yunsheng Lin's avatar Yunsheng Lin Committed by David S. Miller

net: hns3: some cleanup for struct hns3_enet_ring

This patch removes some unused field in struct hns3_enet_ring,
use ring->dev for ring_to_dev macro, and use dev consistently
in hns3_fill_desc.
Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 389ca146
...@@ -1051,7 +1051,7 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv, ...@@ -1051,7 +1051,7 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv,
dma = skb_frag_dma_map(dev, frag, 0, size, DMA_TO_DEVICE); dma = skb_frag_dma_map(dev, frag, 0, size, DMA_TO_DEVICE);
} }
if (unlikely(dma_mapping_error(ring->dev, dma))) { if (unlikely(dma_mapping_error(dev, dma))) {
ring->stats.sw_err_cnt++; ring->stats.sw_err_cnt++;
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -401,7 +401,6 @@ struct hns3_enet_ring { ...@@ -401,7 +401,6 @@ struct hns3_enet_ring {
struct hns3_enet_ring *next; struct hns3_enet_ring *next;
struct hns3_enet_tqp_vector *tqp_vector; struct hns3_enet_tqp_vector *tqp_vector;
struct hnae3_queue *tqp; struct hnae3_queue *tqp;
char ring_name[HNS3_RING_NAME_LEN];
struct device *dev; /* will be used for DMA mapping of descriptors */ struct device *dev; /* will be used for DMA mapping of descriptors */
/* statistic */ /* statistic */
...@@ -411,9 +410,6 @@ struct hns3_enet_ring { ...@@ -411,9 +410,6 @@ struct hns3_enet_ring {
dma_addr_t desc_dma_addr; dma_addr_t desc_dma_addr;
u32 buf_size; /* size for hnae_desc->addr, preset by AE */ u32 buf_size; /* size for hnae_desc->addr, preset by AE */
u16 desc_num; /* total number of desc */ u16 desc_num; /* total number of desc */
u16 max_desc_num_per_pkt;
u16 max_raw_data_sz_per_desc;
u16 max_pkt_size;
int next_to_use; /* idx of next spare desc */ int next_to_use; /* idx of next spare desc */
/* idx of lastest sent desc, the ring is empty when equal to /* idx of lastest sent desc, the ring is empty when equal to
...@@ -427,9 +423,6 @@ struct hns3_enet_ring { ...@@ -427,9 +423,6 @@ struct hns3_enet_ring {
u32 flag; /* ring attribute */ u32 flag; /* ring attribute */
int numa_node;
cpumask_t affinity_mask;
int pending_buf; int pending_buf;
struct sk_buff *skb; struct sk_buff *skb;
struct sk_buff *tail_skb; struct sk_buff *tail_skb;
...@@ -629,7 +622,7 @@ static inline bool hns3_nic_resetting(struct net_device *netdev) ...@@ -629,7 +622,7 @@ static inline bool hns3_nic_resetting(struct net_device *netdev)
#define hnae3_queue_xmit(tqp, buf_num) writel_relaxed(buf_num, \ #define hnae3_queue_xmit(tqp, buf_num) writel_relaxed(buf_num, \
(tqp)->io_base + HNS3_RING_TX_RING_TAIL_REG) (tqp)->io_base + HNS3_RING_TX_RING_TAIL_REG)
#define ring_to_dev(ring) (&(ring)->tqp->handle->pdev->dev) #define ring_to_dev(ring) ((ring)->dev)
#define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \ #define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \
DMA_TO_DEVICE : DMA_FROM_DEVICE) DMA_TO_DEVICE : DMA_FROM_DEVICE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment