Commit fb0672d1 authored by lipeng's avatar lipeng Committed by David S. Miller

net: hns: Remove redundant memset during buffer release

Because all members of desc_cb is assigned when xmit one package, so it
can delete in hnae_free_buffer, as follows:
        - "dma, priv, length, type" are assigned in fill_v2_desc.
        - "page_offset, reuse_flag, buf" are not used in tx direction.
Signed-off-by: default avatarlipeng <lipeng321@huawei.com>
Signed-off-by: default avatarWeiwei Deng <dengweiwei@huawei.com>
Reviewed-by: default avatarYisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de99208c
...@@ -61,7 +61,6 @@ static void hnae_free_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb) ...@@ -61,7 +61,6 @@ static void hnae_free_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb)
dev_kfree_skb_any((struct sk_buff *)cb->priv); dev_kfree_skb_any((struct sk_buff *)cb->priv);
else if (unlikely(is_rx_ring(ring))) else if (unlikely(is_rx_ring(ring)))
put_page((struct page *)cb->priv); put_page((struct page *)cb->priv);
memset(cb, 0, sizeof(*cb));
} }
static int hnae_map_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb) static int hnae_map_buffer(struct hnae_ring *ring, struct hnae_desc_cb *cb)
......
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