summarylogtreecommitdiffstats
path: root/0003-bnx2x-Handle-skb_vlan_eth_hdr-for-older-kernels.patch
blob: 2c56d81a2e73d015ff8e14cd3adddc2b93ad9a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 9b44453984078670b0de7b9c3670256a24e93227 Mon Sep 17 00:00:00 2001
From: Kyle Manna <kyle@kylemanna.com>
Date: Sat, 15 Jul 2023 20:31:33 -0500
Subject: [PATCH 3/4] bnx2x: Handle skb_vlan_eth_hdr() for older kernels

* Newer kernels have a helper function.
* See 1f5020acb33f926030f62563c86dffca35c7b701
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 6ea5521074d3..e31c3a63a333 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -19,6 +19,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/version.h>
 #include <linux/etherdevice.h>
 #include <linux/if_vlan.h>
 #include <linux/interrupt.h>
@@ -1935,7 +1936,12 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb,
 
 		/* Skip VLAN tag if present */
 		if (ether_type == ETH_P_8021Q) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
+			struct vlan_ethhdr *vhdr =
+				(struct vlan_ethhdr *)skb->data;
+#else
 			struct vlan_ethhdr *vhdr = skb_vlan_eth_hdr(skb);
+#endif
 
 			ether_type = ntohs(vhdr->h_vlan_encapsulated_proto);
 		}
-- 
2.41.0