Skip to content

Commit 36c471f

Browse files
author
Simon
committed
fix ecm
1 parent aec5127 commit 36c471f

22 files changed

Lines changed: 559 additions & 166 deletions
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 9827d8597545ecfee17eba7b08d48dbcdf55c614 Mon Sep 17 00:00:00 2001
2+
From: Ansuel Smith <ansuelsmth@gmail.com>
3+
Date: Sun, 8 May 2022 18:39:39 +0200
4+
Subject: [PATCH 09/12] ecm_tracker_datagram: drop static for EXPORT_SYMBOL
5+
6+
EXPORT_SYMBOL should NOT be static
7+
8+
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
9+
---
10+
ecm_tracker_datagram.c | 8 ++++----
11+
1 file changed, 4 insertions(+), 4 deletions(-)
12+
13+
--- a/ecm_tracker_datagram.c
14+
+++ b/ecm_tracker_datagram.c
15+
@@ -204,7 +204,7 @@ static void ecm_tracker_datagram_datagra
16+
* ecm_tracker_datagram_discard_all()
17+
* Discard all tracked data
18+
*/
19+
-static void ecm_tracker_datagram_discard_all(struct ecm_tracker_datagram_internal_instance *dtii)
20+
+void ecm_tracker_datagram_discard_all(struct ecm_tracker_datagram_internal_instance *dtii)
21+
{
22+
int32_t src_count;
23+
int32_t dest_count;
24+
@@ -364,7 +364,7 @@ static void ecm_tracker_datagram_datagra
25+
* ecm_tracker_datagram_datagram_size_get()
26+
* Return size in bytes of datagram at index i that was sent to the target
27+
*/
28+
-static int32_t ecm_tracker_datagram_datagram_size_get(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i)
29+
+int32_t ecm_tracker_datagram_datagram_size_get(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i)
30+
{
31+
struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti;
32+
33+
@@ -411,7 +411,7 @@ static int32_t ecm_tracker_datagram_data
34+
* ecm_tracker_datagram_datagram_read()
35+
* Read size bytes from datagram at index i into the buffer
36+
*/
37+
-static int ecm_tracker_datagram_datagram_read(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i, int32_t offset, int32_t size, void *buffer)
38+
+int ecm_tracker_datagram_datagram_read(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i, int32_t offset, int32_t size, void *buffer)
39+
{
40+
struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti;
41+
int res;
42+
@@ -464,7 +464,7 @@ static int ecm_tracker_datagram_datagram
43+
* ecm_tracker_datagram_datagram_add()
44+
* Append the datagram onto the tracker queue for the given target
45+
*/
46+
-static bool ecm_tracker_datagram_datagram_add(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, struct sk_buff *skb)
47+
+bool ecm_tracker_datagram_datagram_add(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, struct sk_buff *skb)
48+
{
49+
struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti;
50+
struct sk_buff *skbc;
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From ef638a84405c9f6556a9d7c257ccbba74efd228e Mon Sep 17 00:00:00 2001
2+
From: Ansuel Smith <ansuelsmth@gmail.com>
3+
Date: Sat, 14 May 2022 20:15:10 +0200
4+
Subject: [PATCH 10/12] frontends: drop udp_get_timeouts and use standard
5+
upstream api
6+
7+
Drop udp_get_timeouts and use nf_udp_pernet and ->timeouts
8+
instead or relying on a downstream api not present upstream.
9+
---
10+
frontends/nss/ecm_nss_ipv4.c | 3 ++-
11+
frontends/nss/ecm_nss_ipv6.c | 3 ++-
12+
frontends/sfe/ecm_sfe_ipv4.c | 3 ++-
13+
frontends/sfe/ecm_sfe_ipv6.c | 3 ++-
14+
4 files changed, 8 insertions(+), 4 deletions(-)
15+
16+
--- a/frontends/nss/ecm_nss_ipv4.c
17+
+++ b/frontends/nss/ecm_nss_ipv4.c
18+
@@ -598,7 +598,8 @@ sync_conntrack:
19+
#else
20+
timeouts = nf_ct_timeout_lookup(ct);
21+
if (!timeouts) {
22+
- timeouts = udp_get_timeouts(nf_ct_net(ct));
23+
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
24+
+ timeouts = un->timeouts;
25+
}
26+
27+
spin_lock_bh(&ct->lock);
28+
--- a/frontends/nss/ecm_nss_ipv6.c
29+
+++ b/frontends/nss/ecm_nss_ipv6.c
30+
@@ -575,7 +575,8 @@ sync_conntrack:
31+
#else
32+
timeouts = nf_ct_timeout_lookup(ct);
33+
if (!timeouts) {
34+
- timeouts = udp_get_timeouts(nf_ct_net(ct));
35+
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
36+
+ timeouts = un->timeouts;
37+
}
38+
39+
spin_lock_bh(&ct->lock);
40+
--- a/frontends/sfe/ecm_sfe_ipv4.c
41+
+++ b/frontends/sfe/ecm_sfe_ipv4.c
42+
@@ -567,7 +567,8 @@ sync_conntrack:
43+
#else
44+
timeouts = nf_ct_timeout_lookup(ct);
45+
if (!timeouts) {
46+
- timeouts = udp_get_timeouts(nf_ct_net(ct));
47+
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
48+
+ timeouts = un->timeouts;
49+
}
50+
51+
spin_lock_bh(&ct->lock);
52+
--- a/frontends/sfe/ecm_sfe_ipv6.c
53+
+++ b/frontends/sfe/ecm_sfe_ipv6.c
54+
@@ -559,7 +559,8 @@ sync_conntrack:
55+
#else
56+
timeouts = nf_ct_timeout_lookup(ct);
57+
if (!timeouts) {
58+
- timeouts = udp_get_timeouts(nf_ct_net(ct));
59+
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
60+
+ timeouts = un->timeouts;
61+
}
62+
63+
spin_lock_bh(&ct->lock);

PATCH/pkgs/sfev2/qca-nss-ecm/patches/001-remove-werror.patch renamed to PATCH/pkgs/sfev2/qca-nss-ecm/patches/0003-remove-werror.patch

File renamed without changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/ecm_interface.c
2+
+++ b/ecm_interface.c
3+
@@ -4301,7 +4301,7 @@ identifier_update:
4+
if (skb && (skb->skb_iif == dev->ifindex)) {
5+
struct pppol2tp_common_addr info;
6+
7+
- if (__ppp_is_multilink(dev) > 0) {
8+
+ if (ppp_is_multilink(dev) > 0) {
9+
DEBUG_TRACE("%px: Net device: %px is MULTILINK PPP - Unknown to the ECM\n", feci, dev);
10+
type_info.unknown.os_specific_ident = dev_interface_num;
11+
12+
@@ -4311,7 +4311,7 @@ identifier_update:
13+
ii = ecm_interface_unknown_interface_establish(&type_info.unknown, dev_name, dev_interface_num, ae_interface_num, dev_mtu);
14+
return ii;
15+
}
16+
- channel_count = __ppp_hold_channels(dev, ppp_chan, 1);
17+
+ channel_count = ppp_hold_channels(dev, ppp_chan, 1);
18+
if (channel_count != 1) {
19+
DEBUG_TRACE("%px: Net device: %px PPP has %d channels - ECM cannot handle this (interface becomes Unknown type)\n",
20+
feci, dev, channel_count);
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--- a/frontends/include/ecm_front_end_common.h
2+
+++ b/frontends/include/ecm_front_end_common.h
3+
@@ -347,15 +347,19 @@ static inline bool ecm_front_end_ppppoe_
4+
fe_type = ecm_front_end_type_get();
5+
switch (fe_type) {
6+
#ifdef ECM_FRONT_END_NSS_ENABLE
7+
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
8+
case ECM_FRONT_END_TYPE_NSS:
9+
ret = (nss_pppoe_get_br_accel_mode() == NSS_PPPOE_BR_ACCEL_MODE_DIS);
10+
break;
11+
#endif
12+
+#endif
13+
#ifdef ECM_FRONT_END_SFE_ENABLE
14+
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
15+
case ECM_FRONT_END_TYPE_SFE:
16+
ret = (sfe_pppoe_get_br_accel_mode() == SFE_PPPOE_BR_ACCEL_MODE_DISABLED);
17+
break;
18+
#endif
19+
+#endif
20+
default:
21+
DEBUG_TRACE("front end type: %d\n", fe_type);
22+
break;
23+
@@ -377,15 +381,19 @@ static inline bool ecm_front_end_ppppoe_
24+
fe_type = ecm_front_end_type_get();
25+
switch (fe_type) {
26+
#ifdef ECM_FRONT_END_NSS_ENABLE
27+
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
28+
case ECM_FRONT_END_TYPE_NSS:
29+
ret = (nss_pppoe_get_br_accel_mode() == NSS_PPPOE_BR_ACCEL_MODE_EN_3T);
30+
break;
31+
#endif
32+
+#endif
33+
#ifdef ECM_FRONT_END_SFE_ENABLE
34+
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
35+
case ECM_FRONT_END_TYPE_SFE:
36+
ret = (sfe_pppoe_get_br_accel_mode() == SFE_PPPOE_BR_ACCEL_MODE_EN_3T);
37+
break;
38+
#endif
39+
+#endif
40+
default:
41+
DEBUG_WARN("front end type: %d is not supported\n", fe_type);
42+
break;
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
--- a/frontends/nss/ecm_nss_common.c
2+
+++ b/frontends/nss/ecm_nss_common.c
3+
@@ -67,6 +67,7 @@ bool ecm_nss_ipv6_is_conn_limit_reached(
4+
5+
return false;
6+
}
7+
+EXPORT_SYMBOL(ecm_nss_ipv6_is_conn_limit_reached);
8+
#endif
9+
10+
/*
11+
@@ -116,3 +117,4 @@ bool ecm_nss_ipv4_is_conn_limit_reached(
12+
13+
return false;
14+
}
15+
+EXPORT_SYMBOL(ecm_nss_ipv4_is_conn_limit_reached);
16+
--- a/frontends/nss/ecm_nss_non_ported_ipv4.c
17+
+++ b/frontends/nss/ecm_nss_non_ported_ipv4.c
18+
@@ -1906,6 +1906,7 @@ struct ecm_front_end_connection_instance
19+
20+
return feci;
21+
}
22+
+EXPORT_SYMBOL(ecm_nss_non_ported_ipv4_connection_instance_alloc);
23+
24+
/*
25+
* ecm_nss_non_ported_ipv4_init()
26+
--- a/frontends/nss/ecm_nss_non_ported_ipv4.h
27+
+++ b/frontends/nss/ecm_nss_non_ported_ipv4.h
28+
@@ -8,7 +8,7 @@
29+
30+
extern void ecm_nss_non_ported_ipv4_init(struct dentry *dentry);
31+
32+
-extern struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv4_connection_instance_alloc(
33+
+struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv4_connection_instance_alloc(
34+
uint32_t accel_flags,
35+
int protocol,
36+
struct ecm_db_connection_instance **nci);
37+
--- a/frontends/nss/ecm_nss_non_ported_ipv6.c
38+
+++ b/frontends/nss/ecm_nss_non_ported_ipv6.c
39+
@@ -1716,6 +1716,7 @@ struct ecm_front_end_connection_instance
40+
41+
return feci;
42+
}
43+
+EXPORT_SYMBOL(ecm_nss_non_ported_ipv6_connection_instance_alloc);
44+
45+
/*
46+
* ecm_nss_non_ported_ipv6_init()
47+
--- a/frontends/nss/ecm_nss_non_ported_ipv6.h
48+
+++ b/frontends/nss/ecm_nss_non_ported_ipv6.h
49+
@@ -8,7 +8,7 @@
50+
51+
extern void ecm_nss_non_ported_ipv6_init(struct dentry *dentry);
52+
53+
-extern struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv6_connection_instance_alloc(
54+
+struct ecm_front_end_connection_instance *ecm_nss_non_ported_ipv6_connection_instance_alloc(
55+
uint32_t accel_flags,
56+
int protocol,
57+
struct ecm_db_connection_instance **nci);
58+
--- a/frontends/nss/ecm_nss_ported_ipv4.c
59+
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
60+
@@ -2036,6 +2036,7 @@ struct ecm_front_end_connection_instance
61+
62+
return feci;
63+
}
64+
+EXPORT_SYMBOL(ecm_nss_ported_ipv4_connection_instance_alloc);
65+
66+
/*
67+
* ecm_nss_ported_ipv4_init()
68+
--- a/frontends/nss/ecm_nss_ported_ipv4.h
69+
+++ b/frontends/nss/ecm_nss_ported_ipv4.h
70+
@@ -8,7 +8,7 @@
71+
72+
extern void ecm_nss_ported_ipv4_init(struct dentry *dentry);
73+
74+
-extern struct ecm_front_end_connection_instance *ecm_nss_ported_ipv4_connection_instance_alloc(
75+
+struct ecm_front_end_connection_instance *ecm_nss_ported_ipv4_connection_instance_alloc(
76+
uint32_t accel_flags,
77+
int protocol,
78+
struct ecm_db_connection_instance **nci);
79+
--- a/frontends/nss/ecm_nss_ported_ipv6.c
80+
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
81+
@@ -1950,6 +1950,7 @@ struct ecm_front_end_connection_instance
82+
83+
return feci;
84+
}
85+
+EXPORT_SYMBOL(ecm_nss_ported_ipv6_connection_instance_alloc);
86+
87+
/*
88+
* ecm_nss_ported_ipv6_init()
89+
--- a/frontends/nss/ecm_nss_ported_ipv6.h
90+
+++ b/frontends/nss/ecm_nss_ported_ipv6.h
91+
@@ -8,7 +8,7 @@
92+
93+
extern void ecm_nss_ported_ipv6_init(struct dentry *dentry);
94+
95+
-extern struct ecm_front_end_connection_instance *ecm_nss_ported_ipv6_connection_instance_alloc(
96+
+struct ecm_front_end_connection_instance *ecm_nss_ported_ipv6_connection_instance_alloc(
97+
uint32_t accel_flags,
98+
int protocol,
99+
struct ecm_db_connection_instance **nci);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/frontends/nss/ecm_nss_common.h
2+
+++ b/frontends/nss/ecm_nss_common.h
3+
@@ -277,8 +277,10 @@ static inline bool ecm_nss_common_igs_ac
4+
*/
5+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0))
6+
if (likely(!(to_dev->ingress_cl_list))) {
7+
-#else
8+
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
9+
if (likely(!(to_dev->miniq_ingress))) {
10+
+#else
11+
+ if (likely(!(to_dev->tcx_ingress))) {
12+
#endif
13+
dev_put(to_dev);
14+
continue;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/ecm_interface.c
2+
+++ b/ecm_interface.c
3+
@@ -4724,7 +4724,11 @@ static uint32_t ecm_interface_multicast_
4+
* For MLO bond netdevice, destination for multicast is bond netdevice itself
5+
* Therefore, slave lookup is not needed.
6+
*/
7+
+#ifdef ECM_FRONT_END_SFE_ENABLE
8+
if (ecm_front_end_is_lag_master(dest_dev) && !bond_is_mlo_device(dest_dev)) {
9+
+#else
10+
+ if (ecm_front_end_is_lag_master(dest_dev)) {
11+
+#endif
12+
/*
13+
* Link aggregation
14+
* Figure out which slave device of the link aggregation will be used to reach the destination.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/frontends/nss/ecm_nss_non_ported_ipv4.c
2+
+++ b/frontends/nss/ecm_nss_non_ported_ipv4.c
3+
@@ -889,7 +889,7 @@ static void ecm_nss_non_ported_ipv4_conn
4+
#endif
5+
break;
6+
case ECM_DB_IFACE_TYPE_RAWIP:
7+
-#ifdef ECM_INTERFACE_RAWIP_ENABLE
8+
+#if defined(NSS_FIRMWARE_VERSION_12_5) && defined(ECM_INTERFACE_RAWIP_ENABLE)
9+
nircm->valid_flags |= NSS_IPV4_RULE_CREATE_RAWIP_VALID;
10+
#else
11+
rule_invalid = true;
12+
@@ -1131,7 +1131,7 @@ static void ecm_nss_non_ported_ipv4_conn
13+
#endif
14+
break;
15+
case ECM_DB_IFACE_TYPE_RAWIP:
16+
-#ifdef ECM_INTERFACE_RAWIP_ENABLE
17+
+#if defined(NSS_FIRMWARE_VERSION_12_5) && defined(ECM_INTERFACE_RAWIP_ENABLE)
18+
nircm->valid_flags |= NSS_IPV4_RULE_CREATE_RAWIP_VALID;
19+
#else
20+
rule_invalid = true;

0 commit comments

Comments
 (0)