From 5b734463b377d9355ce4692f7502c85f53d94e68 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 12 Nov 2019 21:21:14 +0100 Subject: [PATCH 1/9] Add rpi-eeprom package for RPI4 --- config-rpi4 | 1 + 1 file changed, 1 insertion(+) diff --git a/config-rpi4 b/config-rpi4 index bf27d75f..29424167 100644 --- a/config-rpi4 +++ b/config-rpi4 @@ -3,3 +3,4 @@ CONFIG_TARGET_brcm2708_bcm2711=y CONFIG_TARGET_brcm2708_bcm2711_DEVICE_rpi-4=y CONFIG_PACKAGE_kmod-ath10k-ct=n CONFIG_PACKAGE_kmod-ath9k=y +CONFIG_PACKAGE_rpi-eeprom=y \ No newline at end of file From 87bcbc901fe839663d72fe454b3acefcdc9496a8 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 14 Nov 2019 21:20:51 +0100 Subject: [PATCH 2/9] Update OpenWrt --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 991ccc57..3f77d294 100755 --- a/build.sh +++ b/build.sh @@ -58,9 +58,9 @@ else fi #_get_repo source https://github.com/ysurac/openmptcprouter-source "master" -_get_repo "$OMR_TARGET/source" https://github.com/openwrt/openwrt "80a799125bf34b49793e7757e3d08d30030c1b92" -_get_repo feeds/packages https://github.com/openwrt/packages "2c08576233b5ef76a9c4f640a55ad1e0336fae0d" -_get_repo feeds/luci https://github.com/openwrt/luci "a8a76978298ba1cfddadbb48da73fa2abde82692" +_get_repo "$OMR_TARGET/source" https://github.com/openwrt/openwrt "1c6066a867400eca9e335235ff4dc43acacc1183" +_get_repo feeds/packages https://github.com/openwrt/packages "c6414d33d9e208e842ab8192ea9bda17a77a444c" +_get_repo feeds/luci https://github.com/openwrt/luci "c1f41f2919f079b82782c2ef282c834b60106621" if [ -z "$OMR_FEED" ]; then OMR_FEED=feeds/openmptcprouter From 994e8ddfaf98d71c2ff4fa0027d829169cd3e378 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 15 Nov 2019 08:57:36 +0100 Subject: [PATCH 3/9] Update UEFI patch --- patches/uefi.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/uefi.patch b/patches/uefi.patch index 31a8ef38..1b1f953b 100644 --- a/patches/uefi.patch +++ b/patches/uefi.patch @@ -928,8 +928,7 @@ index ac70e771c86..6af5cfed963 100644 GRUB_TERMINALS = GRUB_SERIAL_CONFIG = GRUB_TERMINAL_CONFIG = -@@ -43,6 +44,9 @@ endif - SIGNATURE:=$(shell perl -e 'printf("%08x", rand(0xFFFFFFFF))') +@@ -43,5 +44,8 @@ endif ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02) +EFI_SIGNATURE:=$(strip $(shell uuidgen | sed -r 's/[a-zA-Z0-9]{2}$$/00/')) From fc8619e936746bfaa4c904a465e03caa64b01407 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 15 Nov 2019 09:00:58 +0100 Subject: [PATCH 4/9] Fix UEFI patch --- patches/uefi.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/uefi.patch b/patches/uefi.patch index 1b1f953b..a4fcd505 100644 --- a/patches/uefi.patch +++ b/patches/uefi.patch @@ -930,7 +930,7 @@ index ac70e771c86..6af5cfed963 100644 GRUB_TERMINAL_CONFIG = @@ -43,5 +44,8 @@ endif ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) - ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02) + ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02) +EFI_SIGNATURE:=$(strip $(shell uuidgen | sed -r 's/[a-zA-Z0-9]{2}$$/00/')) +EFI_ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) +EFI_ROOTPART:=$(if $(EFI_ROOTPART),$(EFI_ROOTPART),PARTUUID=$(shell echo $(EFI_SIGNATURE) | sed 's/00$$/02/')) From acb5f93fe5cc58e1c4a5b268dfb4e2ca02670435 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 19 Nov 2019 18:31:31 +0100 Subject: [PATCH 5/9] Update OpenWrt --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 3f77d294..995355c2 100755 --- a/build.sh +++ b/build.sh @@ -58,9 +58,9 @@ else fi #_get_repo source https://github.com/ysurac/openmptcprouter-source "master" -_get_repo "$OMR_TARGET/source" https://github.com/openwrt/openwrt "1c6066a867400eca9e335235ff4dc43acacc1183" -_get_repo feeds/packages https://github.com/openwrt/packages "c6414d33d9e208e842ab8192ea9bda17a77a444c" -_get_repo feeds/luci https://github.com/openwrt/luci "c1f41f2919f079b82782c2ef282c834b60106621" +_get_repo "$OMR_TARGET/source" https://github.com/openwrt/openwrt "a74095c68c4fc66195f7c4885171e4f1d9e5c5e6" +_get_repo feeds/packages https://github.com/openwrt/packages "a5a6336071c37059da89e4b499a933bbd7ef0856" +_get_repo feeds/luci https://github.com/openwrt/luci "15816e668df0bbdc36f6426557e488f6ade2e3ed" if [ -z "$OMR_FEED" ]; then OMR_FEED=feeds/openmptcprouter From c8be08a4f975baf0a47140273d45ec21b42ce9ae Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 19 Nov 2019 18:31:52 +0100 Subject: [PATCH 6/9] Fix bpi-r2 compile --- .../patches-4.19/0237-wlan-memcpy-fix.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 root/target/linux/mediatek/patches-4.19/0237-wlan-memcpy-fix.patch diff --git a/root/target/linux/mediatek/patches-4.19/0237-wlan-memcpy-fix.patch b/root/target/linux/mediatek/patches-4.19/0237-wlan-memcpy-fix.patch new file mode 100644 index 00000000..4239690c --- /dev/null +++ b/root/target/linux/mediatek/patches-4.19/0237-wlan-memcpy-fix.patch @@ -0,0 +1,20 @@ +--- a/drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c 2019-11-19 10:19:47.020273630 +0100 ++++ b/drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c 2019-11-19 10:20:52.819020893 +0100 +@@ -1544,7 +1544,7 @@ + DBGLOG(SCN, INFO, "EVENT_ID_GSCAN_SCAN_AVAILABLE\n"); + + prEventGscnAvailable = (P_EVENT_GSCAN_SCAN_AVAILABLE_T) (prEvent->aucBuffer); +- memcpy(prEventGscnAvailable, (P_EVENT_GSCAN_SCAN_AVAILABLE_T) (prEvent->aucBuffer), ++ memmove(prEventGscnAvailable, (P_EVENT_GSCAN_SCAN_AVAILABLE_T) (prEvent->aucBuffer), + sizeof(EVENT_GSCAN_SCAN_AVAILABLE_T)); + + mtk_cfg80211_vendor_event_scan_results_available(wiphy, prGlueInfo->prDevHandler->ieee80211_ptr, +@@ -1647,7 +1647,7 @@ + { + DBGLOG(SCN, INFO, "EVENT_ID_GSCAN_SCAN_COMPLETE\n"); + prEventGscnScnDone = (P_EVENT_GSCAN_SCAN_COMPLETE_T) (prEvent->aucBuffer); +- memcpy(prEventGscnScnDone, (P_EVENT_GSCAN_SCAN_COMPLETE_T) (prEvent->aucBuffer), ++ memmove(prEventGscnScnDone, (P_EVENT_GSCAN_SCAN_COMPLETE_T) (prEvent->aucBuffer), + sizeof(EVENT_GSCAN_SCAN_COMPLETE_T)); + + mtk_cfg80211_vendor_event_complete_scan(wiphy, prGlueInfo->prDevHandler->ieee80211_ptr, From 909b9a14e2394433b705ed7ce70461aa472f80cc Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 19 Nov 2019 20:56:54 +0100 Subject: [PATCH 7/9] rename patch --- .../{0237-wlan-memcpy-fix.patch => 0999-wlan-memcpy-fix.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename root/target/linux/mediatek/patches-4.19/{0237-wlan-memcpy-fix.patch => 0999-wlan-memcpy-fix.patch} (100%) diff --git a/root/target/linux/mediatek/patches-4.19/0237-wlan-memcpy-fix.patch b/root/target/linux/mediatek/patches-4.19/0999-wlan-memcpy-fix.patch similarity index 100% rename from root/target/linux/mediatek/patches-4.19/0237-wlan-memcpy-fix.patch rename to root/target/linux/mediatek/patches-4.19/0999-wlan-memcpy-fix.patch From 17aa79a082018843c572d819dbbabf62f8ea68a4 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 20 Nov 2019 18:24:21 +0100 Subject: [PATCH 8/9] Update MPTCP 0.95 and add gcc8 support for uboot mtk bpi-r2 --- .../patches/421-gcc-8-compiler.patch | 287 +++++++ .../generic/hack-4.19/690-mptcp_v0.95.patch | 719 ++++++++++-------- .../generic/hack-4.19/692-mptcp-fix.patch | 21 - 3 files changed, 678 insertions(+), 349 deletions(-) create mode 100644 root/package/boot/uboot-mtk-bpi-r2/patches/421-gcc-8-compiler.patch delete mode 100644 root/target/linux/generic/hack-4.19/692-mptcp-fix.patch diff --git a/root/package/boot/uboot-mtk-bpi-r2/patches/421-gcc-8-compiler.patch b/root/package/boot/uboot-mtk-bpi-r2/patches/421-gcc-8-compiler.patch new file mode 100644 index 00000000..ab3a0171 --- /dev/null +++ b/root/package/boot/uboot-mtk-bpi-r2/patches/421-gcc-8-compiler.patch @@ -0,0 +1,287 @@ +--- /dev/null ++++ b/include/linux/compiler-gcc8.h +@@ -0,0 +1,284 @@ ++#ifndef __LINUX_COMPILER_H ++#error "Please don't include directly, include instead." ++#endif ++ ++/* ++ * Common definitions for all gcc versions go here. ++ */ ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++ ++/* Optimization barrier */ ++ ++/* The "volatile" is due to gcc bugs */ ++#define barrier() __asm__ __volatile__("": : :"memory") ++/* ++ * This version is i.e. to prevent dead stores elimination on @ptr ++ * where gcc and llvm may behave differently when otherwise using ++ * normal barrier(): while gcc behavior gets along with a normal ++ * barrier(), llvm needs an explicit input variable to be assumed ++ * clobbered. The issue is as follows: while the inline asm might ++ * access any memory it wants, the compiler could have fit all of ++ * @ptr into memory registers instead, and since @ptr never escaped ++ * from that, it proofed that the inline asm wasn't touching any of ++ * it. This version works well with both compilers, i.e. we're telling ++ * the compiler that the inline asm absolutely may see the contents ++ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495 ++ */ ++#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") ++ ++/* ++ * This macro obfuscates arithmetic on a variable address so that gcc ++ * shouldn't recognize the original var, and make assumptions about it. ++ * ++ * This is needed because the C standard makes it undefined to do ++ * pointer arithmetic on "objects" outside their boundaries and the ++ * gcc optimizers assume this is the case. In particular they ++ * assume such arithmetic does not wrap. ++ * ++ * A miscompilation has been observed because of this on PPC. ++ * To work around it we hide the relationship of the pointer and the object ++ * using this macro. ++ * ++ * Versions of the ppc64 compiler before 4.1 had a bug where use of ++ * RELOC_HIDE could trash r30. The bug can be worked around by changing ++ * the inline assembly constraint from =g to =r, in this particular ++ * case either is valid. ++ */ ++#define RELOC_HIDE(ptr, off) \ ++({ \ ++ unsigned long __ptr; \ ++ __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ ++ (typeof(ptr)) (__ptr + (off)); \ ++}) ++ ++/* Make the optimizer believe the variable can be manipulated arbitrarily. */ ++#define OPTIMIZER_HIDE_VAR(var) \ ++ __asm__ ("" : "=r" (var) : "0" (var)) ++ ++#ifdef __CHECKER__ ++#define __must_be_array(a) 0 ++#else ++/* &a[0] degrades to a pointer: a different type from an array */ ++#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) ++#endif ++ ++/* ++ * Force always-inline if the user requests it so via the .config, ++ * or if gcc is too old: ++ */ ++#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ ++ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) ++#define inline inline __attribute__((always_inline)) notrace ++#define __inline__ __inline__ __attribute__((always_inline)) notrace ++#define __inline __inline __attribute__((always_inline)) notrace ++#else ++/* A lot of inline functions can cause havoc with function tracing */ ++#define inline inline notrace ++#define __inline__ __inline__ notrace ++#define __inline __inline notrace ++#endif ++ ++#define __always_inline inline __attribute__((always_inline)) ++#define noinline __attribute__((noinline)) ++ ++#define __deprecated __attribute__((deprecated)) ++#define __packed __attribute__((packed)) ++#define __weak __attribute__((weak)) ++#define __alias(symbol) __attribute__((alias(#symbol))) ++ ++/* ++ * it doesn't make sense on ARM (currently the only user of __naked) ++ * to trace naked functions because then mcount is called without ++ * stack and frame pointer being set up and there is no chance to ++ * restore the lr register to the value before mcount was called. ++ * ++ * The asm() bodies of naked functions often depend on standard calling ++ * conventions, therefore they must be noinline and noclone. ++ * ++ * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. ++ * See GCC PR44290. ++ */ ++#define __naked __attribute__((naked)) noinline __noclone notrace ++ ++#define __noreturn __attribute__((noreturn)) ++ ++/* ++ * From the GCC manual: ++ * ++ * Many functions have no effects except the return value and their ++ * return value depends only on the parameters and/or global ++ * variables. Such a function can be subject to common subexpression ++ * elimination and loop optimization just as an arithmetic operator ++ * would be. ++ * [...] ++ */ ++#define __pure __attribute__((pure)) ++#define __aligned(x) __attribute__((aligned(x))) ++#define __printf(a, b) __attribute__((format(printf, a, b))) ++#define __scanf(a, b) __attribute__((format(scanf, a, b))) ++#define __attribute_const__ __attribute__((__const__)) ++#define __maybe_unused __attribute__((unused)) ++#define __always_unused __attribute__((unused)) ++ ++/* gcc version specific checks */ ++ ++#if GCC_VERSION < 30200 ++# error Sorry, your compiler is too old - please upgrade it. ++#endif ++ ++#if GCC_VERSION < 30300 ++# define __used __attribute__((__unused__)) ++#else ++# define __used __attribute__((__used__)) ++#endif ++ ++#ifdef CONFIG_GCOV_KERNEL ++# if GCC_VERSION < 30400 ++# error "GCOV profiling support for gcc versions below 3.4 not included" ++# endif /* __GNUC_MINOR__ */ ++#endif /* CONFIG_GCOV_KERNEL */ ++ ++#if GCC_VERSION >= 30400 ++#define __must_check __attribute__((warn_unused_result)) ++#define __malloc __attribute__((__malloc__)) ++#endif ++ ++#if GCC_VERSION >= 40000 ++ ++/* GCC 4.1.[01] miscompiles __weak */ ++#ifdef __KERNEL__ ++# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 ++# error Your version of gcc miscompiles the __weak directive ++# endif ++#endif ++ ++#define __used __attribute__((__used__)) ++#define __compiler_offsetof(a, b) \ ++ __builtin_offsetof(a, b) ++ ++#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 ++# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) ++#endif ++ ++#if GCC_VERSION >= 40300 ++/* Mark functions as cold. gcc will assume any path leading to a call ++ * to them will be unlikely. This means a lot of manual unlikely()s ++ * are unnecessary now for any paths leading to the usual suspects ++ * like BUG(), printk(), panic() etc. [but let's keep them for now for ++ * older compilers] ++ * ++ * Early snapshots of gcc 4.3 don't support this and we can't detect this ++ * in the preprocessor, but we can live with this because they're unreleased. ++ * Maketime probing would be overkill here. ++ * ++ * gcc also has a __attribute__((__hot__)) to move hot functions into ++ * a special section, but I don't see any sense in this right now in ++ * the kernel context ++ */ ++#define __cold __attribute__((__cold__)) ++ ++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++ ++#ifndef __CHECKER__ ++# define __compiletime_warning(message) __attribute__((warning(message))) ++# define __compiletime_error(message) __attribute__((error(message))) ++#endif /* __CHECKER__ */ ++#endif /* GCC_VERSION >= 40300 */ ++ ++#if GCC_VERSION >= 40500 ++/* ++ * Mark a position in code as unreachable. This can be used to ++ * suppress control flow warnings after asm blocks that transfer ++ * control elsewhere. ++ * ++ * Early snapshots of gcc 4.5 don't support this and we can't detect ++ * this in the preprocessor, but we can live with this because they're ++ * unreleased. Really, we need to have autoconf for the kernel. ++ */ ++#define unreachable() __builtin_unreachable() ++ ++/* Mark a function definition as prohibited from being cloned. */ ++#define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) ++ ++#endif /* GCC_VERSION >= 40500 */ ++ ++#if GCC_VERSION >= 40600 ++/* ++ * When used with Link Time Optimization, gcc can optimize away C functions or ++ * variables which are referenced only from assembly code. __visible tells the ++ * optimizer that something else uses this function or variable, thus preventing ++ * this. ++ */ ++#define __visible __attribute__((externally_visible)) ++#endif ++ ++ ++#if GCC_VERSION >= 40900 && !defined(__CHECKER__) ++/* ++ * __assume_aligned(n, k): Tell the optimizer that the returned ++ * pointer can be assumed to be k modulo n. The second argument is ++ * optional (default 0), so we use a variadic macro to make the ++ * shorthand. ++ * ++ * Beware: Do not apply this to functions which may return ++ * ERR_PTRs. Also, it is probably unwise to apply it to functions ++ * returning extra information in the low bits (but in that case the ++ * compiler should see some alignment anyway, when the return value is ++ * massaged by 'flags = ptr & 3; ptr &= ~3;'). ++ */ ++#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) ++#endif ++ ++/* ++ * GCC 'asm goto' miscompiles certain code sequences: ++ * ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++ * ++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++ * ++ * (asm goto is automatically volatile - the naming reflects this.) ++ */ ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++ ++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++#if GCC_VERSION >= 40400 ++#define __HAVE_BUILTIN_BSWAP32__ ++#define __HAVE_BUILTIN_BSWAP64__ ++#endif ++#if GCC_VERSION >= 40800 ++#define __HAVE_BUILTIN_BSWAP16__ ++#endif ++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ ++ ++#if GCC_VERSION >= 50000 ++#define KASAN_ABI_VERSION 4 ++#elif GCC_VERSION >= 40902 ++#define KASAN_ABI_VERSION 3 ++#endif ++ ++#if GCC_VERSION >= 40902 ++/* ++ * Tell the compiler that address safety instrumentation (KASAN) ++ * should not be applied to that function. ++ * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 ++ */ ++#define __no_sanitize_address __attribute__((no_sanitize_address)) ++#endif ++ ++#endif /* gcc version >= 40000 specific checks */ ++ ++#if !defined(__noclone) ++#define __noclone /* not needed */ ++#endif ++ ++#if !defined(__no_sanitize_address) ++#define __no_sanitize_address ++#endif ++ ++/* ++ * A trick to suppress uninitialized variable warning without generating any ++ * code ++ */ ++#define uninitialized_var(x) x = x diff --git a/root/target/linux/generic/hack-4.19/690-mptcp_v0.95.patch b/root/target/linux/generic/hack-4.19/690-mptcp_v0.95.patch index ff2f6960..0ba61758 100644 --- a/root/target/linux/generic/hack-4.19/690-mptcp_v0.95.patch +++ b/root/target/linux/generic/hack-4.19/690-mptcp_v0.95.patch @@ -1,6 +1,6 @@ -diff -aurN linux-4.19.67/Documentation/networking/ip-sysctl.txt mptcp-mptcp_v0.95/Documentation/networking/ip-sysctl.txt ---- linux-4.19.67/Documentation/networking/ip-sysctl.txt 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/Documentation/networking/ip-sysctl.txt 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/Documentation/networking/ip-sysctl.txt mptcp-mptcp_v0.95/Documentation/networking/ip-sysctl.txt +--- linux-4.19.80/Documentation/networking/ip-sysctl.txt 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/Documentation/networking/ip-sysctl.txt 2019-11-20 10:07:30.000000000 +0100 @@ -763,6 +763,18 @@ in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks) Default: 100 @@ -20,9 +20,9 @@ diff -aurN linux-4.19.67/Documentation/networking/ip-sysctl.txt mptcp-mptcp_v0.9 UDP variables: udp_l3mdev_accept - BOOLEAN -diff -aurN linux-4.19.67/drivers/infiniband/hw/cxgb4/cm.c mptcp-mptcp_v0.95/drivers/infiniband/hw/cxgb4/cm.c ---- linux-4.19.67/drivers/infiniband/hw/cxgb4/cm.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/drivers/infiniband/hw/cxgb4/cm.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/drivers/infiniband/hw/cxgb4/cm.c mptcp-mptcp_v0.95/drivers/infiniband/hw/cxgb4/cm.c +--- linux-4.19.80/drivers/infiniband/hw/cxgb4/cm.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/drivers/infiniband/hw/cxgb4/cm.c 2019-11-20 10:07:30.000000000 +0100 @@ -3779,7 +3779,7 @@ */ memset(&tmp_opt, 0, sizeof(tmp_opt)); @@ -32,9 +32,9 @@ diff -aurN linux-4.19.67/drivers/infiniband/hw/cxgb4/cm.c mptcp-mptcp_v0.95/driv req = __skb_push(skb, sizeof(*req)); memset(req, 0, sizeof(*req)); -diff -aurN linux-4.19.67/include/linux/skbuff.h mptcp-mptcp_v0.95/include/linux/skbuff.h ---- linux-4.19.67/include/linux/skbuff.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/linux/skbuff.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/linux/skbuff.h mptcp-mptcp_v0.95/include/linux/skbuff.h +--- linux-4.19.80/include/linux/skbuff.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/linux/skbuff.h 2019-11-20 10:07:30.000000000 +0100 @@ -697,7 +697,7 @@ * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. @@ -44,9 +44,9 @@ diff -aurN linux-4.19.67/include/linux/skbuff.h mptcp-mptcp_v0.95/include/linux/ union { struct { -diff -aurN linux-4.19.67/include/linux/tcp.h mptcp-mptcp_v0.95/include/linux/tcp.h ---- linux-4.19.67/include/linux/tcp.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/linux/tcp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/linux/tcp.h mptcp-mptcp_v0.95/include/linux/tcp.h +--- linux-4.19.80/include/linux/tcp.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/linux/tcp.h 2019-11-20 10:07:30.000000000 +0100 @@ -58,7 +58,7 @@ /* TCP Fast Open */ #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ @@ -203,9 +203,9 @@ diff -aurN linux-4.19.67/include/linux/tcp.h mptcp-mptcp_v0.95/include/linux/tcp }; static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) -diff -aurN linux-4.19.67/include/net/inet_common.h mptcp-mptcp_v0.95/include/net/inet_common.h ---- linux-4.19.67/include/net/inet_common.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/inet_common.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/inet_common.h mptcp-mptcp_v0.95/include/net/inet_common.h +--- linux-4.19.80/include/net/inet_common.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/inet_common.h 2019-11-20 10:07:30.000000000 +0100 @@ -2,6 +2,8 @@ #ifndef _INET_COMMON_H #define _INET_COMMON_H @@ -224,9 +224,9 @@ diff -aurN linux-4.19.67/include/net/inet_common.h mptcp-mptcp_v0.95/include/net int inet_release(struct socket *sock); int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags); -diff -aurN linux-4.19.67/include/net/inet_connection_sock.h mptcp-mptcp_v0.95/include/net/inet_connection_sock.h ---- linux-4.19.67/include/net/inet_connection_sock.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/inet_connection_sock.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/inet_connection_sock.h mptcp-mptcp_v0.95/include/net/inet_connection_sock.h +--- linux-4.19.80/include/net/inet_connection_sock.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/inet_connection_sock.h 2019-11-20 10:07:30.000000000 +0100 @@ -29,6 +29,7 @@ struct inet_bind_bucket; @@ -235,9 +235,9 @@ diff -aurN linux-4.19.67/include/net/inet_connection_sock.h mptcp-mptcp_v0.95/in /* * Pointers to address related TCP functions -diff -aurN linux-4.19.67/include/net/inet_sock.h mptcp-mptcp_v0.95/include/net/inet_sock.h ---- linux-4.19.67/include/net/inet_sock.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/inet_sock.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/inet_sock.h mptcp-mptcp_v0.95/include/net/inet_sock.h +--- linux-4.19.80/include/net/inet_sock.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/inet_sock.h 2019-11-20 10:07:30.000000000 +0100 @@ -83,7 +83,7 @@ #define ireq_state req.__req_common.skc_state #define ireq_family req.__req_common.skc_family @@ -256,10 +256,10 @@ diff -aurN linux-4.19.67/include/net/inet_sock.h mptcp-mptcp_v0.95/include/net/i smc_ok : 1; u32 ir_mark; union { -diff -aurN linux-4.19.67/include/net/mptcp.h mptcp-mptcp_v0.95/include/net/mptcp.h ---- linux-4.19.67/include/net/mptcp.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/include/net/mptcp.h 2019-08-22 18:59:39.000000000 +0200 -@@ -0,0 +1,1491 @@ +diff -aurN linux-4.19.80/include/net/mptcp.h mptcp-mptcp_v0.95/include/net/mptcp.h +--- linux-4.19.80/include/net/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/include/net/mptcp.h 2019-11-20 10:07:30.000000000 +0100 +@@ -0,0 +1,1497 @@ +/* + * MPTCP implementation + * @@ -1695,6 +1695,8 @@ diff -aurN linux-4.19.67/include/net/mptcp.h mptcp-mptcp_v0.95/include/net/mptcp +} +static inline void mptcp_push_pending_frames(struct sock *meta_sk) {} +static inline void mptcp_send_reset(const struct sock *sk) {} ++static inline void mptcp_sub_force_close_all(struct mptcp_cb *mpcb, ++ struct sock *except) {} +static inline bool mptcp_handle_options(struct sock *sk, + const struct tcphdr *th, + struct sk_buff *skb) @@ -1743,6 +1745,10 @@ diff -aurN linux-4.19.67/include/net/mptcp.h mptcp-mptcp_v0.95/include/net/mptcp + struct sk_buff *skb) {} +static inline void mptcp_mpcb_put(struct mptcp_cb *mpcb) {} +static inline void mptcp_fin(struct sock *meta_sk) {} ++static inline bool mptcp_in_infinite_mapping_weak(const struct mptcp_cb *mpcb) ++{ ++ return false; ++} +static inline bool mptcp_can_new_subflow(const struct sock *meta_sk) +{ + return false; @@ -1751,9 +1757,9 @@ diff -aurN linux-4.19.67/include/net/mptcp.h mptcp-mptcp_v0.95/include/net/mptcp +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_H */ -diff -aurN linux-4.19.67/include/net/mptcp_v4.h mptcp-mptcp_v0.95/include/net/mptcp_v4.h ---- linux-4.19.67/include/net/mptcp_v4.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/include/net/mptcp_v4.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/mptcp_v4.h mptcp-mptcp_v0.95/include/net/mptcp_v4.h +--- linux-4.19.80/include/net/mptcp_v4.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/include/net/mptcp_v4.h 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,76 @@ +/* + * MPTCP implementation @@ -1831,9 +1837,9 @@ diff -aurN linux-4.19.67/include/net/mptcp_v4.h mptcp-mptcp_v0.95/include/net/mp +#endif /* CONFIG_MPTCP */ + +#endif /* MPTCP_V4_H_ */ -diff -aurN linux-4.19.67/include/net/mptcp_v6.h mptcp-mptcp_v0.95/include/net/mptcp_v6.h ---- linux-4.19.67/include/net/mptcp_v6.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/include/net/mptcp_v6.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/mptcp_v6.h mptcp-mptcp_v0.95/include/net/mptcp_v6.h +--- linux-4.19.80/include/net/mptcp_v6.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/include/net/mptcp_v6.h 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,77 @@ +/* + * MPTCP implementation @@ -1912,9 +1918,9 @@ diff -aurN linux-4.19.67/include/net/mptcp_v6.h mptcp-mptcp_v0.95/include/net/mp +#endif /* CONFIG_MPTCP */ + +#endif /* _MPTCP_V6_H */ -diff -aurN linux-4.19.67/include/net/net_namespace.h mptcp-mptcp_v0.95/include/net/net_namespace.h ---- linux-4.19.67/include/net/net_namespace.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/net_namespace.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/net_namespace.h mptcp-mptcp_v0.95/include/net/net_namespace.h +--- linux-4.19.80/include/net/net_namespace.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/net_namespace.h 2019-11-20 10:07:30.000000000 +0100 @@ -19,6 +19,7 @@ #include #include @@ -1933,9 +1939,9 @@ diff -aurN linux-4.19.67/include/net/net_namespace.h mptcp-mptcp_v0.95/include/n #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) struct netns_ieee802154_lowpan ieee802154_lowpan; #endif -diff -aurN linux-4.19.67/include/net/netns/mptcp.h mptcp-mptcp_v0.95/include/net/netns/mptcp.h ---- linux-4.19.67/include/net/netns/mptcp.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/include/net/netns/mptcp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/netns/mptcp.h mptcp-mptcp_v0.95/include/net/netns/mptcp.h +--- linux-4.19.80/include/net/netns/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/include/net/netns/mptcp.h 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,52 @@ +/* + * MPTCP implementation - MPTCP namespace @@ -1989,9 +1995,9 @@ diff -aurN linux-4.19.67/include/net/netns/mptcp.h mptcp-mptcp_v0.95/include/net +}; + +#endif /* __NETNS_MPTCP_H__ */ -diff -aurN linux-4.19.67/include/net/snmp.h mptcp-mptcp_v0.95/include/net/snmp.h ---- linux-4.19.67/include/net/snmp.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/snmp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/snmp.h mptcp-mptcp_v0.95/include/net/snmp.h +--- linux-4.19.80/include/net/snmp.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/snmp.h 2019-11-20 10:07:30.000000000 +0100 @@ -91,7 +91,6 @@ atomic_long_t mibs[ICMP6MSG_MIB_MAX]; }; @@ -2000,9 +2006,9 @@ diff -aurN linux-4.19.67/include/net/snmp.h mptcp-mptcp_v0.95/include/net/snmp.h /* TCP */ #define TCP_MIB_MAX __TCP_MIB_MAX struct tcp_mib { -diff -aurN linux-4.19.67/include/net/sock.h mptcp-mptcp_v0.95/include/net/sock.h ---- linux-4.19.67/include/net/sock.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/sock.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/sock.h mptcp-mptcp_v0.95/include/net/sock.h +--- linux-4.19.80/include/net/sock.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/sock.h 2019-11-20 10:07:30.000000000 +0100 @@ -810,6 +810,7 @@ SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ SOCK_RCU_FREE, /* wait rcu grace period in sk_destruct() */ @@ -2019,9 +2025,9 @@ diff -aurN linux-4.19.67/include/net/sock.h mptcp-mptcp_v0.95/include/net/sock.h /* Keeping track of sockets in use */ #ifdef CONFIG_PROC_FS -diff -aurN linux-4.19.67/include/net/tcp.h mptcp-mptcp_v0.95/include/net/tcp.h ---- linux-4.19.67/include/net/tcp.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/tcp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/tcp.h mptcp-mptcp_v0.95/include/net/tcp.h +--- linux-4.19.80/include/net/tcp.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/tcp.h 2019-11-20 10:07:30.000000000 +0100 @@ -185,6 +185,7 @@ #define TCPOPT_SACK 5 /* SACK Block */ #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ @@ -2341,9 +2347,9 @@ diff -aurN linux-4.19.67/include/net/tcp.h mptcp-mptcp_v0.95/include/net/tcp.h const struct sock *sk, struct sk_buff *skb, __u16 *mss) { -diff -aurN linux-4.19.67/include/net/tcp_states.h mptcp-mptcp_v0.95/include/net/tcp_states.h ---- linux-4.19.67/include/net/tcp_states.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/tcp_states.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/tcp_states.h mptcp-mptcp_v0.95/include/net/tcp_states.h +--- linux-4.19.80/include/net/tcp_states.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/tcp_states.h 2019-11-20 10:07:30.000000000 +0100 @@ -26,6 +26,7 @@ TCP_LISTEN, TCP_CLOSING, /* Now a valid state */ @@ -2360,9 +2366,9 @@ diff -aurN linux-4.19.67/include/net/tcp_states.h mptcp-mptcp_v0.95/include/net/ }; #endif /* _LINUX_TCP_STATES_H */ -diff -aurN linux-4.19.67/include/net/transp_v6.h mptcp-mptcp_v0.95/include/net/transp_v6.h ---- linux-4.19.67/include/net/transp_v6.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/net/transp_v6.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/net/transp_v6.h mptcp-mptcp_v0.95/include/net/transp_v6.h +--- linux-4.19.80/include/net/transp_v6.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/net/transp_v6.h 2019-11-20 10:07:30.000000000 +0100 @@ -58,6 +58,8 @@ /* address family specific functions */ @@ -2372,9 +2378,9 @@ diff -aurN linux-4.19.67/include/net/transp_v6.h mptcp-mptcp_v0.95/include/net/t void inet6_destroy_sock(struct sock *sk); -diff -aurN linux-4.19.67/include/trace/events/tcp.h mptcp-mptcp_v0.95/include/trace/events/tcp.h ---- linux-4.19.67/include/trace/events/tcp.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/trace/events/tcp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/trace/events/tcp.h mptcp-mptcp_v0.95/include/trace/events/tcp.h +--- linux-4.19.80/include/trace/events/tcp.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/trace/events/tcp.h 2019-11-20 10:07:30.000000000 +0100 @@ -10,6 +10,7 @@ #include #include @@ -2423,9 +2429,9 @@ diff -aurN linux-4.19.67/include/trace/events/tcp.h mptcp-mptcp_v0.95/include/tr ); #endif /* _TRACE_TCP_H */ -diff -aurN linux-4.19.67/include/uapi/linux/bpf.h mptcp-mptcp_v0.95/include/uapi/linux/bpf.h ---- linux-4.19.67/include/uapi/linux/bpf.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/uapi/linux/bpf.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/uapi/linux/bpf.h mptcp-mptcp_v0.95/include/uapi/linux/bpf.h +--- linux-4.19.80/include/uapi/linux/bpf.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/uapi/linux/bpf.h 2019-11-20 10:07:30.000000000 +0100 @@ -2674,6 +2674,7 @@ BPF_TCP_LISTEN, BPF_TCP_CLOSING, /* Now a valid state */ @@ -2434,9 +2440,9 @@ diff -aurN linux-4.19.67/include/uapi/linux/bpf.h mptcp-mptcp_v0.95/include/uapi BPF_TCP_MAX_STATES /* Leave at the end! */ }; -diff -aurN linux-4.19.67/include/uapi/linux/if.h mptcp-mptcp_v0.95/include/uapi/linux/if.h ---- linux-4.19.67/include/uapi/linux/if.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/uapi/linux/if.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/uapi/linux/if.h mptcp-mptcp_v0.95/include/uapi/linux/if.h +--- linux-4.19.80/include/uapi/linux/if.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/uapi/linux/if.h 2019-11-20 10:07:30.000000000 +0100 @@ -132,6 +132,9 @@ #define IFF_ECHO IFF_ECHO #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ @@ -2447,9 +2453,9 @@ diff -aurN linux-4.19.67/include/uapi/linux/if.h mptcp-mptcp_v0.95/include/uapi/ #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) -diff -aurN linux-4.19.67/include/uapi/linux/mptcp.h mptcp-mptcp_v0.95/include/uapi/linux/mptcp.h ---- linux-4.19.67/include/uapi/linux/mptcp.h 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/include/uapi/linux/mptcp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/uapi/linux/mptcp.h mptcp-mptcp_v0.95/include/uapi/linux/mptcp.h +--- linux-4.19.80/include/uapi/linux/mptcp.h 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/include/uapi/linux/mptcp.h 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* @@ -2600,9 +2606,9 @@ diff -aurN linux-4.19.67/include/uapi/linux/mptcp.h mptcp-mptcp_v0.95/include/ua +}; + +#endif /* _LINUX_MPTCP_H */ -diff -aurN linux-4.19.67/include/uapi/linux/tcp.h mptcp-mptcp_v0.95/include/uapi/linux/tcp.h ---- linux-4.19.67/include/uapi/linux/tcp.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/include/uapi/linux/tcp.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/include/uapi/linux/tcp.h mptcp-mptcp_v0.95/include/uapi/linux/tcp.h +--- linux-4.19.80/include/uapi/linux/tcp.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/include/uapi/linux/tcp.h 2019-11-20 10:07:30.000000000 +0100 @@ -18,9 +18,15 @@ #ifndef _UAPI_LINUX_TCP_H #define _UAPI_LINUX_TCP_H @@ -2688,9 +2694,9 @@ diff -aurN linux-4.19.67/include/uapi/linux/tcp.h mptcp-mptcp_v0.95/include/uapi /* for TCP_MD5SIG socket option */ #define TCP_MD5SIG_MAXKEYLEN 80 -diff -aurN linux-4.19.67/net/core/dev.c mptcp-mptcp_v0.95/net/core/dev.c ---- linux-4.19.67/net/core/dev.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/core/dev.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/core/dev.c mptcp-mptcp_v0.95/net/core/dev.c +--- linux-4.19.80/net/core/dev.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/core/dev.c 2019-11-20 10:07:30.000000000 +0100 @@ -7471,7 +7471,7 @@ dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP | @@ -2700,18 +2706,18 @@ diff -aurN linux-4.19.67/net/core/dev.c mptcp-mptcp_v0.95/net/core/dev.c (dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC | IFF_ALLMULTI)); -diff -aurN linux-4.19.67/net/core/net-traces.c mptcp-mptcp_v0.95/net/core/net-traces.c ---- linux-4.19.67/net/core/net-traces.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/core/net-traces.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/core/net-traces.c mptcp-mptcp_v0.95/net/core/net-traces.c +--- linux-4.19.80/net/core/net-traces.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/core/net-traces.c 2019-11-20 10:07:30.000000000 +0100 @@ -48,3 +48,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(napi_poll); EXPORT_TRACEPOINT_SYMBOL_GPL(tcp_send_reset); + +EXPORT_TRACEPOINT_SYMBOL_GPL(mptcp_retransmit); -diff -aurN linux-4.19.67/net/core/skbuff.c mptcp-mptcp_v0.95/net/core/skbuff.c ---- linux-4.19.67/net/core/skbuff.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/core/skbuff.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/core/skbuff.c mptcp-mptcp_v0.95/net/core/skbuff.c +--- linux-4.19.80/net/core/skbuff.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/core/skbuff.c 2019-11-20 10:07:30.000000000 +0100 @@ -536,7 +536,7 @@ skb_drop_list(&skb_shinfo(skb)->frag_list); } @@ -2721,9 +2727,9 @@ diff -aurN linux-4.19.67/net/core/skbuff.c mptcp-mptcp_v0.95/net/core/skbuff.c { struct sk_buff *list; -diff -aurN linux-4.19.67/net/core/sock.c mptcp-mptcp_v0.95/net/core/sock.c ---- linux-4.19.67/net/core/sock.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/core/sock.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/core/sock.c mptcp-mptcp_v0.95/net/core/sock.c +--- linux-4.19.80/net/core/sock.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/core/sock.c 2019-11-20 10:07:30.000000000 +0100 @@ -140,6 +140,11 @@ #include @@ -2775,7 +2781,7 @@ diff -aurN linux-4.19.67/net/core/sock.c mptcp-mptcp_v0.95/net/core/sock.c } else sk = kmalloc(prot->obj_size, priority); -@@ -1684,6 +1710,7 @@ +@@ -1689,6 +1715,7 @@ atomic_set(&newsk->sk_zckey, 0); sock_reset_flag(newsk, SOCK_DONE); @@ -2783,9 +2789,9 @@ diff -aurN linux-4.19.67/net/core/sock.c mptcp-mptcp_v0.95/net/core/sock.c mem_cgroup_sk_alloc(newsk); cgroup_sk_alloc(&newsk->sk_cgrp_data); -diff -aurN linux-4.19.67/net/ipv4/af_inet.c mptcp-mptcp_v0.95/net/ipv4/af_inet.c ---- linux-4.19.67/net/ipv4/af_inet.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/af_inet.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/af_inet.c mptcp-mptcp_v0.95/net/ipv4/af_inet.c +--- linux-4.19.80/net/ipv4/af_inet.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/af_inet.c 2019-11-20 10:07:30.000000000 +0100 @@ -104,6 +104,7 @@ #include #include @@ -2849,9 +2855,9 @@ diff -aurN linux-4.19.67/net/ipv4/af_inet.c mptcp-mptcp_v0.95/net/ipv4/af_inet.c /* Setup TCP slab cache for open requests. */ tcp_init(); -diff -aurN linux-4.19.67/net/ipv4/inet_connection_sock.c mptcp-mptcp_v0.95/net/ipv4/inet_connection_sock.c ---- linux-4.19.67/net/ipv4/inet_connection_sock.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/inet_connection_sock.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/inet_connection_sock.c mptcp-mptcp_v0.95/net/ipv4/inet_connection_sock.c +--- linux-4.19.80/net/ipv4/inet_connection_sock.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/inet_connection_sock.c 2019-11-20 10:07:30.000000000 +0100 @@ -23,6 +23,7 @@ #include #include @@ -2909,9 +2915,9 @@ diff -aurN linux-4.19.67/net/ipv4/inet_connection_sock.c mptcp-mptcp_v0.95/net/i sock_put(child); cond_resched(); -diff -aurN linux-4.19.67/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.95/net/ipv4/ip_sockglue.c ---- linux-4.19.67/net/ipv4/ip_sockglue.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/ip_sockglue.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.95/net/ipv4/ip_sockglue.c +--- linux-4.19.80/net/ipv4/ip_sockglue.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/ip_sockglue.c 2019-11-20 10:07:30.000000000 +0100 @@ -44,6 +44,8 @@ #endif #include @@ -2951,9 +2957,9 @@ diff -aurN linux-4.19.67/net/ipv4/ip_sockglue.c mptcp-mptcp_v0.95/net/ipv4/ip_so } break; case IP_TTL: -diff -aurN linux-4.19.67/net/ipv4/Kconfig mptcp-mptcp_v0.95/net/ipv4/Kconfig ---- linux-4.19.67/net/ipv4/Kconfig 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/Kconfig 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/Kconfig mptcp-mptcp_v0.95/net/ipv4/Kconfig +--- linux-4.19.80/net/ipv4/Kconfig 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/Kconfig 2019-11-20 10:07:30.000000000 +0100 @@ -680,6 +680,51 @@ bufferbloat, policers, or AQM schemes that do not provide a delay signal. It requires the fq ("Fair Queue") pacing packet scheduler. @@ -3039,9 +3045,9 @@ diff -aurN linux-4.19.67/net/ipv4/Kconfig mptcp-mptcp_v0.95/net/ipv4/Kconfig default "reno" if DEFAULT_RENO default "dctcp" if DEFAULT_DCTCP default "cdg" if DEFAULT_CDG -diff -aurN linux-4.19.67/net/ipv4/syncookies.c mptcp-mptcp_v0.95/net/ipv4/syncookies.c ---- linux-4.19.67/net/ipv4/syncookies.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/syncookies.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/syncookies.c mptcp-mptcp_v0.95/net/ipv4/syncookies.c +--- linux-4.19.80/net/ipv4/syncookies.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/syncookies.c 2019-11-20 10:07:30.000000000 +0100 @@ -16,6 +16,8 @@ #include #include @@ -3155,9 +3161,9 @@ diff -aurN linux-4.19.67/net/ipv4/syncookies.c mptcp-mptcp_v0.95/net/ipv4/syncoo ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), &rt->dst); -diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c ---- linux-4.19.67/net/ipv4/tcp.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c +--- linux-4.19.80/net/ipv4/tcp.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp.c 2019-11-20 10:07:30.000000000 +0100 @@ -274,6 +274,7 @@ #include @@ -3265,7 +3271,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c return mss_now; } -@@ -948,12 +989,34 @@ +@@ -964,12 +1005,34 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3301,7 +3307,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk); mss_now = tcp_send_mss(sk, &size_goal, flags); -@@ -1072,7 +1135,8 @@ +@@ -1089,7 +1152,8 @@ int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, size_t size, int flags) { @@ -3311,7 +3317,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c return sock_no_sendpage_locked(sk, page, offset, size, flags); tcp_rate_check_app_limited(sk); /* is sending application-limited? */ -@@ -1104,14 +1168,14 @@ +@@ -1121,14 +1185,14 @@ * This also speeds up tso_fragment(), since it wont fallback * to tcp_fragment(). */ @@ -3328,7 +3334,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c { if (zc) return 0; -@@ -1221,12 +1285,21 @@ +@@ -1238,12 +1302,21 @@ * is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) && @@ -3351,7 +3357,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c if (unlikely(tp->repair)) { if (tp->repair_queue == TCP_RECV_QUEUE) { copied = tcp_send_rcvq(sk, msg, size); -@@ -1282,7 +1355,7 @@ +@@ -1299,7 +1372,7 @@ goto restart; } first_skb = tcp_rtx_and_write_queues_empty(sk); @@ -3360,7 +3366,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c skb = sk_stream_alloc_skb(sk, linear, sk->sk_allocation, first_skb); if (!skb) -@@ -1527,7 +1600,7 @@ +@@ -1538,7 +1611,7 @@ * calculation of whether or not we must ACK for the sake of * a window update. */ @@ -3369,7 +3375,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c { struct tcp_sock *tp = tcp_sk(sk); bool time_to_ack = false; -@@ -1570,7 +1643,7 @@ +@@ -1581,7 +1654,7 @@ /* Optimize, __tcp_select_window() is not cheap. */ if (2*rcv_window_now <= tp->window_clamp) { @@ -3378,7 +3384,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c /* Send ACK now, if this read freed lots of space * in our buffer. Certainly, new_window is new window. -@@ -1686,7 +1759,7 @@ +@@ -1697,7 +1770,7 @@ /* Clean up data we have read: This will do ACK frames. */ if (copied > 0) { tcp_recv_skb(sk, seq, &offset); @@ -3387,7 +3393,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c } return copied; } -@@ -1943,6 +2016,16 @@ +@@ -1954,6 +2027,16 @@ lock_sock(sk); @@ -3404,7 +3410,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c err = -ENOTCONN; if (sk->sk_state == TCP_LISTEN) goto out; -@@ -2061,7 +2144,7 @@ +@@ -2072,7 +2155,7 @@ } } @@ -3413,7 +3419,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c if (copied >= target) { /* Do not sleep, just process backlog. */ -@@ -2152,7 +2235,7 @@ +@@ -2163,7 +2246,7 @@ */ /* Clean up data we have read: This will do ACK frames. */ @@ -3422,7 +3428,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c release_sock(sk); -@@ -2264,7 +2347,7 @@ +@@ -2275,7 +2358,7 @@ [TCP_NEW_SYN_RECV] = TCP_CLOSE, /* should not happen ! */ }; @@ -3431,7 +3437,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c { int next = (int)new_state[sk->sk_state]; int ns = next & TCP_STATE_MASK; -@@ -2294,7 +2377,7 @@ +@@ -2305,7 +2388,7 @@ TCPF_SYN_RECV | TCPF_CLOSE_WAIT)) { /* Clear out any half completed packets. FIN if needed. */ if (tcp_close_state(sk)) @@ -3440,7 +3446,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c } } EXPORT_SYMBOL(tcp_shutdown); -@@ -2319,6 +2402,17 @@ +@@ -2330,6 +2413,17 @@ int data_was_unread = 0; int state; @@ -3458,7 +3464,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c lock_sock(sk); sk->sk_shutdown = SHUTDOWN_MASK; -@@ -2363,7 +2457,7 @@ +@@ -2374,7 +2468,7 @@ /* Unread data was tossed, zap the connection. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONCLOSE); tcp_set_state(sk, TCP_CLOSE); @@ -3467,7 +3473,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c } else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) { /* Check zero linger _after_ checking for unread data. */ sk->sk_prot->disconnect(sk, 0); -@@ -2437,7 +2531,7 @@ +@@ -2448,7 +2542,7 @@ struct tcp_sock *tp = tcp_sk(sk); if (tp->linger2 < 0) { tcp_set_state(sk, TCP_CLOSE); @@ -3476,7 +3482,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONLINGER); } else { -@@ -2447,7 +2541,8 @@ +@@ -2458,7 +2552,8 @@ inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); } else { @@ -3486,7 +3492,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c goto out; } } -@@ -2456,7 +2551,7 @@ +@@ -2467,7 +2562,7 @@ sk_mem_reclaim(sk); if (tcp_check_oom(sk, 0)) { tcp_set_state(sk, TCP_CLOSE); @@ -3495,7 +3501,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); } else if (!check_net(sock_net(sk))) { -@@ -2485,15 +2580,6 @@ +@@ -2496,15 +2591,6 @@ } EXPORT_SYMBOL(tcp_close); @@ -3511,7 +3517,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c static void tcp_rtx_queue_purge(struct sock *sk) { struct rb_node *p = rb_first(&sk->tcp_rtx_queue); -@@ -2514,6 +2600,10 @@ +@@ -2525,6 +2611,10 @@ { struct sk_buff *skb; @@ -3522,7 +3528,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c tcp_chrono_stop(sk, TCP_CHRONO_BUSY); while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) { tcp_skb_tsorted_anchor_cleanup(skb); -@@ -2548,7 +2638,7 @@ +@@ -2559,7 +2649,7 @@ /* The last check adjusts for discrepancy of Linux wrt. RFC * states */ @@ -3531,7 +3537,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c sk->sk_err = ECONNRESET; } else if (old_state == TCP_SYN_SENT) sk->sk_err = ECONNRESET; -@@ -2566,6 +2656,13 @@ +@@ -2577,6 +2667,13 @@ if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK)) inet_reset_saddr(sk); @@ -3545,7 +3551,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c sk->sk_shutdown = 0; sock_reset_flag(sk, SOCK_DONE); tp->srtt_us = 0; -@@ -2620,7 +2717,7 @@ +@@ -2631,7 +2728,7 @@ static inline bool tcp_can_repair_sock(const struct sock *sk) { return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) && @@ -3554,7 +3560,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c } static int tcp_repair_set_window(struct tcp_sock *tp, char __user *optbuf, int len) -@@ -2766,6 +2863,61 @@ +@@ -2777,6 +2874,61 @@ return tcp_fastopen_reset_cipher(net, sk, key, sizeof(key)); } @@ -3616,7 +3622,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c default: /* fallthru */ break; -@@ -2946,6 +3098,12 @@ +@@ -2957,6 +3109,12 @@ break; case TCP_DEFER_ACCEPT: @@ -3629,7 +3635,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c /* Translate value in seconds to number of retransmits */ icsk->icsk_accept_queue.rskq_defer_accept = secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ, -@@ -2973,7 +3131,7 @@ +@@ -2984,7 +3142,7 @@ (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT) && inet_csk_ack_scheduled(sk)) { icsk->icsk_ack.pending |= ICSK_ACK_PUSHED; @@ -3638,7 +3644,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c if (!(val & 1)) icsk->icsk_ack.pingpong = 1; } -@@ -2983,7 +3141,7 @@ +@@ -2994,7 +3152,7 @@ #ifdef CONFIG_TCP_MD5SIG case TCP_MD5SIG: case TCP_MD5SIG_EXT: @@ -3647,7 +3653,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c err = tp->af_specific->md5_parse(sk, optname, optval, optlen); else err = -EINVAL; -@@ -3042,6 +3200,32 @@ +@@ -3053,6 +3211,32 @@ tp->notsent_lowat = val; sk->sk_write_space(sk); break; @@ -3680,7 +3686,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c case TCP_INQ: if (val > 1 || val < 0) err = -EINVAL; -@@ -3101,7 +3285,7 @@ +@@ -3112,7 +3296,7 @@ } /* Return information about state of tcp endpoint in API format. */ @@ -3689,7 +3695,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c { const struct tcp_sock *tp = tcp_sk(sk); /* iff sk_type == SOCK_STREAM */ const struct inet_connection_sock *icsk = inet_csk(sk); -@@ -3138,7 +3322,8 @@ +@@ -3149,7 +3333,8 @@ return; } @@ -3699,7 +3705,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c info->tcpi_ca_state = icsk->icsk_ca_state; info->tcpi_retransmits = icsk->icsk_retransmits; -@@ -3212,7 +3397,9 @@ +@@ -3223,7 +3408,9 @@ info->tcpi_bytes_retrans = tp->bytes_retrans; info->tcpi_dsack_dups = tp->dsack_dups; info->tcpi_reord_seen = tp->reord_seen; @@ -3710,7 +3716,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c } EXPORT_SYMBOL_GPL(tcp_get_info); -@@ -3357,7 +3544,7 @@ +@@ -3368,7 +3555,7 @@ if (get_user(len, optlen)) return -EFAULT; @@ -3719,7 +3725,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c len = min_t(unsigned int, len, sizeof(info)); if (put_user(len, optlen)) -@@ -3548,6 +3735,87 @@ +@@ -3559,6 +3746,87 @@ } return 0; } @@ -3807,7 +3813,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c #ifdef CONFIG_MMU case TCP_ZEROCOPY_RECEIVE: { struct tcp_zerocopy_receive zc; -@@ -3741,7 +4009,9 @@ +@@ -3752,7 +4020,9 @@ if (sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) TCP_INC_STATS(sock_net(sk), TCP_MIB_ATTEMPTFAILS); @@ -3817,7 +3823,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c tcp_clear_xmit_timers(sk); if (req) reqsk_fastopen_remove(sk, req, false); -@@ -3757,6 +4027,8 @@ +@@ -3768,6 +4038,8 @@ int tcp_abort(struct sock *sk, int err) { @@ -3826,7 +3832,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c if (!sk_fullsock(sk)) { if (sk->sk_state == TCP_NEW_SYN_RECV) { struct request_sock *req = inet_reqsk(sk); -@@ -3770,7 +4042,7 @@ +@@ -3781,7 +4053,7 @@ } /* Don't race with userspace socket closes such as tcp_close. */ @@ -3835,7 +3841,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c if (sk->sk_state == TCP_LISTEN) { tcp_set_state(sk, TCP_CLOSE); -@@ -3779,7 +4051,7 @@ +@@ -3790,7 +4062,7 @@ /* Don't race with BH socket closes such as inet_csk_listen_stop. */ local_bh_disable(); @@ -3844,7 +3850,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_err = err; -@@ -3787,14 +4059,14 @@ +@@ -3798,14 +4070,14 @@ smp_wmb(); sk->sk_error_report(sk); if (tcp_need_reset(sk->sk_state)) @@ -3862,9 +3868,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp.c mptcp-mptcp_v0.95/net/ipv4/tcp.c return 0; } EXPORT_SYMBOL_GPL(tcp_abort); -diff -aurN linux-4.19.67/net/ipv4/tcp_diag.c mptcp-mptcp_v0.95/net/ipv4/tcp_diag.c ---- linux-4.19.67/net/ipv4/tcp_diag.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_diag.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_diag.c mptcp-mptcp_v0.95/net/ipv4/tcp_diag.c +--- linux-4.19.80/net/ipv4/tcp_diag.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_diag.c 2019-11-20 10:07:30.000000000 +0100 @@ -34,7 +34,7 @@ r->idiag_wqueue = tp->write_seq - tp->snd_una; } @@ -3874,9 +3880,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_diag.c mptcp-mptcp_v0.95/net/ipv4/tcp_diag } #ifdef CONFIG_TCP_MD5SIG -diff -aurN linux-4.19.67/net/ipv4/tcp_fastopen.c mptcp-mptcp_v0.95/net/ipv4/tcp_fastopen.c ---- linux-4.19.67/net/ipv4/tcp_fastopen.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_fastopen.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_fastopen.c mptcp-mptcp_v0.95/net/ipv4/tcp_fastopen.c +--- linux-4.19.80/net/ipv4/tcp_fastopen.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_fastopen.c 2019-11-20 10:07:30.000000000 +0100 @@ -9,6 +9,7 @@ #include #include @@ -3926,9 +3932,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_fastopen.c mptcp-mptcp_v0.95/net/ipv4/tcp_ /* tcp_conn_request() is sending the SYNACK, * and queues the child into listener accept queue. */ -diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_input.c ---- linux-4.19.67/net/ipv4/tcp_input.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_input.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_input.c +--- linux-4.19.80/net/ipv4/tcp_input.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_input.c 2019-11-20 10:07:30.000000000 +0100 @@ -76,35 +76,15 @@ #include #include @@ -4406,16 +4412,27 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED); } } -@@ -5192,7 +5266,7 @@ +@@ -5183,6 +5257,8 @@ + { + struct tcp_sock *tp = tcp_sk(sk); + unsigned long rtt, delay; ++ struct sock *meta_sk = mptcp(tp) ? mptcp_meta_sk(sk) : sk; ++ struct tcp_sock *meta_tp = tcp_sk(meta_sk); + + /* More than one full frame received... */ + if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss && +@@ -5191,8 +5267,8 @@ + * If application uses SO_RCVLOWAT, we want send ack now if * we have not received enough bytes to satisfy the condition. */ - (tp->rcv_nxt - tp->copied_seq < sk->sk_rcvlowat || +- (tp->rcv_nxt - tp->copied_seq < sk->sk_rcvlowat || - __tcp_select_window(sk) >= tp->rcv_wnd)) || ++ (meta_tp->rcv_nxt - meta_tp->copied_seq < meta_sk->sk_rcvlowat || + tp->ops->__select_window(sk) >= tp->rcv_wnd)) || /* We ACK each frame or... */ tcp_in_quickack_mode(sk) || /* Protocol state mandates a one-time immediate ACK */ -@@ -5327,6 +5401,10 @@ +@@ -5327,6 +5403,10 @@ { struct tcp_sock *tp = tcp_sk(sk); @@ -4426,7 +4443,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp /* Check if we get a new urgent pointer - normally not. */ if (th->urg) tcp_check_urg(sk, th); -@@ -5469,9 +5547,15 @@ +@@ -5469,9 +5549,15 @@ goto discard; } @@ -4442,7 +4459,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp tcp_drop(sk, skb); return false; } -@@ -5528,6 +5612,10 @@ +@@ -5528,6 +5614,10 @@ tp->rx_opt.saw_tstamp = 0; @@ -4453,7 +4470,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp /* pred_flags is 0xS?10 << 16 + snd_wnd * if header_prediction is to be made * 'S' will always be tp->tcp_header_len >> 2 -@@ -5711,17 +5799,24 @@ +@@ -5711,17 +5801,24 @@ struct tcp_fastopen_cookie *cookie) { struct tcp_sock *tp = tcp_sk(sk); @@ -4480,7 +4497,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp mss = opt.mss_clamp; } -@@ -5745,7 +5840,11 @@ +@@ -5745,7 +5842,11 @@ tcp_fastopen_cache_set(sk, mss, cookie, syn_drop, try_exp); @@ -4493,7 +4510,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp skb_rbtree_walk_from(data) { if (__tcp_retransmit_skb(sk, data, 1)) break; -@@ -5785,9 +5884,13 @@ +@@ -5785,9 +5886,13 @@ struct tcp_sock *tp = tcp_sk(sk); struct tcp_fastopen_cookie foc = { .len = -1 }; int saved_clamp = tp->rx_opt.mss_clamp; @@ -4508,7 +4525,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) tp->rx_opt.rcv_tsecr -= tp->tsoffset; -@@ -5847,6 +5950,35 @@ +@@ -5847,6 +5952,35 @@ tcp_init_wl(tp, TCP_SKB_CB(skb)->seq); tcp_ack(sk, skb, FLAG_SLOWPATH); @@ -4544,7 +4561,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp /* Ok.. it's good. Set up sequence numbers and * move to established. */ -@@ -5873,6 +6005,11 @@ +@@ -5873,6 +6007,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -4556,7 +4573,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); tcp_initialize_rcv_mss(sk); -@@ -5896,9 +6033,12 @@ +@@ -5896,9 +6035,12 @@ } if (fastopen_fail) return -1; @@ -4571,7 +4588,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp /* Save one ACK. Data will be ready after * several ticks, if write_pending is set. * -@@ -5937,6 +6077,7 @@ +@@ -5937,6 +6079,7 @@ tcp_paws_reject(&tp->rx_opt, 0)) goto discard_and_undo; @@ -4579,7 +4596,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp if (th->syn) { /* We see SYN without ACK. It is attempt of * simultaneous connect with crossed SYNs. -@@ -5953,6 +6094,11 @@ +@@ -5953,6 +6096,11 @@ tp->tcp_header_len = sizeof(struct tcphdr); } @@ -4591,7 +4608,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp tp->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; tp->copied_seq = tp->rcv_nxt; tp->rcv_wup = TCP_SKB_CB(skb)->seq + 1; -@@ -6011,6 +6157,7 @@ +@@ -6011,6 +6159,7 @@ */ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) @@ -4599,7 +4616,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp { struct tcp_sock *tp = tcp_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); -@@ -6053,6 +6200,16 @@ +@@ -6053,6 +6202,16 @@ tp->rx_opt.saw_tstamp = 0; tcp_mstamp_refresh(tp); queued = tcp_rcv_synsent_state_process(sk, skb, th); @@ -4616,7 +4633,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp if (queued >= 0) return queued; -@@ -6135,6 +6292,8 @@ +@@ -6135,6 +6294,8 @@ if (tp->rx_opt.tstamp_ok) tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; @@ -4625,7 +4642,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp if (!inet_csk(sk)->icsk_ca_ops->cong_control) tcp_update_pacing_rate(sk); -@@ -6144,6 +6303,30 @@ +@@ -6144,6 +6305,30 @@ tcp_initialize_rcv_mss(sk); tcp_fast_path_on(tp); @@ -4656,7 +4673,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp break; case TCP_FIN_WAIT1: { -@@ -6191,7 +6374,8 @@ +@@ -6191,7 +6376,8 @@ tmo = tcp_fin_time(sk); if (tmo > TCP_TIMEWAIT_LEN) { inet_csk_reset_keepalive_timer(sk, tmo - TCP_TIMEWAIT_LEN); @@ -4666,7 +4683,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp /* Bad case. We could lose such FIN otherwise. * It is not a big problem, but it looks confusing * and not so rare event. We still can lose it now, -@@ -6200,7 +6384,7 @@ +@@ -6200,7 +6386,7 @@ */ inet_csk_reset_keepalive_timer(sk, tmo); } else { @@ -4675,7 +4692,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp goto discard; } break; -@@ -6208,7 +6392,7 @@ +@@ -6208,7 +6394,7 @@ case TCP_CLOSING: if (tp->snd_una == tp->write_seq) { @@ -4684,7 +4701,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp goto discard; } break; -@@ -6220,6 +6404,9 @@ +@@ -6220,6 +6406,9 @@ goto discard; } break; @@ -4694,7 +4711,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp } /* step 6: check the URG bit */ -@@ -6241,7 +6428,8 @@ +@@ -6241,7 +6430,8 @@ */ if (sk->sk_shutdown & RCV_SHUTDOWN) { if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && @@ -4704,7 +4721,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONDATA); tcp_reset(sk); return 1; -@@ -6338,6 +6526,8 @@ +@@ -6338,6 +6528,8 @@ ireq->wscale_ok = rx_opt->wscale_ok; ireq->acked = 0; ireq->ecn_ok = 0; @@ -4713,7 +4730,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp ireq->ir_rmt_port = tcp_hdr(skb)->source; ireq->ir_num = ntohs(tcp_hdr(skb)->dest); ireq->ir_mark = inet_request_mark(sk, skb); -@@ -6435,12 +6625,17 @@ +@@ -6435,12 +6627,17 @@ /* TW buckets are converted to open requests without * limitations, they conserve resources and peer is * evidently real one. @@ -4732,7 +4749,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp } if (sk_acceptq_is_full(sk)) { -@@ -6458,8 +6653,8 @@ +@@ -6458,8 +6655,8 @@ tcp_clear_options(&tmp_opt); tmp_opt.mss_clamp = af_ops->mss_clamp; tmp_opt.user_mss = tp->rx_opt.user_mss; @@ -4743,7 +4760,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp if (want_cookie && !tmp_opt.saw_tstamp) tcp_clear_options(&tmp_opt); -@@ -6474,7 +6669,8 @@ +@@ -6474,7 +6671,8 @@ /* Note: tcp_v6_init_req() might override ir_iif for link locals */ inet_rsk(req)->ir_iif = inet_request_bound_dev_if(sk, skb); @@ -4753,7 +4770,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp if (security_inet_conn_request(sk, skb, req)) goto drop_and_free; -@@ -6510,7 +6706,7 @@ +@@ -6510,7 +6708,7 @@ tcp_ecn_create_request(req, skb, sk, dst); if (want_cookie) { @@ -4762,7 +4779,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp req->cookie_ts = tmp_opt.tstamp_ok; if (!tmp_opt.tstamp_ok) inet_rsk(req)->ecn_ok = 0; -@@ -6525,18 +6721,26 @@ +@@ -6525,18 +6723,26 @@ fastopen_sk = tcp_try_fastopen(sk, skb, req, &foc, dst); } if (fastopen_sk) { @@ -4790,9 +4807,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_input.c mptcp-mptcp_v0.95/net/ipv4/tcp_inp sock_put(fastopen_sk); } else { tcp_rsk(req)->tfo_listener = false; -diff -aurN linux-4.19.67/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.95/net/ipv4/tcp_ipv4.c ---- linux-4.19.67/net/ipv4/tcp_ipv4.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_ipv4.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.95/net/ipv4/tcp_ipv4.c +--- linux-4.19.80/net/ipv4/tcp_ipv4.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_ipv4.c 2019-11-20 10:07:30.000000000 +0100 @@ -67,6 +67,8 @@ #include #include @@ -5251,9 +5268,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_ipv4.c mptcp-mptcp_v0.95/net/ipv4/tcp_ipv4 }; EXPORT_SYMBOL(tcp_prot); -diff -aurN linux-4.19.67/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.95/net/ipv4/tcp_minisocks.c ---- linux-4.19.67/net/ipv4/tcp_minisocks.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_minisocks.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.95/net/ipv4/tcp_minisocks.c +--- linux-4.19.80/net/ipv4/tcp_minisocks.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_minisocks.c 2019-11-20 10:07:30.000000000 +0100 @@ -18,11 +18,13 @@ * Jorge Cwik, */ @@ -5472,9 +5489,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_minisocks.c mptcp-mptcp_v0.95/net/ipv4/tcp sock_put(child); return ret; } -diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_output.c ---- linux-4.19.67/net/ipv4/tcp_output.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_output.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_output.c +--- linux-4.19.80/net/ipv4/tcp_output.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_output.c 2019-11-20 10:07:30.000000000 +0100 @@ -36,6 +36,12 @@ #define pr_fmt(fmt) "TCP: " fmt @@ -5912,7 +5929,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou goto send_now; return true; -@@ -2306,7 +2346,7 @@ +@@ -2307,7 +2347,7 @@ * Returns true, if no segments are in flight and we have queued segments, * but cannot send anything now because of SWS or another problem. */ @@ -5921,7 +5938,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou int push_one, gfp_t gfp) { struct tcp_sock *tp = tcp_sk(sk); -@@ -2320,7 +2360,12 @@ +@@ -2321,7 +2361,12 @@ sent_pkts = 0; tcp_mstamp_refresh(tp); @@ -5935,7 +5952,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou /* Do MTU probing. */ result = tcp_mtu_probe(sk); if (!result) { -@@ -2417,7 +2462,8 @@ +@@ -2418,7 +2463,8 @@ if (push_one != 2) tcp_schedule_loss_probe(sk, false); is_cwnd_limited |= (tcp_packets_in_flight(tp) >= tp->snd_cwnd); @@ -5945,7 +5962,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou return false; } return !tp->packets_out && !tcp_write_queue_empty(sk); -@@ -2500,7 +2546,7 @@ +@@ -2501,7 +2547,7 @@ skb = tcp_send_head(sk); if (skb && tcp_snd_wnd_test(tp, skb, mss)) { pcount = tp->packets_out; @@ -5954,7 +5971,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou if (tp->packets_out > pcount) goto probe_sent; goto rearm_timer; -@@ -2564,8 +2610,8 @@ +@@ -2565,8 +2611,8 @@ if (unlikely(sk->sk_state == TCP_CLOSE)) return; @@ -5965,7 +5982,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou tcp_check_probe_timer(sk); } -@@ -2578,7 +2624,8 @@ +@@ -2579,7 +2625,8 @@ BUG_ON(!skb || skb->len < mss_now); @@ -5975,7 +5992,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou } /* This function returns the amount that we can raise the -@@ -2800,6 +2847,10 @@ +@@ -2801,6 +2848,10 @@ if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) return; @@ -5986,7 +6003,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou skb_rbtree_walk_from_safe(skb, tmp) { if (!tcp_can_collapse(sk, skb)) break; -@@ -3269,7 +3320,7 @@ +@@ -3270,7 +3321,7 @@ /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ th->window = htons(min(req->rsk_rcv_wnd, 65535U)); @@ -5995,7 +6012,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou th->doff = (tcp_header_size >> 2); __TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); -@@ -3350,13 +3401,13 @@ +@@ -3351,13 +3402,13 @@ if (rcv_wnd == 0) rcv_wnd = dst_metric(dst, RTAX_INITRWND); @@ -6016,7 +6033,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou tp->rx_opt.rcv_wscale = rcv_wscale; tp->rcv_ssthresh = tp->rcv_wnd; -@@ -3381,6 +3432,36 @@ +@@ -3382,6 +3433,36 @@ inet_csk(sk)->icsk_rto = tcp_timeout_init(sk); inet_csk(sk)->icsk_retransmits = 0; tcp_clear_retrans(tp); @@ -6053,7 +6070,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou } static void tcp_connect_queue_skb(struct sock *sk, struct sk_buff *skb) -@@ -3643,6 +3724,7 @@ +@@ -3644,6 +3725,7 @@ { __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); } @@ -6061,7 +6078,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou /* This routine sends a packet with an out of date sequence * number. It assumes the other end will try to ack it. -@@ -3655,7 +3737,7 @@ +@@ -3656,7 +3738,7 @@ * one is with SEG.SEQ=SND.UNA to deliver urgent pointer, another is * out-of-date with SND.UNA-1 to probe window. */ @@ -6070,7 +6087,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou { struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; -@@ -3742,7 +3824,7 @@ +@@ -3743,7 +3825,7 @@ unsigned long probe_max; int err; @@ -6079,9 +6096,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_output.c mptcp-mptcp_v0.95/net/ipv4/tcp_ou if (tp->packets_out || tcp_write_queue_empty(sk)) { /* Cancel probe timer, if it is not required. */ -diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_timer.c ---- linux-4.19.67/net/ipv4/tcp_timer.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv4/tcp_timer.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_timer.c +--- linux-4.19.80/net/ipv4/tcp_timer.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv4/tcp_timer.c 2019-11-20 10:07:30.000000000 +0100 @@ -20,6 +20,7 @@ #include @@ -6148,7 +6165,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim expired = icsk->icsk_retransmits >= retry_until; } else { if (retransmits_timed_out(sk, net->ipv4.sysctl_tcp_retries1, 0)) { -@@ -323,18 +335,22 @@ +@@ -324,18 +336,22 @@ struct inet_connection_sock *icsk = from_timer(icsk, t, icsk_delack_timer); struct sock *sk = &icsk->icsk_inet.sk; @@ -6175,7 +6192,21 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim sock_put(sk); } -@@ -596,7 +612,7 @@ +@@ -379,7 +395,12 @@ + } + + if (icsk->icsk_probes_out > max_probes) { +-abort: tcp_write_err(sk); ++abort: ++ tcp_write_err(sk); ++ if (is_meta_sk(sk) && ++ mptcp_in_infinite_mapping_weak(tp->mpcb)) { ++ mptcp_sub_force_close_all(tp->mpcb, NULL); ++ } + } else { + /* Only send another probe if we didn't close things up. */ + tcp_send_probe0(sk); +@@ -597,7 +618,7 @@ break; case ICSK_TIME_RETRANS: icsk->icsk_pending = 0; @@ -6184,7 +6215,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim break; case ICSK_TIME_PROBE0: icsk->icsk_pending = 0; -@@ -613,16 +629,19 @@ +@@ -614,16 +635,19 @@ struct inet_connection_sock *icsk = from_timer(icsk, t, icsk_retransmit_timer); struct sock *sk = &icsk->icsk_inet.sk; @@ -6207,7 +6238,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim sock_put(sk); } -@@ -652,11 +671,12 @@ +@@ -653,11 +677,12 @@ struct sock *sk = from_timer(sk, t, sk_timer); struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); @@ -6222,7 +6253,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim /* Try again later. */ inet_csk_reset_keepalive_timer (sk, HZ/20); goto out; -@@ -668,16 +688,31 @@ +@@ -669,16 +694,31 @@ } tcp_mstamp_refresh(tp); @@ -6256,7 +6287,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim goto death; } -@@ -702,11 +737,11 @@ +@@ -703,11 +743,11 @@ icsk->icsk_probes_out > 0) || (icsk->icsk_user_timeout == 0 && icsk->icsk_probes_out >= keepalive_probes(tp))) { @@ -6270,7 +6301,7 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim icsk->icsk_probes_out++; elapsed = keepalive_intvl_when(tp); } else { -@@ -730,7 +765,7 @@ +@@ -731,7 +771,7 @@ tcp_done(sk); out: @@ -6279,9 +6310,9 @@ diff -aurN linux-4.19.67/net/ipv4/tcp_timer.c mptcp-mptcp_v0.95/net/ipv4/tcp_tim sock_put(sk); } -diff -aurN linux-4.19.67/net/ipv6/addrconf.c mptcp-mptcp_v0.95/net/ipv6/addrconf.c ---- linux-4.19.67/net/ipv6/addrconf.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv6/addrconf.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv6/addrconf.c mptcp-mptcp_v0.95/net/ipv6/addrconf.c +--- linux-4.19.80/net/ipv6/addrconf.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv6/addrconf.c 2019-11-20 10:07:30.000000000 +0100 @@ -917,6 +917,7 @@ kfree_rcu(ifp, rcu); @@ -6290,9 +6321,9 @@ diff -aurN linux-4.19.67/net/ipv6/addrconf.c mptcp-mptcp_v0.95/net/ipv6/addrconf static void ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) -diff -aurN linux-4.19.67/net/ipv6/af_inet6.c mptcp-mptcp_v0.95/net/ipv6/af_inet6.c ---- linux-4.19.67/net/ipv6/af_inet6.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv6/af_inet6.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv6/af_inet6.c mptcp-mptcp_v0.95/net/ipv6/af_inet6.c +--- linux-4.19.80/net/ipv6/af_inet6.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv6/af_inet6.c 2019-11-20 10:07:30.000000000 +0100 @@ -107,8 +107,7 @@ return (struct ipv6_pinfo *)(((u8 *)sk) + offset); } @@ -6303,9 +6334,9 @@ diff -aurN linux-4.19.67/net/ipv6/af_inet6.c mptcp-mptcp_v0.95/net/ipv6/af_inet6 { struct inet_sock *inet; struct ipv6_pinfo *np; -diff -aurN linux-4.19.67/net/ipv6/ipv6_sockglue.c mptcp-mptcp_v0.95/net/ipv6/ipv6_sockglue.c ---- linux-4.19.67/net/ipv6/ipv6_sockglue.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv6/ipv6_sockglue.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv6/ipv6_sockglue.c mptcp-mptcp_v0.95/net/ipv6/ipv6_sockglue.c +--- linux-4.19.80/net/ipv6/ipv6_sockglue.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv6/ipv6_sockglue.c 2019-11-20 10:07:30.000000000 +0100 @@ -48,6 +48,8 @@ #include #include @@ -6329,9 +6360,9 @@ diff -aurN linux-4.19.67/net/ipv6/ipv6_sockglue.c mptcp-mptcp_v0.95/net/ipv6/ipv sk->sk_socket->ops = &inet_stream_ops; sk->sk_family = PF_INET; tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); -diff -aurN linux-4.19.67/net/ipv6/syncookies.c mptcp-mptcp_v0.95/net/ipv6/syncookies.c ---- linux-4.19.67/net/ipv6/syncookies.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv6/syncookies.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv6/syncookies.c mptcp-mptcp_v0.95/net/ipv6/syncookies.c +--- linux-4.19.80/net/ipv6/syncookies.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv6/syncookies.c 2019-11-20 10:07:30.000000000 +0100 @@ -20,6 +20,8 @@ #include #include @@ -6413,9 +6444,9 @@ diff -aurN linux-4.19.67/net/ipv6/syncookies.c mptcp-mptcp_v0.95/net/ipv6/syncoo ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), dst); -diff -aurN linux-4.19.67/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.95/net/ipv6/tcp_ipv6.c ---- linux-4.19.67/net/ipv6/tcp_ipv6.c 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/ipv6/tcp_ipv6.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.95/net/ipv6/tcp_ipv6.c +--- linux-4.19.80/net/ipv6/tcp_ipv6.c 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/ipv6/tcp_ipv6.c 2019-11-20 10:07:30.000000000 +0100 @@ -61,6 +61,8 @@ #include #include @@ -7010,9 +7041,9 @@ diff -aurN linux-4.19.67/net/ipv6/tcp_ipv6.c mptcp-mptcp_v0.95/net/ipv6/tcp_ipv6 }; /* thinking of making this const? Don't. -diff -aurN linux-4.19.67/net/Kconfig mptcp-mptcp_v0.95/net/Kconfig ---- linux-4.19.67/net/Kconfig 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/Kconfig 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/Kconfig mptcp-mptcp_v0.95/net/Kconfig +--- linux-4.19.80/net/Kconfig 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/Kconfig 2019-11-20 10:07:30.000000000 +0100 @@ -89,6 +89,7 @@ source "net/ipv4/Kconfig" source "net/ipv6/Kconfig" @@ -7021,9 +7052,9 @@ diff -aurN linux-4.19.67/net/Kconfig mptcp-mptcp_v0.95/net/Kconfig endif # if INET -diff -aurN linux-4.19.67/net/Makefile mptcp-mptcp_v0.95/net/Makefile ---- linux-4.19.67/net/Makefile 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/net/Makefile 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/Makefile mptcp-mptcp_v0.95/net/Makefile +--- linux-4.19.80/net/Makefile 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/net/Makefile 2019-11-20 10:07:30.000000000 +0100 @@ -20,6 +20,7 @@ obj-$(CONFIG_XFRM) += xfrm/ obj-$(CONFIG_UNIX) += unix/ @@ -7032,9 +7063,9 @@ diff -aurN linux-4.19.67/net/Makefile mptcp-mptcp_v0.95/net/Makefile obj-$(CONFIG_BPFILTER) += bpfilter/ obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_NET_KEY) += key/ -diff -aurN linux-4.19.67/net/mptcp/Kconfig mptcp-mptcp_v0.95/net/mptcp/Kconfig ---- linux-4.19.67/net/mptcp/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/Kconfig 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/Kconfig mptcp-mptcp_v0.95/net/mptcp/Kconfig +--- linux-4.19.80/net/mptcp/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/Kconfig 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,146 @@ +# +# MPTCP configuration @@ -7182,9 +7213,9 @@ diff -aurN linux-4.19.67/net/mptcp/Kconfig mptcp-mptcp_v0.95/net/mptcp/Kconfig + default "redundant" if DEFAULT_REDUNDANT + default "default" + -diff -aurN linux-4.19.67/net/mptcp/Makefile mptcp-mptcp_v0.95/net/mptcp/Makefile ---- linux-4.19.67/net/mptcp/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/Makefile 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/Makefile mptcp-mptcp_v0.95/net/mptcp/Makefile +--- linux-4.19.80/net/mptcp/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/Makefile 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,24 @@ +# +## Makefile for MultiPath TCP support code. @@ -7210,9 +7241,9 @@ diff -aurN linux-4.19.67/net/mptcp/Makefile mptcp-mptcp_v0.95/net/mptcp/Makefile +obj-$(CONFIG_MPTCP_BLEST) += mptcp_blest.o + +mptcp-$(subst m,y,$(CONFIG_IPV6)) += mptcp_ipv6.o -diff -aurN linux-4.19.67/net/mptcp/mctcp_desync.c mptcp-mptcp_v0.95/net/mptcp/mctcp_desync.c ---- linux-4.19.67/net/mptcp/mctcp_desync.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mctcp_desync.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mctcp_desync.c mptcp-mptcp_v0.95/net/mptcp/mctcp_desync.c +--- linux-4.19.80/net/mptcp/mctcp_desync.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mctcp_desync.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,193 @@ +/* + * Desynchronized Multi-Channel TCP Congestion Control Algorithm @@ -7407,9 +7438,9 @@ diff -aurN linux-4.19.67/net/mptcp/mctcp_desync.c mptcp-mptcp_v0.95/net/mptcp/mc +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MCTCP: DESYNCHRONIZED MULTICHANNEL TCP CONGESTION CONTROL"); +MODULE_VERSION("1.0"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_balia.c mptcp-mptcp_v0.95/net/mptcp/mptcp_balia.c ---- linux-4.19.67/net/mptcp/mptcp_balia.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_balia.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_balia.c mptcp-mptcp_v0.95/net/mptcp/mptcp_balia.c +--- linux-4.19.80/net/mptcp/mptcp_balia.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_balia.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,261 @@ +/* + * MPTCP implementation - Balia Congestion Control @@ -7672,9 +7703,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_balia.c mptcp-mptcp_v0.95/net/mptcp/mpt +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP BALIA CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_binder.c mptcp-mptcp_v0.95/net/mptcp/mptcp_binder.c ---- linux-4.19.67/net/mptcp/mptcp_binder.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_binder.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_binder.c mptcp-mptcp_v0.95/net/mptcp/mptcp_binder.c +--- linux-4.19.80/net/mptcp/mptcp_binder.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_binder.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,494 @@ +#include + @@ -8170,10 +8201,10 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_binder.c mptcp-mptcp_v0.95/net/mptcp/mp +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("BINDER MPTCP"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_blest.c mptcp-mptcp_v0.95/net/mptcp/mptcp_blest.c ---- linux-4.19.67/net/mptcp/mptcp_blest.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_blest.c 2019-08-23 19:22:44.610261215 +0200 -@@ -0,0 +1,480 @@ +diff -aurN linux-4.19.80/net/mptcp/mptcp_blest.c mptcp-mptcp_v0.95/net/mptcp/mptcp_blest.c +--- linux-4.19.80/net/mptcp/mptcp_blest.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_blest.c 2019-11-20 10:07:30.000000000 +0100 +@@ -0,0 +1,481 @@ +// SPDX-License-Identifier: GPL-2.0 +/* MPTCP Scheduler to reduce HoL-blocking and spurious retransmissions. + * @@ -8379,6 +8410,7 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_blest.c mptcp-mptcp_v0.95/net/mptcp/mpt + if (bestsk && minsk && bestsk != minsk) { + u32 slow_linger_time, fast_bytes, slow_inflight_bytes, slow_bytes, avail_space; + u32 buffered_bytes = 0; ++ + meta_tp = tcp_sk(meta_sk); + besttp = tcp_sk(bestsk); + @@ -8654,9 +8686,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_blest.c mptcp-mptcp_v0.95/net/mptcp/mpt +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("BLEST scheduler for MPTCP, based on default minimum RTT scheduler"); +MODULE_VERSION("0.95"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_coupled.c mptcp-mptcp_v0.95/net/mptcp/mptcp_coupled.c ---- linux-4.19.67/net/mptcp/mptcp_coupled.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_coupled.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_coupled.c mptcp-mptcp_v0.95/net/mptcp/mptcp_coupled.c +--- linux-4.19.80/net/mptcp/mptcp_coupled.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_coupled.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,262 @@ +/* + * MPTCP implementation - Linked Increase congestion control Algorithm (LIA) @@ -8920,9 +8952,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_coupled.c mptcp-mptcp_v0.95/net/mptcp/m +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP LINKED INCREASE CONGESTION CONTROL ALGORITHM"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ctrl.c ---- linux-4.19.67/net/mptcp/mptcp_ctrl.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ctrl.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ctrl.c +--- linux-4.19.80/net/mptcp/mptcp_ctrl.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ctrl.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,3124 @@ +/* + * MPTCP implementation - MPTCP-control @@ -12048,9 +12080,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_ctrl.c mptcp-mptcp_v0.95/net/mptcp/mptc +mptcp_sock_cache_failed: + mptcp_init_failed = true; +} -diff -aurN linux-4.19.67/net/mptcp/mptcp_fullmesh.c mptcp-mptcp_v0.95/net/mptcp/mptcp_fullmesh.c ---- linux-4.19.67/net/mptcp/mptcp_fullmesh.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_fullmesh.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_fullmesh.c mptcp-mptcp_v0.95/net/mptcp/mptcp_fullmesh.c +--- linux-4.19.80/net/mptcp/mptcp_fullmesh.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_fullmesh.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,1941 @@ +#include +#include @@ -13993,10 +14025,10 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_fullmesh.c mptcp-mptcp_v0.95/net/mptcp/ +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Full-Mesh MPTCP"); +MODULE_VERSION("0.88"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_input.c mptcp-mptcp_v0.95/net/mptcp/mptcp_input.c ---- linux-4.19.67/net/mptcp/mptcp_input.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_input.c 2019-08-22 18:59:39.000000000 +0200 -@@ -0,0 +1,2400 @@ +diff -aurN linux-4.19.80/net/mptcp/mptcp_input.c mptcp-mptcp_v0.95/net/mptcp/mptcp_input.c +--- linux-4.19.80/net/mptcp/mptcp_input.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_input.c 2019-11-20 10:07:30.000000000 +0100 +@@ -0,0 +1,2431 @@ +/* + * MPTCP implementation - Sending side + * @@ -16180,6 +16212,49 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_input.c mptcp-mptcp_v0.95/net/mptcp/mpt + return false; +} + ++static void _mptcp_rcv_synsent_fastopen(struct sock *meta_sk, ++ struct sk_buff *skb, bool rtx_queue) ++{ ++ struct tcp_sock *meta_tp = tcp_sk(meta_sk); ++ struct tcp_sock *master_tp = tcp_sk(meta_tp->mpcb->master_sk); ++ u32 new_mapping = meta_tp->write_seq - master_tp->snd_una; ++ ++ /* If the server only acknowledges partially the data sent in ++ * the SYN, we need to trim the acknowledged part because ++ * we don't want to retransmit this already received data. ++ * When we reach this point, tcp_ack() has already cleaned up ++ * fully acked segments. However, tcp trims partially acked ++ * segments only when retransmitting. Since MPTCP comes into ++ * play only now, we will fake an initial transmit, and ++ * retransmit_skb() will not be called. The following fragment ++ * comes from __tcp_retransmit_skb(). ++ */ ++ if (before(TCP_SKB_CB(skb)->seq, master_tp->snd_una)) { ++ BUG_ON(before(TCP_SKB_CB(skb)->end_seq, ++ master_tp->snd_una)); ++ /* tcp_trim_head can only returns ENOMEM if skb is ++ * cloned. It is not the case here (see ++ * tcp_send_syn_data). ++ */ ++ BUG_ON(tcp_trim_head(meta_sk, skb, master_tp->snd_una - ++ TCP_SKB_CB(skb)->seq)); ++ } ++ ++ TCP_SKB_CB(skb)->seq += new_mapping; ++ TCP_SKB_CB(skb)->end_seq += new_mapping; ++ ++ list_del(&skb->tcp_tsorted_anchor); ++ ++ if (rtx_queue) ++ tcp_rtx_queue_unlink(skb, meta_sk); ++ else ++ tcp_unlink_write_queue(skb, meta_sk); ++ ++ INIT_LIST_HEAD(&skb->tcp_tsorted_anchor); ++ ++ tcp_add_write_queue_tail(meta_sk, skb); ++} ++ +/* In case of fastopen, some data can already be in the write queue. + * We need to update the sequence number of the segments as they + * were initially TCP sequence numbers. @@ -16188,45 +16263,34 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_input.c mptcp-mptcp_v0.95/net/mptcp/mpt +{ + struct tcp_sock *meta_tp = tcp_sk(meta_sk); + struct tcp_sock *master_tp = tcp_sk(meta_tp->mpcb->master_sk); -+ u32 new_mapping = meta_tp->write_seq - master_tp->snd_una; -+ struct sk_buff *skb, *tmp; ++ struct sk_buff *skb_write_head, *skb_rtx_head, *tmp; + -+ skb = tcp_rtx_queue_head(meta_sk); ++ skb_write_head = tcp_write_queue_head(meta_sk); ++ skb_rtx_head = tcp_rtx_queue_head(meta_sk); + -+ /* There should only be one skb in write queue: the data not ++ if (!(skb_write_head || skb_rtx_head)) ++ return; ++ ++ /* There should only be one skb in {write, rtx} queue: the data not + * acknowledged in the SYN+ACK. In this case, we need to map + * this data to data sequence numbers. + */ -+ skb_rbtree_walk_from_safe(skb, tmp) { -+ /* If the server only acknowledges partially the data sent in -+ * the SYN, we need to trim the acknowledged part because -+ * we don't want to retransmit this already received data. -+ * When we reach this point, tcp_ack() has already cleaned up -+ * fully acked segments. However, tcp trims partially acked -+ * segments only when retransmitting. Since MPTCP comes into -+ * play only now, we will fake an initial transmit, and -+ * retransmit_skb() will not be called. The following fragment -+ * comes from __tcp_retransmit_skb(). -+ */ -+ if (before(TCP_SKB_CB(skb)->seq, master_tp->snd_una)) { -+ BUG_ON(before(TCP_SKB_CB(skb)->end_seq, -+ master_tp->snd_una)); -+ /* tcp_trim_head can only returns ENOMEM if skb is -+ * cloned. It is not the case here (see -+ * tcp_send_syn_data). -+ */ -+ BUG_ON(tcp_trim_head(meta_sk, skb, master_tp->snd_una - -+ TCP_SKB_CB(skb)->seq)); ++ ++ WARN_ON(skb_write_head && skb_rtx_head); ++ ++ if (skb_write_head) { ++ skb_queue_walk_from_safe(&meta_sk->sk_write_queue, ++ skb_write_head, tmp) { ++ _mptcp_rcv_synsent_fastopen(meta_sk, skb_write_head, ++ false); + } ++ } + -+ TCP_SKB_CB(skb)->seq += new_mapping; -+ TCP_SKB_CB(skb)->end_seq += new_mapping; -+ -+ list_del(&skb->tcp_tsorted_anchor); -+ tcp_rtx_queue_unlink(skb, meta_sk); -+ INIT_LIST_HEAD(&skb->tcp_tsorted_anchor); -+ -+ tcp_add_write_queue_tail(meta_sk, skb); ++ if (skb_rtx_head) { ++ skb_rbtree_walk_from_safe(skb_rtx_head, tmp) { ++ _mptcp_rcv_synsent_fastopen(meta_sk, skb_rtx_head, ++ true); ++ } + } + + /* We can advance write_seq by the number of bytes unacknowledged @@ -16309,8 +16373,7 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_input.c mptcp-mptcp_v0.95/net/mptcp/mpt + * Example of such rare cases: connect is non-blocking and + * TFO is configured to work without cookies. + */ -+ if (tcp_rtx_queue_head(meta_sk)) -+ mptcp_rcv_synsent_fastopen(meta_sk); ++ mptcp_rcv_synsent_fastopen(meta_sk); + + /* -1, because the SYN consumed 1 byte. In case of TFO, we + * start the subflow-sequence number as if the data of the SYN @@ -16397,9 +16460,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_input.c mptcp-mptcp_v0.95/net/mptcp/mpt + tcp_set_rto(sk); + mptcp_set_rto(sk); +} -diff -aurN linux-4.19.67/net/mptcp/mptcp_ipv4.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv4.c ---- linux-4.19.67/net/mptcp/mptcp_ipv4.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv4.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_ipv4.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv4.c +--- linux-4.19.80/net/mptcp/mptcp_ipv4.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv4.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,427 @@ +/* + * MPTCP implementation - IPv4-specific functions @@ -16828,9 +16891,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_ipv4.c mptcp-mptcp_v0.95/net/mptcp/mptc + kmem_cache_destroy(mptcp_request_sock_ops.slab); + kfree(mptcp_request_sock_ops.slab_name); +} -diff -aurN linux-4.19.67/net/mptcp/mptcp_ipv6.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv6.c ---- linux-4.19.67/net/mptcp/mptcp_ipv6.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv6.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_ipv6.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv6.c +--- linux-4.19.80/net/mptcp/mptcp_ipv6.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ipv6.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,475 @@ +/* + * MPTCP implementation - IPv6-specific functions @@ -17307,9 +17370,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_ipv6.c mptcp-mptcp_v0.95/net/mptcp/mptc + kmem_cache_destroy(mptcp6_request_sock_ops.slab); + kfree(mptcp6_request_sock_ops.slab_name); +} -diff -aurN linux-4.19.67/net/mptcp/mptcp_ndiffports.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ndiffports.c ---- linux-4.19.67/net/mptcp/mptcp_ndiffports.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ndiffports.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_ndiffports.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ndiffports.c +--- linux-4.19.80/net/mptcp/mptcp_ndiffports.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_ndiffports.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,174 @@ +#include + @@ -17485,9 +17548,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_ndiffports.c mptcp-mptcp_v0.95/net/mptc +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("NDIFF-PORTS MPTCP"); +MODULE_VERSION("0.88"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_netlink.c mptcp-mptcp_v0.95/net/mptcp/mptcp_netlink.c ---- linux-4.19.67/net/mptcp/mptcp_netlink.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_netlink.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_netlink.c mptcp-mptcp_v0.95/net/mptcp/mptcp_netlink.c +--- linux-4.19.80/net/mptcp/mptcp_netlink.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_netlink.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,1277 @@ +// SPDX-License-Identifier: GPL-2.0 +/* MPTCP implementation - Netlink Path Manager @@ -18766,9 +18829,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_netlink.c mptcp-mptcp_v0.95/net/mptcp/m +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP netlink-based path manager"); +MODULE_ALIAS_GENL_FAMILY(MPTCP_GENL_NAME); -diff -aurN linux-4.19.67/net/mptcp/mptcp_olia.c mptcp-mptcp_v0.95/net/mptcp/mptcp_olia.c ---- linux-4.19.67/net/mptcp/mptcp_olia.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_olia.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_olia.c mptcp-mptcp_v0.95/net/mptcp/mptcp_olia.c +--- linux-4.19.80/net/mptcp/mptcp_olia.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_olia.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,318 @@ +/* + * MPTCP implementation - OPPORTUNISTIC LINKED INCREASES CONGESTION CONTROL: @@ -19088,9 +19151,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_olia.c mptcp-mptcp_v0.95/net/mptcp/mptc +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP COUPLED CONGESTION CONTROL"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_output.c mptcp-mptcp_v0.95/net/mptcp/mptcp_output.c ---- linux-4.19.67/net/mptcp/mptcp_output.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_output.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_output.c mptcp-mptcp_v0.95/net/mptcp/mptcp_output.c +--- linux-4.19.80/net/mptcp/mptcp_output.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_output.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,1929 @@ +/* + * MPTCP implementation - Sending side @@ -21021,9 +21084,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_output.c mptcp-mptcp_v0.95/net/mptcp/mp + return max(xmit_size_goal, mss_now); +} + -diff -aurN linux-4.19.67/net/mptcp/mptcp_pm.c mptcp-mptcp_v0.95/net/mptcp/mptcp_pm.c ---- linux-4.19.67/net/mptcp/mptcp_pm.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_pm.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_pm.c mptcp-mptcp_v0.95/net/mptcp/mptcp_pm.c +--- linux-4.19.80/net/mptcp/mptcp_pm.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_pm.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,226 @@ +/* + * MPTCP implementation - MPTCP-subflow-management @@ -21251,9 +21314,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_pm.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ + return mptcp_set_default_path_manager(CONFIG_DEFAULT_MPTCP_PM); +} +late_initcall(mptcp_path_manager_default); -diff -aurN linux-4.19.67/net/mptcp/mptcp_redundant.c mptcp-mptcp_v0.95/net/mptcp/mptcp_redundant.c ---- linux-4.19.67/net/mptcp/mptcp_redundant.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_redundant.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_redundant.c mptcp-mptcp_v0.95/net/mptcp/mptcp_redundant.c +--- linux-4.19.80/net/mptcp/mptcp_redundant.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_redundant.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,389 @@ +/* + * MPTCP Scheduler to reduce latency and jitter. @@ -21644,9 +21707,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_redundant.c mptcp-mptcp_v0.95/net/mptcp +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("REDUNDANT MPTCP"); +MODULE_VERSION("0.90"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_rr.c mptcp-mptcp_v0.95/net/mptcp/mptcp_rr.c ---- linux-4.19.67/net/mptcp/mptcp_rr.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_rr.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_rr.c mptcp-mptcp_v0.95/net/mptcp/mptcp_rr.c +--- linux-4.19.80/net/mptcp/mptcp_rr.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_rr.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,309 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -21957,9 +22020,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_rr.c mptcp-mptcp_v0.95/net/mptcp/mptcp_ +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("ROUNDROBIN MPTCP"); +MODULE_VERSION("0.89"); -diff -aurN linux-4.19.67/net/mptcp/mptcp_sched.c mptcp-mptcp_v0.95/net/mptcp/mptcp_sched.c ---- linux-4.19.67/net/mptcp/mptcp_sched.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_sched.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_sched.c mptcp-mptcp_v0.95/net/mptcp/mptcp_sched.c +--- linux-4.19.80/net/mptcp/mptcp_sched.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_sched.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,634 @@ +/* MPTCP Scheduler module selector. Highly inspired by tcp_cong.c */ + @@ -22595,9 +22658,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_sched.c mptcp-mptcp_v0.95/net/mptcp/mpt + return mptcp_set_default_scheduler(CONFIG_DEFAULT_MPTCP_SCHED); +} +late_initcall(mptcp_scheduler_default); -diff -aurN linux-4.19.67/net/mptcp/mptcp_wvegas.c mptcp-mptcp_v0.95/net/mptcp/mptcp_wvegas.c ---- linux-4.19.67/net/mptcp/mptcp_wvegas.c 1970-01-01 01:00:00.000000000 +0100 -+++ mptcp-mptcp_v0.95/net/mptcp/mptcp_wvegas.c 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/net/mptcp/mptcp_wvegas.c mptcp-mptcp_v0.95/net/mptcp/mptcp_wvegas.c +--- linux-4.19.80/net/mptcp/mptcp_wvegas.c 1970-01-01 01:00:00.000000000 +0100 ++++ mptcp-mptcp_v0.95/net/mptcp/mptcp_wvegas.c 2019-11-20 10:07:30.000000000 +0100 @@ -0,0 +1,271 @@ +/* + * MPTCP implementation - WEIGHTED VEGAS @@ -22870,9 +22933,9 @@ diff -aurN linux-4.19.67/net/mptcp/mptcp_wvegas.c mptcp-mptcp_v0.95/net/mptcp/mp +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MPTCP wVegas"); +MODULE_VERSION("0.1"); -diff -aurN linux-4.19.67/tools/include/uapi/linux/bpf.h mptcp-mptcp_v0.95/tools/include/uapi/linux/bpf.h ---- linux-4.19.67/tools/include/uapi/linux/bpf.h 2019-08-16 10:12:54.000000000 +0200 -+++ mptcp-mptcp_v0.95/tools/include/uapi/linux/bpf.h 2019-08-22 18:59:39.000000000 +0200 +diff -aurN linux-4.19.80/tools/include/uapi/linux/bpf.h mptcp-mptcp_v0.95/tools/include/uapi/linux/bpf.h +--- linux-4.19.80/tools/include/uapi/linux/bpf.h 2019-10-17 22:45:44.000000000 +0200 ++++ mptcp-mptcp_v0.95/tools/include/uapi/linux/bpf.h 2019-11-20 10:07:30.000000000 +0100 @@ -2672,6 +2672,7 @@ BPF_TCP_LISTEN, BPF_TCP_CLOSING, /* Now a valid state */ diff --git a/root/target/linux/generic/hack-4.19/692-mptcp-fix.patch b/root/target/linux/generic/hack-4.19/692-mptcp-fix.patch deleted file mode 100644 index 96a7b5d5..00000000 --- a/root/target/linux/generic/hack-4.19/692-mptcp-fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index 480373c960cd..bae7231096cf 100644 ---- a/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c -@@ -5227,6 +5227,8 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) - { - struct tcp_sock *tp = tcp_sk(sk); - unsigned long rtt, delay; -+ struct sock *meta_sk = mptcp(tp) ? mptcp_meta_sk(sk) : sk; -+ struct tcp_sock *meta_tp = tcp_sk(meta_sk); - - /* More than one full frame received... */ - if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss & -@@ -5268,6 +5268,6 @@ - * we have not received enough bytes to satisfy the condition. - */ -- (tp->rcv_nxt - tp->copied_seq < sk->sk_rcvlowat || -+ (meta_tp->rcv_nxt - meta_tp->copied_seq < meta_sk->sk_rcvlowat || - tp->ops->__select_window(sk) >= tp->rcv_wnd)) || - /* We ACK each frame or... */ - tcp_in_quickack_mode(sk) || From db7ebd41833631c7c6f62a882489faaf9ba31a59 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 26 Nov 2019 19:15:35 +0100 Subject: [PATCH 9/9] Add nanqinlang scheduler --- config | 2 + .../hack-4.19/692-tcp_nanqinlang.patch | 1037 +++++++++++++++++ 2 files changed, 1039 insertions(+) create mode 100644 root/target/linux/generic/hack-4.19/692-tcp_nanqinlang.patch diff --git a/config b/config index 792e660b..374ec969 100644 --- a/config +++ b/config @@ -186,6 +186,8 @@ CONFIG_KERNEL_TCP_CONG_VENO=y CONFIG_KERNEL_TCP_CONG_WESTWOOD=y CONFIG_KERNEL_TCP_CONG_YEAH=y CONFIG_KERNEL_TCP_CONG_LIA=y +CONFIG_KERNEL_TCP_CONG_BBR=y +CONFIG_KERNEL_TCP_CONG_NANQINLANG=y CONFIG_KERNEL_TCP_CONG_OLIA=y CONFIG_KERNEL_TCP_CONG_WVEGAS=y CONFIG_KERNEL_TCP_CONG_BALIA=y diff --git a/root/target/linux/generic/hack-4.19/692-tcp_nanqinlang.patch b/root/target/linux/generic/hack-4.19/692-tcp_nanqinlang.patch new file mode 100644 index 00000000..56051ae7 --- /dev/null +++ b/root/target/linux/generic/hack-4.19/692-tcp_nanqinlang.patch @@ -0,0 +1,1037 @@ +--- a/net/ipv4/Makefile.anc 2019-11-23 23:01:47.069966970 +0100 ++++ b/net/ipv4/Makefile 2019-11-23 23:03:01.416428035 +0100 +@@ -48,6 +48,7 @@ + obj-$(CONFIG_INET_UDP_DIAG) += udp_diag.o + obj-$(CONFIG_INET_RAW_DIAG) += raw_diag.o + obj-$(CONFIG_TCP_CONG_BBR) += tcp_bbr.o ++obj-$(CONFIG_TCP_CONG_NANQINLANG) += tcp_nanqinlang.o + obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o + obj-$(CONFIG_TCP_CONG_CDG) += tcp_cdg.o + obj-$(CONFIG_TCP_CONG_CUBIC) += tcp_cubic.o +--- a/net/ipv4/Kconfig.anc 2019-11-23 23:01:52.649851417 +0100 ++++ b/net/ipv4/Kconfig 2019-11-23 23:04:21.974762180 +0100 +@@ -681,6 +681,21 @@ + bufferbloat, policers, or AQM schemes that do not provide a delay + signal. It requires the fq ("Fair Queue") pacing packet scheduler. + ++config TCP_CONG_NANQINLANG ++ tristate "NANGINLANG TCP" ++ default n ++ ---help--- ++ ++ BBR (Bottleneck Bandwidth and RTT) TCP congestion control aims to ++ maximize network utilization and minimize queues. It builds an explicit ++ model of the the bottleneck delivery rate and path round-trip ++ propagation delay. It tolerates packet loss and delay unrelated to ++ congestion. It can operate over LAN, WAN, cellular, wifi, or cable ++ modem links. It can coexist with flows that use loss-based congestion ++ control, and can operate with shallow buffers, deep buffers, ++ bufferbloat, policers, or AQM schemes that do not provide a delay ++ signal. It requires the fq ("Fair Queue") pacing packet scheduler. ++ + config TCP_CONG_LIA + tristate "MPTCP Linked Increase" + depends on MPTCP +@@ -763,6 +778,9 @@ + config DEFAULT_BBR + bool "BBR" if TCP_CONG_BBR=y + ++ config DEFAULT_NANQINLANG ++ bool "BBR" if TCP_CONG_NANQINLANG=y ++ + config DEFAULT_LIA + bool "Lia" if TCP_CONG_LIA=y + +@@ -806,6 +824,7 @@ + default "dctcp" if DEFAULT_DCTCP + default "cdg" if DEFAULT_CDG + default "bbr" if DEFAULT_BBR ++ default "nanqinlang" if DEFAULT_NANQINLANG + default "cubic" + + config TCP_MD5SIG +--- /dev/null 2019-11-25 21:13:36.728349757 +0100 ++++ b/net/ipv4/tcp_nanqinlang.c 2019-11-25 21:10:00.392068414 +0100 +@@ -0,0 +1,982 @@ ++/* Bottleneck Bandwidth and RTT (BBR) congestion control ++ * ++ * BBR congestion control computes the sending rate based on the delivery ++ * rate (throughput) estimated from ACKs. In a nutshell: ++ * ++ * On each ACK, update our model of the network path: ++ * bottleneck_bandwidth = windowed_max(delivered / elapsed, 10 round trips) ++ * min_rtt = windowed_min(rtt, 10 seconds) ++ * pacing_rate = pacing_gain * bottleneck_bandwidth ++ * cwnd = max(cwnd_gain * bottleneck_bandwidth * min_rtt, 4) ++ * ++ * The core algorithm does not react directly to packet losses or delays, ++ * although BBR may adjust the size of next send per ACK when loss is ++ * observed, or adjust the sending rate if it estimates there is a ++ * traffic policer, in order to keep the drop rate reasonable. ++ * ++ * Here is a state transition diagram for BBR: ++ * ++ * | ++ * V ++ * +---> STARTUP ----+ ++ * | | | ++ * | V | ++ * | DRAIN ----+ ++ * | | | ++ * | V | ++ * +---> PROBE_BW ----+ ++ * | ^ | | ++ * | | | | ++ * | +----+ | ++ * | | ++ * +---- PROBE_RTT <--+ ++ * ++ * A BBR flow starts in STARTUP, and ramps up its sending rate quickly. ++ * When it estimates the pipe is full, it enters DRAIN to drain the queue. ++ * In steady state a BBR flow only uses PROBE_BW and PROBE_RTT. ++ * A long-lived BBR flow spends the vast majority of its time remaining ++ * (repeatedly) in PROBE_BW, fully probing and utilizing the pipe's bandwidth ++ * in a fair manner, with a small, bounded queue. *If* a flow has been ++ * continuously sending for the entire min_rtt window, and hasn't seen an RTT ++ * sample that matches or decreases its min_rtt estimate for 10 seconds, then ++ * it briefly enters PROBE_RTT to cut inflight to a minimum value to re-probe ++ * the path's two-way propagation delay (min_rtt). When exiting PROBE_RTT, if ++ * we estimated that we reached the full bw of the pipe then we enter PROBE_BW; ++ * otherwise we enter STARTUP to try to fill the pipe. ++ * ++ * BBR is described in detail in: ++ * "BBR: Congestion-Based Congestion Control", ++ * Neal Cardwell, Yuchung Cheng, C. Stephen Gunn, Soheil Hassas Yeganeh, ++ * Van Jacobson. ACM Queue, Vol. 14 No. 5, September-October 2016. ++ * ++ * There is a public e-mail list for discussing BBR development and testing: ++ * https://groups.google.com/forum/#!forum/bbr-dev ++ * ++ * NOTE: BBR might be used with the fq qdisc ("man tc-fq") with pacing enabled, ++ * otherwise TCP stack falls back to an internal pacing using one high ++ * resolution timer per TCP socket and may use more resources. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Scale factor for rate in pkt/uSec unit to avoid truncation in bandwidth ++ * estimation. The rate unit ~= (1500 bytes / 1 usec / 2^24) ~= 715 bps. ++ * This handles bandwidths from 0.06pps (715bps) to 256Mpps (3Tbps) in a u32. ++ * Since the minimum window is >=4 packets, the lower bound isn't ++ * an issue. The upper bound isn't an issue with existing technologies. ++ */ ++#define BW_SCALE 24 ++#define BW_UNIT (1 << BW_SCALE) ++ ++#define BBR_SCALE 8 /* scaling factor for fractions in BBR (e.g. gains) */ ++#define BBR_UNIT (1 << BBR_SCALE) ++ ++/* BBR has the following modes for deciding how fast to send: */ ++enum bbr_mode { ++ BBR_STARTUP, /* ramp up sending rate rapidly to fill pipe */ ++ BBR_DRAIN, /* drain any queue created during startup */ ++ BBR_PROBE_BW, /* discover, share bw: pace around estimated bw */ ++ BBR_PROBE_RTT, /* cut inflight to min to probe min_rtt */ ++}; ++ ++/* BBR congestion control block */ ++struct bbr { ++ u32 min_rtt_us; /* min RTT in min_rtt_win_sec window */ ++ u32 min_rtt_stamp; /* timestamp of min_rtt_us */ ++ u32 probe_rtt_done_stamp; /* end time for BBR_PROBE_RTT mode */ ++ struct minmax bw; /* Max recent delivery rate in pkts/uS << 24 */ ++ u32 rtt_cnt; /* count of packet-timed rounds elapsed */ ++ u32 next_rtt_delivered; /* scb->tx.delivered at end of round */ ++ u64 cycle_mstamp; /* time of this cycle phase start */ ++ u32 mode:3, /* current bbr_mode in state machine */ ++ prev_ca_state:3, /* CA state on previous ACK */ ++ packet_conservation:1, /* use packet conservation? */ ++ round_start:1, /* start of packet-timed tx->ack round? */ ++ idle_restart:1, /* restarting after idle? */ ++ probe_rtt_round_done:1, /* a BBR_PROBE_RTT round at 4 pkts? */ ++ unused:13, ++ lt_is_sampling:1, /* taking long-term ("LT") samples now? */ ++ lt_rtt_cnt:7, /* round trips in long-term interval */ ++ lt_use_bw:1; /* use lt_bw as our bw estimate? */ ++ u32 lt_bw; /* LT est delivery rate in pkts/uS << 24 */ ++ u32 lt_last_delivered; /* LT intvl start: tp->delivered */ ++ u32 lt_last_stamp; /* LT intvl start: tp->delivered_mstamp */ ++ u32 lt_last_lost; /* LT intvl start: tp->lost */ ++ u32 pacing_gain:10, /* current gain for setting pacing rate */ ++ cwnd_gain:10, /* current gain for setting cwnd */ ++ full_bw_reached:1, /* reached full bw in Startup? */ ++ full_bw_cnt:2, /* number of rounds without large bw gains */ ++ cycle_idx:3, /* current index in pacing_gain cycle array */ ++ has_seen_rtt:1, /* have we seen an RTT sample yet? */ ++ unused_b:5; ++ u32 prior_cwnd; /* prior cwnd upon entering loss recovery */ ++ u32 full_bw; /* recent bw, to estimate if pipe is full */ ++}; ++ ++#define CYCLE_LEN 8 /* number of phases in a pacing gain cycle */ ++ ++/* Window length of bw filter (in rounds): */ ++static const int bbr_bw_rtts = CYCLE_LEN + 2; ++/* Window length of min_rtt filter (in sec): */ ++static const u32 bbr_min_rtt_win_sec = 10; ++/* Minimum time (in ms) spent at bbr_cwnd_min_target in BBR_PROBE_RTT mode: */ ++static const u32 bbr_probe_rtt_mode_ms = 100; ++/* Skip TSO below the following bandwidth (bits/sec): */ ++static const int bbr_min_tso_rate = 1200000; ++ ++/* We use a high_gain value of 2/ln(2) because it's the smallest pacing gain ++ * that will allow a smoothly increasing pacing rate that will double each RTT ++ * and send the same number of packets per RTT that an un-paced, slow-starting ++ * Reno or CUBIC flow would: ++ */ ++static const int bbr_high_gain = BBR_UNIT * 3000 / 1000 + 1; ++/* The pacing gain of 1/high_gain in BBR_DRAIN is calculated to typically drain ++ * the queue created in BBR_STARTUP in a single round: ++ */ ++static const int bbr_drain_gain = BBR_UNIT * 1000 / 3000; ++/* The gain for deriving steady-state cwnd tolerates delayed/stretched ACKs: */ ++static const int bbr_cwnd_gain = BBR_UNIT * 2; ++/* The pacing_gain values for the PROBE_BW gain cycle, to discover/share bw: */ ++static const int bbr_pacing_gain[] = { ++ BBR_UNIT * 6 / 4, /* probe for more available bw */ ++ BBR_UNIT * 3 / 4, /* drain queue and/or yield bw to other flows */ ++ BBR_UNIT * 5 / 4, BBR_UNIT * 5 / 4, BBR_UNIT * 5 / 4, /* cruise at 1.0*bw to utilize pipe, */ ++ BBR_UNIT * 6 / 4, BBR_UNIT * 6 / 4, BBR_UNIT * 6 / 4 /* without creating excess queue... */ ++}; ++/* Randomize the starting gain cycling phase over N phases: */ ++static const u32 bbr_cycle_rand = 7; ++ ++/* Try to keep at least this many packets in flight, if things go smoothly. For ++ * smooth functioning, a sliding window protocol ACKing every other packet ++ * needs at least 4 packets in flight: ++ */ ++static const u32 bbr_cwnd_min_target = 4; ++ ++/* To estimate if BBR_STARTUP mode (i.e. high_gain) has filled pipe... */ ++/* If bw has increased significantly (1.25x), there may be more bw available: */ ++static const u32 bbr_full_bw_thresh = BBR_UNIT * 5 / 4; ++/* But after 3 rounds w/o significant bw growth, estimate pipe is full: */ ++static const u32 bbr_full_bw_cnt = 3; ++ ++/* "long-term" ("LT") bandwidth estimator parameters... */ ++/* The minimum number of rounds in an LT bw sampling interval: */ ++static const u32 bbr_lt_intvl_min_rtts = 4; ++/* If lost/delivered ratio > 20%, interval is "lossy" and we may be policed: */ ++static const u32 bbr_lt_loss_thresh = 50; ++/* If 2 intervals have a bw ratio <= 1/8, their bw is "consistent": */ ++static const u32 bbr_lt_bw_ratio = BBR_UNIT / 4; ++/* If 2 intervals have a bw diff <= 4 Kbit/sec their bw is "consistent": */ ++static const u32 bbr_lt_bw_diff = 4000 / 8; ++/* If we estimate we're policed, use lt_bw for this many round trips: */ ++static const u32 bbr_lt_bw_max_rtts = 48; ++ ++static void bbr_check_probe_rtt_done(struct sock *sk); ++ ++/* Do we estimate that STARTUP filled the pipe? */ ++static bool bbr_full_bw_reached(const struct sock *sk) ++{ ++ const struct bbr *bbr = inet_csk_ca(sk); ++ ++ return bbr->full_bw_reached; ++} ++ ++/* Return the windowed max recent bandwidth sample, in pkts/uS << BW_SCALE. */ ++static u32 bbr_max_bw(const struct sock *sk) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ return minmax_get(&bbr->bw); ++} ++ ++/* Return the estimated bandwidth of the path, in pkts/uS << BW_SCALE. */ ++static u32 bbr_bw(const struct sock *sk) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ return bbr->lt_use_bw ? bbr->lt_bw : bbr_max_bw(sk); ++} ++ ++/* Return rate in bytes per second, optionally with a gain. ++ * The order here is chosen carefully to avoid overflow of u64. This should ++ * work for input rates of up to 2.9Tbit/sec and gain of 2.89x. ++ */ ++static u64 bbr_rate_bytes_per_sec(struct sock *sk, u64 rate, int gain) ++{ ++ unsigned int mss = tcp_sk(sk)->mss_cache; ++ ++ if (!tcp_needs_internal_pacing(sk)) ++ mss = tcp_mss_to_mtu(sk, mss); ++ rate *= mss; ++ rate *= gain; ++ rate >>= BBR_SCALE; ++ rate *= USEC_PER_SEC; ++ return rate >> BW_SCALE; ++} ++ ++/* Convert a BBR bw and gain factor to a pacing rate in bytes per second. */ ++static u32 bbr_bw_to_pacing_rate(struct sock *sk, u32 bw, int gain) ++{ ++ u64 rate = bw; ++ ++ rate = bbr_rate_bytes_per_sec(sk, rate, gain); ++ rate = min_t(u64, rate, sk->sk_max_pacing_rate); ++ return rate; ++} ++ ++/* Initialize pacing rate to: high_gain * init_cwnd / RTT. */ ++static void bbr_init_pacing_rate_from_rtt(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u64 bw; ++ u32 rtt_us; ++ ++ if (tp->srtt_us) { /* any RTT sample yet? */ ++ rtt_us = max(tp->srtt_us >> 3, 1U); ++ bbr->has_seen_rtt = 1; ++ } else { /* no RTT sample yet */ ++ rtt_us = USEC_PER_MSEC; /* use nominal default RTT */ ++ } ++ bw = (u64)tp->snd_cwnd * BW_UNIT; ++ do_div(bw, rtt_us); ++ sk->sk_pacing_rate = bbr_bw_to_pacing_rate(sk, bw, bbr_high_gain); ++} ++ ++/* Pace using current bw estimate and a gain factor. In order to help drive the ++ * network toward lower queues while maintaining high utilization and low ++ * latency, the average pacing rate aims to be slightly (~1%) lower than the ++ * estimated bandwidth. This is an important aspect of the design. In this ++ * implementation this slightly lower pacing rate is achieved implicitly by not ++ * including link-layer headers in the packet size used for the pacing rate. ++ */ ++static void bbr_set_pacing_rate(struct sock *sk, u32 bw, int gain) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 rate = bbr_bw_to_pacing_rate(sk, bw, gain); ++ ++ if (unlikely(!bbr->has_seen_rtt && tp->srtt_us)) ++ bbr_init_pacing_rate_from_rtt(sk); ++ if (bbr_full_bw_reached(sk) || rate > sk->sk_pacing_rate) ++ sk->sk_pacing_rate = rate; ++} ++ ++/* override sysctl_tcp_min_tso_segs */ ++static u32 bbr_min_tso_segs(struct sock *sk) ++{ ++ return sk->sk_pacing_rate < (bbr_min_tso_rate >> 3) ? 1 : 2; ++} ++ ++static u32 bbr_tso_segs_goal(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ u32 segs, bytes; ++ ++ /* Sort of tcp_tso_autosize() but ignoring ++ * driver provided sk_gso_max_size. ++ */ ++ bytes = min_t(u32, sk->sk_pacing_rate >> sk->sk_pacing_shift, ++ GSO_MAX_SIZE - 1 - MAX_TCP_HEADER); ++ segs = max_t(u32, bytes / tp->mss_cache, bbr_min_tso_segs(sk)); ++ ++ return min(segs, 0x7FU); ++} ++ ++/* Save "last known good" cwnd so we can restore it after losses or PROBE_RTT */ ++static void bbr_save_cwnd(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ if (bbr->prev_ca_state < TCP_CA_Recovery && bbr->mode != BBR_PROBE_RTT) ++ bbr->prior_cwnd = tp->snd_cwnd; /* this cwnd is good enough */ ++ else /* loss recovery or BBR_PROBE_RTT have temporarily cut cwnd */ ++ bbr->prior_cwnd = max(bbr->prior_cwnd, tp->snd_cwnd); ++} ++ ++static void bbr_cwnd_event(struct sock *sk, enum tcp_ca_event event) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ if (event == CA_EVENT_TX_START && tp->app_limited) { ++ bbr->idle_restart = 1; ++ /* Avoid pointless buffer overflows: pace at est. bw if we don't ++ * need more speed (we're restarting from idle and app-limited). ++ */ ++ if (bbr->mode == BBR_PROBE_BW) ++ bbr_set_pacing_rate(sk, bbr_bw(sk), BBR_UNIT); ++ else if (bbr->mode == BBR_PROBE_RTT) ++ bbr_check_probe_rtt_done(sk); ++ } ++} ++ ++/* Find target cwnd. Right-size the cwnd based on min RTT and the ++ * estimated bottleneck bandwidth: ++ * ++ * cwnd = bw * min_rtt * gain = BDP * gain ++ * ++ * The key factor, gain, controls the amount of queue. While a small gain ++ * builds a smaller queue, it becomes more vulnerable to noise in RTT ++ * measurements (e.g., delayed ACKs or other ACK compression effects). This ++ * noise may cause BBR to under-estimate the rate. ++ * ++ * To achieve full performance in high-speed paths, we budget enough cwnd to ++ * fit full-sized skbs in-flight on both end hosts to fully utilize the path: ++ * - one skb in sending host Qdisc, ++ * - one skb in sending host TSO/GSO engine ++ * - one skb being received by receiver host LRO/GRO/delayed-ACK engine ++ * Don't worry, at low rates (bbr_min_tso_rate) this won't bloat cwnd because ++ * in such cases tso_segs_goal is 1. The minimum cwnd is 4 packets, ++ * which allows 2 outstanding 2-packet sequences, to try to keep pipe ++ * full even with ACK-every-other-packet delayed ACKs. ++ */ ++static u32 bbr_target_cwnd(struct sock *sk, u32 bw, int gain) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 cwnd; ++ u64 w; ++ ++ /* If we've never had a valid RTT sample, cap cwnd at the initial ++ * default. This should only happen when the connection is not using TCP ++ * timestamps and has retransmitted all of the SYN/SYNACK/data packets ++ * ACKed so far. In this case, an RTO can cut cwnd to 1, in which ++ * case we need to slow-start up toward something safe: TCP_INIT_CWND. ++ */ ++ if (unlikely(bbr->min_rtt_us == ~0U)) /* no valid RTT samples yet? */ ++ return TCP_INIT_CWND; /* be safe: cap at default initial cwnd*/ ++ ++ w = (u64)bw * bbr->min_rtt_us; ++ ++ /* Apply a gain to the given value, then remove the BW_SCALE shift. */ ++ cwnd = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT; ++ ++ /* Allow enough full-sized skbs in flight to utilize end systems. */ ++ cwnd += 3 * bbr_tso_segs_goal(sk); ++ ++ /* Reduce delayed ACKs by rounding up cwnd to the next even number. */ ++ cwnd = (cwnd + 1) & ~1U; ++ ++ /* Ensure gain cycling gets inflight above BDP even for small BDPs. */ ++ if (bbr->mode == BBR_PROBE_BW && gain > BBR_UNIT) ++ cwnd += 2; ++ ++ return cwnd; ++} ++ ++/* An optimization in BBR to reduce losses: On the first round of recovery, we ++ * follow the packet conservation principle: send P packets per P packets acked. ++ * After that, we slow-start and send at most 2*P packets per P packets acked. ++ * After recovery finishes, or upon undo, we restore the cwnd we had when ++ * recovery started (capped by the target cwnd based on estimated BDP). ++ * ++ * TODO(ycheng/ncardwell): implement a rate-based approach. ++ */ ++static bool bbr_set_cwnd_to_recover_or_restore( ++ struct sock *sk, const struct rate_sample *rs, u32 acked, u32 *new_cwnd) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u8 prev_state = bbr->prev_ca_state, state = inet_csk(sk)->icsk_ca_state; ++ u32 cwnd = tp->snd_cwnd; ++ ++ /* An ACK for P pkts should release at most 2*P packets. We do this ++ * in two steps. First, here we deduct the number of lost packets. ++ * Then, in bbr_set_cwnd() we slow start up toward the target cwnd. ++ */ ++ if (rs->losses > 0) ++ cwnd = max_t(s32, cwnd - rs->losses, 1); ++ ++ if (state == TCP_CA_Recovery && prev_state != TCP_CA_Recovery) { ++ /* Starting 1st round of Recovery, so do packet conservation. */ ++ bbr->packet_conservation = 1; ++ bbr->next_rtt_delivered = tp->delivered; /* start round now */ ++ /* Cut unused cwnd from app behavior, TSQ, or TSO deferral: */ ++ cwnd = tcp_packets_in_flight(tp) + acked; ++ } else if (prev_state >= TCP_CA_Recovery && state < TCP_CA_Recovery) { ++ /* Exiting loss recovery; restore cwnd saved before recovery. */ ++ cwnd = max(cwnd, bbr->prior_cwnd); ++ bbr->packet_conservation = 0; ++ } ++ bbr->prev_ca_state = state; ++ ++ if (bbr->packet_conservation) { ++ *new_cwnd = max(cwnd, tcp_packets_in_flight(tp) + acked); ++ return true; /* yes, using packet conservation */ ++ } ++ *new_cwnd = cwnd; ++ return false; ++} ++ ++/* Slow-start up toward target cwnd (if bw estimate is growing, or packet loss ++ * has drawn us down below target), or snap down to target if we're above it. ++ */ ++static void bbr_set_cwnd(struct sock *sk, const struct rate_sample *rs, ++ u32 acked, u32 bw, int gain) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 cwnd = tp->snd_cwnd, target_cwnd = 0; ++ ++ if (!acked) ++ goto done; /* no packet fully ACKed; just apply caps */ ++ ++ if (bbr_set_cwnd_to_recover_or_restore(sk, rs, acked, &cwnd)) ++ goto done; ++ ++ /* If we're below target cwnd, slow start cwnd toward target cwnd. */ ++ target_cwnd = bbr_target_cwnd(sk, bw, gain); ++ if (bbr_full_bw_reached(sk)) /* only cut cwnd if we filled the pipe */ ++ cwnd = min(cwnd + acked, target_cwnd); ++ else if (cwnd < target_cwnd || tp->delivered < TCP_INIT_CWND) ++ cwnd = cwnd + acked; ++ cwnd = max(cwnd, bbr_cwnd_min_target); ++ ++done: ++ tp->snd_cwnd = min(cwnd, tp->snd_cwnd_clamp); /* apply global cap */ ++ if (bbr->mode == BBR_PROBE_RTT) /* drain queue, refresh min_rtt */ ++ tp->snd_cwnd = min(tp->snd_cwnd, bbr_cwnd_min_target); ++} ++ ++/* End cycle phase if it's time and/or we hit the phase's in-flight target. */ ++static bool bbr_is_next_cycle_phase(struct sock *sk, ++ const struct rate_sample *rs) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ bool is_full_length = ++ tcp_stamp_us_delta(tp->delivered_mstamp, bbr->cycle_mstamp) > ++ bbr->min_rtt_us; ++ u32 inflight, bw; ++ ++ /* The pacing_gain of 1.0 paces at the estimated bw to try to fully ++ * use the pipe without increasing the queue. ++ */ ++ if (bbr->pacing_gain == BBR_UNIT) ++ return is_full_length; /* just use wall clock time */ ++ ++ inflight = rs->prior_in_flight; /* what was in-flight before ACK? */ ++ bw = bbr_max_bw(sk); ++ ++ /* A pacing_gain > 1.0 probes for bw by trying to raise inflight to at ++ * least pacing_gain*BDP; this may take more than min_rtt if min_rtt is ++ * small (e.g. on a LAN). We do not persist if packets are lost, since ++ * a path with small buffers may not hold that much. ++ */ ++ if (bbr->pacing_gain > BBR_UNIT) ++ return is_full_length && ++ (rs->losses || /* perhaps pacing_gain*BDP won't fit */ ++ inflight >= bbr_target_cwnd(sk, bw, bbr->pacing_gain)); ++ ++ /* A pacing_gain < 1.0 tries to drain extra queue we added if bw ++ * probing didn't find more bw. If inflight falls to match BDP then we ++ * estimate queue is drained; persisting would underutilize the pipe. ++ */ ++ return is_full_length || ++ inflight <= bbr_target_cwnd(sk, bw, BBR_UNIT); ++} ++ ++static void bbr_advance_cycle_phase(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->cycle_idx = (bbr->cycle_idx + 1) & (CYCLE_LEN - 1); ++ bbr->cycle_mstamp = tp->delivered_mstamp; ++ bbr->pacing_gain = bbr->lt_use_bw ? BBR_UNIT : ++ bbr_pacing_gain[bbr->cycle_idx]; ++} ++ ++/* Gain cycling: cycle pacing gain to converge to fair share of available bw. */ ++static void bbr_update_cycle_phase(struct sock *sk, ++ const struct rate_sample *rs) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ if (bbr->mode == BBR_PROBE_BW && bbr_is_next_cycle_phase(sk, rs)) ++ bbr_advance_cycle_phase(sk); ++} ++ ++static void bbr_reset_startup_mode(struct sock *sk) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->mode = BBR_STARTUP; ++ bbr->pacing_gain = bbr_high_gain; ++ bbr->cwnd_gain = bbr_high_gain; ++} ++ ++static void bbr_reset_probe_bw_mode(struct sock *sk) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->mode = BBR_PROBE_BW; ++ bbr->pacing_gain = BBR_UNIT; ++ bbr->cwnd_gain = bbr_cwnd_gain; ++ bbr->cycle_idx = CYCLE_LEN - 1 - prandom_u32_max(bbr_cycle_rand); ++ bbr_advance_cycle_phase(sk); /* flip to next phase of gain cycle */ ++} ++ ++static void bbr_reset_mode(struct sock *sk) ++{ ++ if (!bbr_full_bw_reached(sk)) ++ bbr_reset_startup_mode(sk); ++ else ++ bbr_reset_probe_bw_mode(sk); ++} ++ ++/* Start a new long-term sampling interval. */ ++static void bbr_reset_lt_bw_sampling_interval(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->lt_last_stamp = div_u64(tp->delivered_mstamp, USEC_PER_MSEC); ++ bbr->lt_last_delivered = tp->delivered; ++ bbr->lt_last_lost = tp->lost; ++ bbr->lt_rtt_cnt = 0; ++} ++ ++/* Completely reset long-term bandwidth sampling. */ ++static void bbr_reset_lt_bw_sampling(struct sock *sk) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->lt_bw = 0; ++ bbr->lt_use_bw = 0; ++ bbr->lt_is_sampling = false; ++ bbr_reset_lt_bw_sampling_interval(sk); ++} ++ ++/* Long-term bw sampling interval is done. Estimate whether we're policed. */ ++static void bbr_lt_bw_interval_done(struct sock *sk, u32 bw) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 diff; ++ ++ if (bbr->lt_bw) { /* do we have bw from a previous interval? */ ++ /* Is new bw close to the lt_bw from the previous interval? */ ++ diff = abs(bw - bbr->lt_bw); ++ if ((diff * BBR_UNIT <= bbr_lt_bw_ratio * bbr->lt_bw) || ++ (bbr_rate_bytes_per_sec(sk, diff, BBR_UNIT) <= ++ bbr_lt_bw_diff)) { ++ /* All criteria are met; estimate we're policed. */ ++ bbr->lt_bw = (bw + bbr->lt_bw) >> 1; /* avg 2 intvls */ ++ bbr->lt_use_bw = 1; ++ bbr->pacing_gain = BBR_UNIT; /* try to avoid drops */ ++ bbr->lt_rtt_cnt = 0; ++ return; ++ } ++ } ++ bbr->lt_bw = bw; ++ bbr_reset_lt_bw_sampling_interval(sk); ++} ++ ++/* Token-bucket traffic policers are common (see "An Internet-Wide Analysis of ++ * Traffic Policing", SIGCOMM 2016). BBR detects token-bucket policers and ++ * explicitly models their policed rate, to reduce unnecessary losses. We ++ * estimate that we're policed if we see 2 consecutive sampling intervals with ++ * consistent throughput and high packet loss. If we think we're being policed, ++ * set lt_bw to the "long-term" average delivery rate from those 2 intervals. ++ */ ++static void bbr_lt_bw_sampling(struct sock *sk, const struct rate_sample *rs) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 lost, delivered; ++ u64 bw; ++ u32 t; ++ ++ if (bbr->lt_use_bw) { /* already using long-term rate, lt_bw? */ ++ if (bbr->mode == BBR_PROBE_BW && bbr->round_start && ++ ++bbr->lt_rtt_cnt >= bbr_lt_bw_max_rtts) { ++ bbr_reset_lt_bw_sampling(sk); /* stop using lt_bw */ ++ bbr_reset_probe_bw_mode(sk); /* restart gain cycling */ ++ } ++ return; ++ } ++ ++ /* Wait for the first loss before sampling, to let the policer exhaust ++ * its tokens and estimate the steady-state rate allowed by the policer. ++ * Starting samples earlier includes bursts that over-estimate the bw. ++ */ ++ if (!bbr->lt_is_sampling) { ++ if (!rs->losses) ++ return; ++ bbr_reset_lt_bw_sampling_interval(sk); ++ bbr->lt_is_sampling = true; ++ } ++ ++ /* To avoid underestimates, reset sampling if we run out of data. */ ++ if (rs->is_app_limited) { ++ bbr_reset_lt_bw_sampling(sk); ++ return; ++ } ++ ++ if (bbr->round_start) ++ bbr->lt_rtt_cnt++; /* count round trips in this interval */ ++ if (bbr->lt_rtt_cnt < bbr_lt_intvl_min_rtts) ++ return; /* sampling interval needs to be longer */ ++ if (bbr->lt_rtt_cnt > 4 * bbr_lt_intvl_min_rtts) { ++ bbr_reset_lt_bw_sampling(sk); /* interval is too long */ ++ return; ++ } ++ ++ /* End sampling interval when a packet is lost, so we estimate the ++ * policer tokens were exhausted. Stopping the sampling before the ++ * tokens are exhausted under-estimates the policed rate. ++ */ ++ if (!rs->losses) ++ return; ++ ++ /* Calculate packets lost and delivered in sampling interval. */ ++ lost = tp->lost - bbr->lt_last_lost; ++ delivered = tp->delivered - bbr->lt_last_delivered; ++ /* Is loss rate (lost/delivered) >= lt_loss_thresh? If not, wait. */ ++ if (!delivered || (lost << BBR_SCALE) < bbr_lt_loss_thresh * delivered) ++ return; ++ ++ /* Find average delivery rate in this sampling interval. */ ++ t = div_u64(tp->delivered_mstamp, USEC_PER_MSEC) - bbr->lt_last_stamp; ++ if ((s32)t < 1) ++ return; /* interval is less than one ms, so wait */ ++ /* Check if can multiply without overflow */ ++ if (t >= ~0U / USEC_PER_MSEC) { ++ bbr_reset_lt_bw_sampling(sk); /* interval too long; reset */ ++ return; ++ } ++ t *= USEC_PER_MSEC; ++ bw = (u64)delivered * BW_UNIT; ++ do_div(bw, t); ++ bbr_lt_bw_interval_done(sk, bw); ++} ++ ++/* Estimate the bandwidth based on how fast packets are delivered */ ++static void bbr_update_bw(struct sock *sk, const struct rate_sample *rs) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u64 bw; ++ ++ bbr->round_start = 0; ++ if (rs->delivered < 0 || rs->interval_us <= 0) ++ return; /* Not a valid observation */ ++ ++ /* See if we've reached the next RTT */ ++ if (!before(rs->prior_delivered, bbr->next_rtt_delivered)) { ++ bbr->next_rtt_delivered = tp->delivered; ++ bbr->rtt_cnt++; ++ bbr->round_start = 1; ++ bbr->packet_conservation = 0; ++ } ++ ++ bbr_lt_bw_sampling(sk, rs); ++ ++ /* Divide delivered by the interval to find a (lower bound) bottleneck ++ * bandwidth sample. Delivered is in packets and interval_us in uS and ++ * ratio will be <<1 for most connections. So delivered is first scaled. ++ */ ++ bw = (u64)rs->delivered * BW_UNIT; ++ do_div(bw, rs->interval_us); ++ ++ /* If this sample is application-limited, it is likely to have a very ++ * low delivered count that represents application behavior rather than ++ * the available network rate. Such a sample could drag down estimated ++ * bw, causing needless slow-down. Thus, to continue to send at the ++ * last measured network rate, we filter out app-limited samples unless ++ * they describe the path bw at least as well as our bw model. ++ * ++ * So the goal during app-limited phase is to proceed with the best ++ * network rate no matter how long. We automatically leave this ++ * phase when app writes faster than the network can deliver :) ++ */ ++ if (!rs->is_app_limited || bw >= bbr_max_bw(sk)) { ++ /* Incorporate new sample into our max bw filter. */ ++ minmax_running_max(&bbr->bw, bbr_bw_rtts, bbr->rtt_cnt, bw); ++ } ++} ++ ++/* Estimate when the pipe is full, using the change in delivery rate: BBR ++ * estimates that STARTUP filled the pipe if the estimated bw hasn't changed by ++ * at least bbr_full_bw_thresh (25%) after bbr_full_bw_cnt (3) non-app-limited ++ * rounds. Why 3 rounds: 1: rwin autotuning grows the rwin, 2: we fill the ++ * higher rwin, 3: we get higher delivery rate samples. Or transient ++ * cross-traffic or radio noise can go away. CUBIC Hystart shares a similar ++ * design goal, but uses delay and inter-ACK spacing instead of bandwidth. ++ */ ++static void bbr_check_full_bw_reached(struct sock *sk, ++ const struct rate_sample *rs) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 bw_thresh; ++ ++ if (bbr_full_bw_reached(sk) || !bbr->round_start || rs->is_app_limited) ++ return; ++ ++ bw_thresh = (u64)bbr->full_bw * bbr_full_bw_thresh >> BBR_SCALE; ++ if (bbr_max_bw(sk) >= bw_thresh) { ++ bbr->full_bw = bbr_max_bw(sk); ++ bbr->full_bw_cnt = 0; ++ return; ++ } ++ ++bbr->full_bw_cnt; ++ bbr->full_bw_reached = bbr->full_bw_cnt >= bbr_full_bw_cnt; ++} ++ ++/* If pipe is probably full, drain the queue and then enter steady-state. */ ++static void bbr_check_drain(struct sock *sk, const struct rate_sample *rs) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ if (bbr->mode == BBR_STARTUP && bbr_full_bw_reached(sk)) { ++ bbr->mode = BBR_DRAIN; /* drain queue we created */ ++ bbr->pacing_gain = bbr_drain_gain; /* pace slow to drain */ ++ bbr->cwnd_gain = bbr_high_gain; /* maintain cwnd */ ++ tcp_sk(sk)->snd_ssthresh = ++ bbr_target_cwnd(sk, bbr_max_bw(sk), BBR_UNIT); ++ } /* fall through to check if in-flight is already small: */ ++ if (bbr->mode == BBR_DRAIN && ++ tcp_packets_in_flight(tcp_sk(sk)) <= ++ bbr_target_cwnd(sk, bbr_max_bw(sk), BBR_UNIT)) ++ bbr_reset_probe_bw_mode(sk); /* we estimate queue is drained */ ++} ++ ++static void bbr_check_probe_rtt_done(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ if (!(bbr->probe_rtt_done_stamp && ++ after(tcp_jiffies32, bbr->probe_rtt_done_stamp))) ++ return; ++ ++ bbr->min_rtt_stamp = tcp_jiffies32; /* wait a while until PROBE_RTT */ ++ tp->snd_cwnd = max(tp->snd_cwnd, bbr->prior_cwnd); ++ bbr_reset_mode(sk); ++} ++ ++/* The goal of PROBE_RTT mode is to have BBR flows cooperatively and ++ * periodically drain the bottleneck queue, to converge to measure the true ++ * min_rtt (unloaded propagation delay). This allows the flows to keep queues ++ * small (reducing queuing delay and packet loss) and achieve fairness among ++ * BBR flows. ++ * ++ * The min_rtt filter window is 10 seconds. When the min_rtt estimate expires, ++ * we enter PROBE_RTT mode and cap the cwnd at bbr_cwnd_min_target=4 packets. ++ * After at least bbr_probe_rtt_mode_ms=200ms and at least one packet-timed ++ * round trip elapsed with that flight size <= 4, we leave PROBE_RTT mode and ++ * re-enter the previous mode. BBR uses 200ms to approximately bound the ++ * performance penalty of PROBE_RTT's cwnd capping to roughly 2% (200ms/10s). ++ * ++ * Note that flows need only pay 2% if they are busy sending over the last 10 ++ * seconds. Interactive applications (e.g., Web, RPCs, video chunks) often have ++ * natural silences or low-rate periods within 10 seconds where the rate is low ++ * enough for long enough to drain its queue in the bottleneck. We pick up ++ * these min RTT measurements opportunistically with our min_rtt filter. :-) ++ */ ++static void bbr_update_min_rtt(struct sock *sk, const struct rate_sample *rs) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ bool filter_expired; ++ ++ /* Track min RTT seen in the min_rtt_win_sec filter window: */ ++ filter_expired = after(tcp_jiffies32, ++ bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); ++ if (rs->rtt_us >= 0 && ++ (rs->rtt_us <= bbr->min_rtt_us || ++ (filter_expired && !rs->is_ack_delayed))) { ++ bbr->min_rtt_us = rs->rtt_us; ++ bbr->min_rtt_stamp = tcp_jiffies32; ++ } ++ ++ if (bbr_probe_rtt_mode_ms > 0 && filter_expired && ++ !bbr->idle_restart && bbr->mode != BBR_PROBE_RTT) { ++ bbr->mode = BBR_PROBE_RTT; /* dip, drain queue */ ++ bbr->pacing_gain = BBR_UNIT; ++ bbr->cwnd_gain = BBR_UNIT; ++ bbr_save_cwnd(sk); /* note cwnd so we can restore it */ ++ bbr->probe_rtt_done_stamp = 0; ++ } ++ ++ if (bbr->mode == BBR_PROBE_RTT) { ++ /* Ignore low rate samples during this mode. */ ++ tp->app_limited = ++ (tp->delivered + tcp_packets_in_flight(tp)) ? : 1; ++ /* Maintain min packets in flight for max(200 ms, 1 round). */ ++ if (!bbr->probe_rtt_done_stamp && ++ tcp_packets_in_flight(tp) <= bbr_cwnd_min_target) { ++ bbr->probe_rtt_done_stamp = tcp_jiffies32 + ++ msecs_to_jiffies(bbr_probe_rtt_mode_ms); ++ bbr->probe_rtt_round_done = 0; ++ bbr->next_rtt_delivered = tp->delivered; ++ } else if (bbr->probe_rtt_done_stamp) { ++ if (bbr->round_start) ++ bbr->probe_rtt_round_done = 1; ++ if (bbr->probe_rtt_round_done) ++ bbr_check_probe_rtt_done(sk); ++ } ++ } ++ /* Restart after idle ends only once we process a new S/ACK for data */ ++ if (rs->delivered > 0) ++ bbr->idle_restart = 0; ++} ++ ++static void bbr_update_model(struct sock *sk, const struct rate_sample *rs) ++{ ++ bbr_update_bw(sk, rs); ++ bbr_update_cycle_phase(sk, rs); ++ bbr_check_full_bw_reached(sk, rs); ++ bbr_check_drain(sk, rs); ++ bbr_update_min_rtt(sk, rs); ++} ++ ++static void bbr_main(struct sock *sk, const struct rate_sample *rs) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ u32 bw; ++ ++ bbr_update_model(sk, rs); ++ ++ bw = bbr_bw(sk); ++ bbr_set_pacing_rate(sk, bw, bbr->pacing_gain); ++ bbr_set_cwnd(sk, rs, rs->acked_sacked, bw, bbr->cwnd_gain); ++} ++ ++static void bbr_init(struct sock *sk) ++{ ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->prior_cwnd = 0; ++ tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; ++ bbr->rtt_cnt = 0; ++ bbr->next_rtt_delivered = 0; ++ bbr->prev_ca_state = TCP_CA_Open; ++ bbr->packet_conservation = 0; ++ ++ bbr->probe_rtt_done_stamp = 0; ++ bbr->probe_rtt_round_done = 0; ++ bbr->min_rtt_us = tcp_min_rtt(tp); ++ bbr->min_rtt_stamp = tcp_jiffies32; ++ ++ minmax_reset(&bbr->bw, bbr->rtt_cnt, 0); /* init max bw to 0 */ ++ ++ bbr->has_seen_rtt = 0; ++ bbr_init_pacing_rate_from_rtt(sk); ++ ++ bbr->round_start = 0; ++ bbr->idle_restart = 0; ++ bbr->full_bw_reached = 0; ++ bbr->full_bw = 0; ++ bbr->full_bw_cnt = 0; ++ bbr->cycle_mstamp = 0; ++ bbr->cycle_idx = 0; ++ bbr_reset_lt_bw_sampling(sk); ++ bbr_reset_startup_mode(sk); ++ ++ cmpxchg(&sk->sk_pacing_status, SK_PACING_NONE, SK_PACING_NEEDED); ++} ++ ++static u32 bbr_sndbuf_expand(struct sock *sk) ++{ ++ /* Provision 3 * cwnd since BBR may slow-start even during recovery. */ ++ return 3; ++} ++ ++/* In theory BBR does not need to undo the cwnd since it does not ++ * always reduce cwnd on losses (see bbr_main()). Keep it for now. ++ */ ++static u32 bbr_undo_cwnd(struct sock *sk) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ bbr->full_bw = 0; /* spurious slow-down; reset full pipe detection */ ++ bbr->full_bw_cnt = 0; ++ bbr_reset_lt_bw_sampling(sk); ++ return tcp_sk(sk)->snd_cwnd; ++} ++ ++/* Entering loss recovery, so save cwnd for when we exit or undo recovery. */ ++static u32 bbr_ssthresh(struct sock *sk) ++{ ++ bbr_save_cwnd(sk); ++ return tcp_sk(sk)->snd_ssthresh; ++} ++ ++static size_t bbr_get_info(struct sock *sk, u32 ext, int *attr, ++ union tcp_cc_info *info) ++{ ++ if (ext & (1 << (INET_DIAG_BBRINFO - 1)) || ++ ext & (1 << (INET_DIAG_VEGASINFO - 1))) { ++ struct tcp_sock *tp = tcp_sk(sk); ++ struct bbr *bbr = inet_csk_ca(sk); ++ u64 bw = bbr_bw(sk); ++ ++ bw = bw * tp->mss_cache * USEC_PER_SEC >> BW_SCALE; ++ memset(&info->bbr, 0, sizeof(info->bbr)); ++ info->bbr.bbr_bw_lo = (u32)bw; ++ info->bbr.bbr_bw_hi = (u32)(bw >> 32); ++ info->bbr.bbr_min_rtt = bbr->min_rtt_us; ++ info->bbr.bbr_pacing_gain = bbr->pacing_gain; ++ info->bbr.bbr_cwnd_gain = bbr->cwnd_gain; ++ *attr = INET_DIAG_BBRINFO; ++ return sizeof(info->bbr); ++ } ++ return 0; ++} ++ ++static void bbr_set_state(struct sock *sk, u8 new_state) ++{ ++ struct bbr *bbr = inet_csk_ca(sk); ++ ++ if (new_state == TCP_CA_Loss) { ++ struct rate_sample rs = { .losses = 1 }; ++ ++ bbr->prev_ca_state = TCP_CA_Loss; ++ bbr->full_bw = 0; ++ bbr->round_start = 1; /* treat RTO like end of a round */ ++ bbr_lt_bw_sampling(sk, &rs); ++ } ++} ++ ++static struct tcp_congestion_ops tcp_bbr_cong_ops __read_mostly = { ++ .flags = TCP_CONG_NON_RESTRICTED, ++ .name = "nanqinlang", ++ .owner = THIS_MODULE, ++ .init = bbr_init, ++ .cong_control = bbr_main, ++ .sndbuf_expand = bbr_sndbuf_expand, ++ .undo_cwnd = bbr_undo_cwnd, ++ .cwnd_event = bbr_cwnd_event, ++ .ssthresh = bbr_ssthresh, ++ .min_tso_segs = bbr_min_tso_segs, ++ .get_info = bbr_get_info, ++ .set_state = bbr_set_state, ++}; ++ ++static int __init bbr_register(void) ++{ ++ BUILD_BUG_ON(sizeof(struct bbr) > ICSK_CA_PRIV_SIZE); ++ return tcp_register_congestion_control(&tcp_bbr_cong_ops); ++} ++ ++static void __exit bbr_unregister(void) ++{ ++ tcp_unregister_congestion_control(&tcp_bbr_cong_ops); ++} ++ ++module_init(bbr_register); ++module_exit(bbr_unregister); ++ ++MODULE_AUTHOR("Van Jacobson "); ++MODULE_AUTHOR("Neal Cardwell "); ++MODULE_AUTHOR("Yuchung Cheng "); ++MODULE_AUTHOR("Soheil Hassas Yeganeh "); ++MODULE_LICENSE("Dual BSD/GPL"); ++MODULE_DESCRIPTION("TCP BBR (Bottleneck Bandwidth and RTT)"); ++MODULE_AUTHOR("Nanqinlang ");