diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2019-10-19 16:03:55 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-21 09:22:10 -0700 |
commit | 7fda3a930d15a993389018e31532f3a1e34974ab (patch) | |
tree | ee3c6828d1efab9c86336495ffd1a0a46c3def67 /drivers/net/ethernet/hisilicon/hns3 | |
parent | d35bced88f7043bee42df795cb7a0d5a8e99248c (diff) | |
download | linux-7fda3a930d15a993389018e31532f3a1e34974ab.tar.gz linux-7fda3a930d15a993389018e31532f3a1e34974ab.tar.bz2 linux-7fda3a930d15a993389018e31532f3a1e34974ab.zip |
net: hns3: do not allocate linear data for fraglist skb
Currently, napi_alloc_skb() is used to allocate skb for fraglist
when the head skb is not enough to hold the remaining data, and
the remaining data is added to the frags part of the fraglist skb,
leaving the linear part unused.
So this patch passes length of 0 to allocate fraglist skb with
zero size of linear data.
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')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 1c5e0d2a9181..0fdd684a8524 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2863,8 +2863,7 @@ static int hns3_add_frag(struct hns3_enet_ring *ring, struct hns3_desc *desc, return -ENXIO; if (unlikely(ring->frag_num >= MAX_SKB_FRAGS)) { - new_skb = napi_alloc_skb(&ring->tqp_vector->napi, - HNS3_RX_HEAD_SIZE); + new_skb = napi_alloc_skb(&ring->tqp_vector->napi, 0); if (unlikely(!new_skb)) { hns3_rl_err(ring_to_netdev(ring), "alloc rx fraglist skb fail\n"); |