]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: hns3: some cleanup for struct hns3_enet_ring
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 6 May 2019 02:48:51 +0000 (10:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 17:37:14 +0000 (10:37 -0700)
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>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h

index b6e73feae45d2afb6dcb05d58342503c39c72a49..65fb42133cfdffd7ffd90b27128bc42c3ec6b6a2 100644 (file)
@@ -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;
        }
index 9680a688bce2b6bea4e94c87d9c24afc56f2b2e8..c14480f9b62577766d02e19db427e16aa1a6bee8 100644 (file)
@@ -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)