Thread (14 messages) flat view 14 messages, 2 authors, 1d ago
WARM1d

[PATCH net-next 05/10] netvsc: do not assume mac header is set in netvsc_start_xmit()

From: Eric Dumazet <edumazet@google.com>
Date: 2026-09-02 00:33:55
Subsystem: hyper-v/azure core and drivers, networking drivers, the rest · Maintainers: "K. Y. Srinivasan", Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

We should not assume mac header is set in output path.

Use skb_eth_hdr() instead of eth_hdr() to fix the issue,
and remove now redundant skb_reset_mac_header().

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 drivers/net/hyperv/netvsc_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 1d43c73fd73f10200ee0c69c9221a2a44971b08a..d78ed0f3a3bd1de37a05187b4d7f499099041668 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -533,8 +533,7 @@ static int netvsc_xmit(struct sk_buff *skb, struct net_device *net, bool xdp_tx)
 	if (skb->protocol == htons(ETH_P_8021Q)) {
 		u16 vlan_tci;
 
-		skb_reset_mac_header(skb);
-		if (eth_type_vlan(eth_hdr(skb)->h_proto)) {
+		if (eth_type_vlan(skb_eth_hdr(skb)->h_proto)) {
 			if (unlikely(__skb_vlan_pop(skb, &vlan_tci) != 0)) {
 				++net_device_ctx->eth_stats.vlan_error;
 				goto drop;
-- 
2.55.0.966.g6673acef38-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help