mirror of
https://github.com/breeze303/nss-packages.git
synced 2025-12-19 18:26:33 +00:00
qca-nss-ecm: rearrange order kernel version is checked
This commit is contained in:
parent
1431912bdb
commit
e08d3c0607
@ -87,10 +87,10 @@
|
|||||||
#if defined(CONFIG_NET_CLS_ACT)
|
#if defined(CONFIG_NET_CLS_ACT)
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
- struct mini_Qdisc *miniq;
|
- struct mini_Qdisc *miniq;
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||||
+ struct bpf_mprog_entry *entry;
|
|
||||||
+#else
|
|
||||||
+ struct mini_Qdisc *entry;
|
+ struct mini_Qdisc *entry;
|
||||||
|
+#else
|
||||||
|
+ struct bpf_mprog_entry *entry;
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
dev = dev_get_by_index(&init_net, interface_num);
|
dev = dev_get_by_index(&init_net, interface_num);
|
||||||
@ -102,10 +102,10 @@
|
|||||||
- miniq = rcu_dereference_bh(dev->miniq_ingress);
|
- miniq = rcu_dereference_bh(dev->miniq_ingress);
|
||||||
- if (miniq) {
|
- if (miniq) {
|
||||||
+
|
+
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||||
+ entry = rcu_dereference_bh(dev->tcx_ingress);
|
|
||||||
+#else
|
|
||||||
+ entry = rcu_dereference_bh(dev->miniq_ingress);
|
+ entry = rcu_dereference_bh(dev->miniq_ingress);
|
||||||
|
+#else
|
||||||
|
+ entry = rcu_dereference_bh(dev->tcx_ingress);
|
||||||
+#endif
|
+#endif
|
||||||
+ if (entry) {
|
+ if (entry) {
|
||||||
DEBUG_INFO("Ingress Qdisc is present for device[%s]\n", dev->name);
|
DEBUG_INFO("Ingress Qdisc is present for device[%s]\n", dev->name);
|
||||||
@ -116,10 +116,10 @@
|
|||||||
int i;
|
int i;
|
||||||
#if defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NET_EGRESS)
|
#if defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NET_EGRESS)
|
||||||
- struct mini_Qdisc *miniq;
|
- struct mini_Qdisc *miniq;
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||||
+ struct bpf_mprog_entry *entry;
|
|
||||||
+#else
|
|
||||||
+ struct mini_Qdisc *entry;
|
+ struct mini_Qdisc *entry;
|
||||||
|
+#else
|
||||||
|
+ struct bpf_mprog_entry *entry;
|
||||||
+#endif
|
+#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -130,12 +130,26 @@
|
|||||||
#if defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NET_EGRESS)
|
#if defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NET_EGRESS)
|
||||||
- miniq = rcu_dereference_bh(dev->miniq_egress);
|
- miniq = rcu_dereference_bh(dev->miniq_egress);
|
||||||
- if (miniq) {
|
- if (miniq) {
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
|
||||||
+ entry = rcu_dereference_bh(dev->tcx_egress);
|
|
||||||
+#else
|
|
||||||
+ entry = rcu_dereference_bh(dev->miniq_egress);
|
+ entry = rcu_dereference_bh(dev->miniq_egress);
|
||||||
|
+#else
|
||||||
|
+ entry = rcu_dereference_bh(dev->tcx_egress);
|
||||||
+#endif
|
+#endif
|
||||||
+ if (entry) {
|
+ if (entry) {
|
||||||
DEBUG_INFO("Egress needed\n");
|
DEBUG_INFO("Egress needed\n");
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
return true;
|
return true;
|
||||||
|
--- a/frontends/nss/ecm_nss_common.h
|
||||||
|
+++ b/frontends/nss/ecm_nss_common.h
|
||||||
|
@@ -277,8 +277,10 @@ static inline bool ecm_nss_common_igs_ac
|
||||||
|
*/
|
||||||
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0))
|
||||||
|
if (likely(!(to_dev->ingress_cl_list))) {
|
||||||
|
-#else
|
||||||
|
+#elseif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
|
||||||
|
if (likely(!(to_dev->miniq_ingress))) {
|
||||||
|
+#else
|
||||||
|
+ if (likely(!(to_dev->tcx_ingress))) {
|
||||||
|
#endif
|
||||||
|
dev_put(to_dev);
|
||||||
|
continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user