提交 7fda3a93 编写于 作者: Y Yunsheng Lin 提交者: David S. Miller

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: NYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d35bced8
...@@ -2863,8 +2863,7 @@ static int hns3_add_frag(struct hns3_enet_ring *ring, struct hns3_desc *desc, ...@@ -2863,8 +2863,7 @@ static int hns3_add_frag(struct hns3_enet_ring *ring, struct hns3_desc *desc,
return -ENXIO; return -ENXIO;
if (unlikely(ring->frag_num >= MAX_SKB_FRAGS)) { if (unlikely(ring->frag_num >= MAX_SKB_FRAGS)) {
new_skb = napi_alloc_skb(&ring->tqp_vector->napi, new_skb = napi_alloc_skb(&ring->tqp_vector->napi, 0);
HNS3_RX_HEAD_SIZE);
if (unlikely(!new_skb)) { if (unlikely(!new_skb)) {
hns3_rl_err(ring_to_netdev(ring), hns3_rl_err(ring_to_netdev(ring),
"alloc rx fraglist skb fail\n"); "alloc rx fraglist skb fail\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册