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: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
389ca14615
commit
845e0d1d52
|
@ -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);
|
||||
}
|
||||
|
||||
if (unlikely(dma_mapping_error(ring->dev, dma))) {
|
||||
if (unlikely(dma_mapping_error(dev, dma))) {
|
||||
ring->stats.sw_err_cnt++;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
@ -401,7 +401,6 @@ struct hns3_enet_ring {
|
|||
struct hns3_enet_ring *next;
|
||||
struct hns3_enet_tqp_vector *tqp_vector;
|
||||
struct hnae3_queue *tqp;
|
||||
char ring_name[HNS3_RING_NAME_LEN];
|
||||
struct device *dev; /* will be used for DMA mapping of descriptors */
|
||||
|
||||
/* statistic */
|
||||
|
@ -411,9 +410,6 @@ struct hns3_enet_ring {
|
|||
dma_addr_t desc_dma_addr;
|
||||
u32 buf_size; /* size for hnae_desc->addr, preset by AE */
|
||||
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 */
|
||||
|
||||
/* idx of lastest sent desc, the ring is empty when equal to
|
||||
|
@ -427,9 +423,6 @@ struct hns3_enet_ring {
|
|||
|
||||
u32 flag; /* ring attribute */
|
||||
|
||||
int numa_node;
|
||||
cpumask_t affinity_mask;
|
||||
|
||||
int pending_buf;
|
||||
struct sk_buff *skb;
|
||||
struct sk_buff *tail_skb;
|
||||
|
@ -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, \
|
||||
(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) ? \
|
||||
DMA_TO_DEVICE : DMA_FROM_DEVICE)
|
||||
|
|
Loading…
Reference in New Issue