linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next] net: hns: add skb_reset_mac_header() after skb being alloc
@ 2016-06-13 12:41 Yisen Zhuang
  2016-06-15  5:41 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Yisen Zhuang @ 2016-06-13 12:41 UTC (permalink / raw)
  To: davem, arnd; +Cc: charles.chenxin, netdev, linux-kernel, linuxarm

From: Kejian Yan <yankejian@huawei.com>

HNS receives a packet without doing anything, but it should call
skb_reset_mac_header() to initialize the header before using
eth_hdr().

Fixes: 0d6b425a3773c3445b0f51b2f333821beaacb619
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index ad742a6..15200e4 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -600,6 +600,7 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data,
 		ring->stats.sw_err_cnt++;
 		return -ENOMEM;
 	}
+	skb_reset_mac_header(skb);
 
 	prefetchw(skb->data);
 	length = le16_to_cpu(desc->rx.pkt_len);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-20 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 12:41 [patch net-next] net: hns: add skb_reset_mac_header() after skb being alloc Yisen Zhuang
2016-06-15  5:41 ` David Miller
2016-06-15 10:30   ` Yisen Zhuang
2016-06-20  7:12     ` Yisen Zhuang
2016-06-20 16:04       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).