[][openwrt][common][net][Bypass seq check of pptp data packets]
[Description]
Fix for PPTP sw path issues. In multi-core scenario, checking seq num
of pptp data packets causes severe packet drop. Several issues such as
low downlink throughput, unexpected disconnections under multi-pair
setup, fluctuating throughput are all related to it. Currently, we bypass
the seq check to avoid these issues.
[Release-log]
N/A
Change-Id: I37fc584d43685e41a41500b552a2208b422d4e7e
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8504962
diff --git a/target/linux/mediatek/patches-5.4/999-2738-net-pptp-bypass-seq-check.patch b/target/linux/mediatek/patches-5.4/999-2738-net-pptp-bypass-seq-check.patch
new file mode 100644
index 0000000..625bbda
--- /dev/null
+++ b/target/linux/mediatek/patches-5.4/999-2738-net-pptp-bypass-seq-check.patch
@@ -0,0 +1,28 @@
+--- a/drivers/net/ppp/pptp.c
++++ b/drivers/net/ppp/pptp.c
+@@ -308,6 +308,15 @@ static int pptp_rcv_core(struct sock *sk
+ (PPP_PROTOCOL(payload) == PPP_LCP) &&
+ ((payload[4] == PPP_LCP_ECHOREQ) || (payload[4] == PPP_LCP_ECHOREP)))
+ goto allow_packet;
++
++ /*
++ * Updating seq_recv and checking seq of data packets causes
++ * severe packet drop in multi-core scenario. It is bypassed
++ * here as a workaround solution.
++ */
++ if ((payload[0] == PPP_ALLSTATIONS) && (payload[1] == PPP_UI) &&
++ !PPP_PROTOCOL_CTRL(payload))
++ goto allow_packet;
+ } else {
+ opt->seq_recv = seq;
+ allow_packet:
+--- a/include/uapi/linux/ppp_defs.h
++++ b/include/uapi/linux/ppp_defs.h
+@@ -23,6 +23,7 @@
+ #define PPP_ADDRESS(p) (((__u8 *)(p))[0])
+ #define PPP_CONTROL(p) (((__u8 *)(p))[1])
+ #define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
++#define PPP_PROTOCOL_CTRL(p) (PPP_PROTOCOL(p) & 0xF000)
+
+ /*
+ * Significant octet values.