]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Mon, 29 Nov 2021 00:41:02 +0000 (19:41 -0500)
committerSasha Levin <sashal@kernel.org>
Mon, 29 Nov 2021 00:41:02 +0000 (19:41 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/arm-dts-bcm5301x-add-interrupt-properties-to-gpio-no.patch [new file with mode: 0644]
queue-4.9/arm-socfpga-fix-crash-with-config_fortiry_source.patch [new file with mode: 0644]
queue-4.9/asoc-topology-add-missing-rwsem-around-snd_ctl_remov.patch [new file with mode: 0644]
queue-4.9/drm-vc4-fix-error-code-in-vc4_create_object.patch [new file with mode: 0644]
queue-4.9/net-ieee802154-handle-iftypes-as-u32.patch [new file with mode: 0644]
queue-4.9/nfsv42-don-t-fail-clone-unless-the-op_clone-operatio.patch [new file with mode: 0644]
queue-4.9/pm-hibernate-use-correct-mode-for-swsusp_close.patch [new file with mode: 0644]
queue-4.9/scsi-mpt3sas-fix-kernel-panic-during-drive-powercycl.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/tcp_cubic-fix-spurious-hystart-ack-train-detections-.patch [new file with mode: 0644]

diff --git a/queue-4.9/arm-dts-bcm5301x-add-interrupt-properties-to-gpio-no.patch b/queue-4.9/arm-dts-bcm5301x-add-interrupt-properties-to-gpio-no.patch
new file mode 100644 (file)
index 0000000..d6f8bb6
--- /dev/null
@@ -0,0 +1,36 @@
+From b5d740793d0081d3e185ef3b5d4467e9c5fa8188 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 28 Oct 2021 09:46:53 -0700
+Subject: ARM: dts: BCM5301X: Add interrupt properties to GPIO node
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+[ Upstream commit 40f7342f0587639e5ad625adaa15efdd3cffb18f ]
+
+The GPIO controller is also an interrupt controller provider and is
+currently missing the appropriate 'interrupt-controller' and
+'#interrupt-cells' properties to denote that.
+
+Fixes: fb026d3de33b ("ARM: BCM5301X: Add Broadcom's bus-axi to the DTS file")
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/boot/dts/bcm5301x.dtsi | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
+index 4616452ce74de..e0f96be549f14 100644
+--- a/arch/arm/boot/dts/bcm5301x.dtsi
++++ b/arch/arm/boot/dts/bcm5301x.dtsi
+@@ -234,6 +234,8 @@ chipcommon: chipcommon@0 {
+                       gpio-controller;
+                       #gpio-cells = <2>;
++                      interrupt-controller;
++                      #interrupt-cells = <2>;
+               };
+               usb2: usb2@21000 {
+-- 
+2.33.0
+
diff --git a/queue-4.9/arm-socfpga-fix-crash-with-config_fortiry_source.patch b/queue-4.9/arm-socfpga-fix-crash-with-config_fortiry_source.patch
new file mode 100644 (file)
index 0000000..f362bb3
--- /dev/null
@@ -0,0 +1,81 @@
+From f65e412e13ffc855965f1a30e437904273b8bb78 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 18 Nov 2021 15:25:08 +0100
+Subject: ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 187bea472600dcc8d2eb714335053264dd437172 ]
+
+When CONFIG_FORTIFY_SOURCE is set, memcpy() checks the potential
+buffer overflow and panics.  The code in sofcpga bootstrapping
+contains the memcpy() calls are mistakenly translated as the shorter
+size, hence it triggers a panic as if it were overflowing.
+
+This patch changes the secondary_trampoline and *_end definitions
+to arrays for avoiding the false-positive crash above.
+
+Fixes: 9c4566a117a6 ("ARM: socfpga: Enable SMP for socfpga")
+Suggested-by: Kees Cook <keescook@chromium.org>
+Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1192473
+Link: https://lore.kernel.org/r/20211117193244.31162-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/mach-socfpga/core.h    | 2 +-
+ arch/arm/mach-socfpga/platsmp.c | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm/mach-socfpga/core.h b/arch/arm/mach-socfpga/core.h
+index 65e1817d8afe6..692a287a8712d 100644
+--- a/arch/arm/mach-socfpga/core.h
++++ b/arch/arm/mach-socfpga/core.h
+@@ -48,7 +48,7 @@ extern void __iomem *sdr_ctl_base_addr;
+ u32 socfpga_sdram_self_refresh(u32 sdr_base);
+ extern unsigned int socfpga_sdram_self_refresh_sz;
+-extern char secondary_trampoline, secondary_trampoline_end;
++extern char secondary_trampoline[], secondary_trampoline_end[];
+ extern unsigned long socfpga_cpu1start_addr;
+diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
+index 07945748b5714..1dfc9e7389a74 100644
+--- a/arch/arm/mach-socfpga/platsmp.c
++++ b/arch/arm/mach-socfpga/platsmp.c
+@@ -31,14 +31,14 @@
+ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
+ {
+-      int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
++      int trampoline_size = secondary_trampoline_end - secondary_trampoline;
+       if (socfpga_cpu1start_addr) {
+               /* This will put CPU #1 into reset. */
+               writel(RSTMGR_MPUMODRST_CPU1,
+                      rst_manager_base_addr + SOCFPGA_RSTMGR_MODMPURST);
+-              memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
++              memcpy(phys_to_virt(0), secondary_trampoline, trampoline_size);
+               writel(virt_to_phys(secondary_startup),
+                      sys_manager_base_addr + (socfpga_cpu1start_addr & 0x000000ff));
+@@ -56,12 +56,12 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
+ static int socfpga_a10_boot_secondary(unsigned int cpu, struct task_struct *idle)
+ {
+-      int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
++      int trampoline_size = secondary_trampoline_end - secondary_trampoline;
+       if (socfpga_cpu1start_addr) {
+               writel(RSTMGR_MPUMODRST_CPU1, rst_manager_base_addr +
+                      SOCFPGA_A10_RSTMGR_MODMPURST);
+-              memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
++              memcpy(phys_to_virt(0), secondary_trampoline, trampoline_size);
+               writel(virt_to_phys(secondary_startup),
+                      sys_manager_base_addr + (socfpga_cpu1start_addr & 0x00000fff));
+-- 
+2.33.0
+
diff --git a/queue-4.9/asoc-topology-add-missing-rwsem-around-snd_ctl_remov.patch b/queue-4.9/asoc-topology-add-missing-rwsem-around-snd_ctl_remov.patch
new file mode 100644 (file)
index 0000000..ff42fae
--- /dev/null
@@ -0,0 +1,53 @@
+From 564d71d2f0c1a501d452baaf9e572e2c4696bc16 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 16 Nov 2021 08:18:12 +0100
+Subject: ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ Upstream commit 7e567b5ae06315ef2d70666b149962e2bb4b97af ]
+
+snd_ctl_remove() has to be called with card->controls_rwsem held (when
+called after the card instantiation).  This patch add the missing
+rwsem calls around it.
+
+Fixes: 8a9782346dcc ("ASoC: topology: Add topology core")
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Link: https://lore.kernel.org/r/20211116071812.18109-1-tiwai@suse.de
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/soc-topology.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
+index e9c57bd3c02bf..6274a50026473 100644
+--- a/sound/soc/soc-topology.c
++++ b/sound/soc/soc-topology.c
+@@ -2050,6 +2050,7 @@ EXPORT_SYMBOL_GPL(snd_soc_tplg_widget_remove_all);
+ /* remove dynamic controls from the component driver */
+ int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
+ {
++      struct snd_card *card = comp->card->snd_card;
+       struct snd_soc_dobj *dobj, *next_dobj;
+       int pass = SOC_TPLG_PASS_END;
+@@ -2057,6 +2058,7 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
+       while (pass >= SOC_TPLG_PASS_START) {
+               /* remove mixer controls */
++              down_write(&card->controls_rwsem);
+               list_for_each_entry_safe(dobj, next_dobj, &comp->dobj_list,
+                       list) {
+@@ -2090,6 +2092,7 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
+                               break;
+                       }
+               }
++              up_write(&card->controls_rwsem);
+               pass--;
+       }
+-- 
+2.33.0
+
diff --git a/queue-4.9/drm-vc4-fix-error-code-in-vc4_create_object.patch b/queue-4.9/drm-vc4-fix-error-code-in-vc4_create_object.patch
new file mode 100644 (file)
index 0000000..ee84295
--- /dev/null
@@ -0,0 +1,38 @@
+From eec345e3779d41b7b467588a8046ad9a8bca761e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 18 Nov 2021 14:14:16 +0300
+Subject: drm/vc4: fix error code in vc4_create_object()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+[ Upstream commit 96c5f82ef0a145d3e56e5b26f2bf6dcd2ffeae1c ]
+
+The ->gem_create_object() functions are supposed to return NULL if there
+is an error.  None of the callers expect error pointers so returing one
+will lead to an Oops.  See drm_gem_vram_create(), for example.
+
+Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Link: https://patchwork.freedesktop.org/patch/msgid/20211118111416.GC1147@kili
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/vc4/vc4_bo.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
+index d53e805d392f9..64fc99cf54d5b 100644
+--- a/drivers/gpu/drm/vc4/vc4_bo.c
++++ b/drivers/gpu/drm/vc4/vc4_bo.c
+@@ -198,7 +198,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size)
+       bo = kzalloc(sizeof(*bo), GFP_KERNEL);
+       if (!bo)
+-              return ERR_PTR(-ENOMEM);
++              return NULL;
+       mutex_lock(&vc4->bo_lock);
+       vc4->bo_stats.num_allocated++;
+-- 
+2.33.0
+
diff --git a/queue-4.9/net-ieee802154-handle-iftypes-as-u32.patch b/queue-4.9/net-ieee802154-handle-iftypes-as-u32.patch
new file mode 100644 (file)
index 0000000..6ba1fea
--- /dev/null
@@ -0,0 +1,56 @@
+From 384e4d53504ba5341fbdf54fa63bf18c324e68ab Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 11 Nov 2021 22:09:16 -0500
+Subject: net: ieee802154: handle iftypes as u32
+
+From: Alexander Aring <aahringo@redhat.com>
+
+[ Upstream commit 451dc48c806a7ce9fbec5e7a24ccf4b2c936e834 ]
+
+This patch fixes an issue that an u32 netlink value is handled as a
+signed enum value which doesn't fit into the range of u32 netlink type.
+If it's handled as -1 value some BIT() evaluation ends in a
+shift-out-of-bounds issue. To solve the issue we set the to u32 max which
+is s32 "-1" value to keep backwards compatibility and let the followed enum
+values start counting at 0. This brings the compiler to never handle the
+enum as signed and a check if the value is above NL802154_IFTYPE_MAX should
+filter -1 out.
+
+Fixes: f3ea5e44231a ("ieee802154: add new interface command")
+Signed-off-by: Alexander Aring <aahringo@redhat.com>
+Link: https://lore.kernel.org/r/20211112030916.685793-1-aahringo@redhat.com
+Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/net/nl802154.h | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/include/net/nl802154.h b/include/net/nl802154.h
+index ddcee128f5d9a..145acb8f25095 100644
+--- a/include/net/nl802154.h
++++ b/include/net/nl802154.h
+@@ -19,6 +19,8 @@
+  *
+  */
++#include <linux/types.h>
++
+ #define NL802154_GENL_NAME "nl802154"
+ enum nl802154_commands {
+@@ -150,10 +152,9 @@ enum nl802154_attrs {
+ };
+ enum nl802154_iftype {
+-      /* for backwards compatibility TODO */
+-      NL802154_IFTYPE_UNSPEC = -1,
++      NL802154_IFTYPE_UNSPEC = (~(__u32)0),
+-      NL802154_IFTYPE_NODE,
++      NL802154_IFTYPE_NODE = 0,
+       NL802154_IFTYPE_MONITOR,
+       NL802154_IFTYPE_COORD,
+-- 
+2.33.0
+
diff --git a/queue-4.9/nfsv42-don-t-fail-clone-unless-the-op_clone-operatio.patch b/queue-4.9/nfsv42-don-t-fail-clone-unless-the-op_clone-operatio.patch
new file mode 100644 (file)
index 0000000..50ea4df
--- /dev/null
@@ -0,0 +1,38 @@
+From abf8a2bc5e10e37c80550bf1af7fd96cfb7dcf17 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 16 Nov 2021 09:55:01 -0500
+Subject: NFSv42: Don't fail clone() unless the OP_CLONE operation failed
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+[ Upstream commit d3c45824ad65aebf765fcf51366d317a29538820 ]
+
+The failure to retrieve post-op attributes has no bearing on whether or
+not the clone operation itself was successful. We must therefore ignore
+the return value of decode_getfattr() when looking at the success or
+failure of nfs4_xdr_dec_clone().
+
+Fixes: 36022770de6c ("nfs42: add CLONE xdr functions")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfs/nfs42xdr.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c
+index 8b2605882a201..335c34f0d1303 100644
+--- a/fs/nfs/nfs42xdr.c
++++ b/fs/nfs/nfs42xdr.c
+@@ -593,8 +593,7 @@ static int nfs4_xdr_dec_clone(struct rpc_rqst *rqstp,
+       status = decode_clone(xdr);
+       if (status)
+               goto out;
+-      status = decode_getfattr(xdr, res->dst_fattr, res->server);
+-
++      decode_getfattr(xdr, res->dst_fattr, res->server);
+ out:
+       res->rpc_status = status;
+       return status;
+-- 
+2.33.0
+
diff --git a/queue-4.9/pm-hibernate-use-correct-mode-for-swsusp_close.patch b/queue-4.9/pm-hibernate-use-correct-mode-for-swsusp_close.patch
new file mode 100644 (file)
index 0000000..af040e4
--- /dev/null
@@ -0,0 +1,62 @@
+From 328c7c48d19bd61465d5f64ddb1780a34fe2a5d8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 23 Nov 2021 20:18:43 +0100
+Subject: PM: hibernate: use correct mode for swsusp_close()
+
+From: Thomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
+
+[ Upstream commit cefcf24b4d351daf70ecd945324e200d3736821e ]
+
+Commit 39fbef4b0f77 ("PM: hibernate: Get block device exclusively in
+swsusp_check()") changed the opening mode of the block device to
+(FMODE_READ | FMODE_EXCL).
+
+In the corresponding calls to swsusp_close(), the mode is still just
+FMODE_READ which triggers the warning in blkdev_flush_mapping() on
+resume from hibernate.
+
+So, use the mode (FMODE_READ | FMODE_EXCL) also when closing the
+device.
+
+Fixes: 39fbef4b0f77 ("PM: hibernate: Get block device exclusively in swsusp_check()")
+Signed-off-by: Thomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/power/hibernate.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
+index 7b393faf930f8..e938fd8db056b 100644
+--- a/kernel/power/hibernate.c
++++ b/kernel/power/hibernate.c
+@@ -672,7 +672,7 @@ static int load_image_and_restore(void)
+               goto Unlock;
+       error = swsusp_read(&flags);
+-      swsusp_close(FMODE_READ);
++      swsusp_close(FMODE_READ | FMODE_EXCL);
+       if (!error)
+               hibernation_restore(flags & SF_PLATFORM_MODE);
+@@ -866,7 +866,7 @@ static int software_resume(void)
+       /* The snapshot device should not be opened while we're running */
+       if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
+               error = -EBUSY;
+-              swsusp_close(FMODE_READ);
++              swsusp_close(FMODE_READ | FMODE_EXCL);
+               goto Unlock;
+       }
+@@ -900,7 +900,7 @@ static int software_resume(void)
+       pr_debug("PM: Hibernation image not present or could not be loaded.\n");
+       return error;
+  Close_Finish:
+-      swsusp_close(FMODE_READ);
++      swsusp_close(FMODE_READ | FMODE_EXCL);
+       goto Finish;
+ }
+-- 
+2.33.0
+
diff --git a/queue-4.9/scsi-mpt3sas-fix-kernel-panic-during-drive-powercycl.patch b/queue-4.9/scsi-mpt3sas-fix-kernel-panic-during-drive-powercycl.patch
new file mode 100644 (file)
index 0000000..9cf6c43
--- /dev/null
@@ -0,0 +1,42 @@
+From 8656e3671e509e30ccd716b3efd3af448e568358 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 Nov 2021 16:19:09 +0530
+Subject: scsi: mpt3sas: Fix kernel panic during drive powercycle test
+
+From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
+
+[ Upstream commit 0ee4ba13e09c9d9c1cb6abb59da8295d9952328b ]
+
+While looping over shost's sdev list it is possible that one
+of the drives is getting removed and its sas_target object is
+freed but its sdev object remains intact.
+
+Consequently, a kernel panic can occur while the driver is trying to access
+the sas_address field of sas_target object without also checking the
+sas_target object for NULL.
+
+Link: https://lore.kernel.org/r/20211117104909.2069-1-sreekanth.reddy@broadcom.com
+Fixes: f92363d12359 ("[SCSI] mpt3sas: add new driver supporting 12GB SAS")
+Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+index 58876b8a2e9f8..8063b97bf2e9b 100644
+--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+@@ -2927,7 +2927,7 @@ _scsih_ublock_io_device(struct MPT3SAS_ADAPTER *ioc, u64 sas_address)
+       shost_for_each_device(sdev, ioc->shost) {
+               sas_device_priv_data = sdev->hostdata;
+-              if (!sas_device_priv_data)
++              if (!sas_device_priv_data || !sas_device_priv_data->sas_target)
+                       continue;
+               if (sas_device_priv_data->sas_target->sas_address
+                   != sas_address)
+-- 
+2.33.0
+
index 0e0c1157c87bbe54a2cbc48b4a611364fdc8bc67..4bcebd64968f19da1e611ea5be6d2bd72b927299 100644 (file)
@@ -10,3 +10,12 @@ fuse-fix-page-stealing.patch
 xen-don-t-continue-xenstore-initialization-in-case-of-errors.patch
 xen-detect-uninitialized-xenbus-in-xenbus_init.patch
 tracing-fix-pid-filtering-when-triggers-are-attached.patch
+arm-dts-bcm5301x-add-interrupt-properties-to-gpio-no.patch
+asoc-topology-add-missing-rwsem-around-snd_ctl_remov.patch
+net-ieee802154-handle-iftypes-as-u32.patch
+nfsv42-don-t-fail-clone-unless-the-op_clone-operatio.patch
+arm-socfpga-fix-crash-with-config_fortiry_source.patch
+scsi-mpt3sas-fix-kernel-panic-during-drive-powercycl.patch
+drm-vc4-fix-error-code-in-vc4_create_object.patch
+pm-hibernate-use-correct-mode-for-swsusp_close.patch
+tcp_cubic-fix-spurious-hystart-ack-train-detections-.patch
diff --git a/queue-4.9/tcp_cubic-fix-spurious-hystart-ack-train-detections-.patch b/queue-4.9/tcp_cubic-fix-spurious-hystart-ack-train-detections-.patch
new file mode 100644 (file)
index 0000000..b5a8901
--- /dev/null
@@ -0,0 +1,88 @@
+From 814266fe654ceb755c2c6d97bb45bd491213b544 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 23 Nov 2021 12:25:35 -0800
+Subject: tcp_cubic: fix spurious Hystart ACK train detections for
+ not-cwnd-limited flows
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 4e1fddc98d2585ddd4792b5e44433dcee7ece001 ]
+
+While testing BIG TCP patch series, I was expecting that TCP_RR workloads
+with 80KB requests/answers would send one 80KB TSO packet,
+then being received as a single GRO packet.
+
+It turns out this was not happening, and the root cause was that
+cubic Hystart ACK train was triggering after a few (2 or 3) rounds of RPC.
+
+Hystart was wrongly setting CWND/SSTHRESH to 30, while my RPC
+needed a budget of ~20 segments.
+
+Ideally these TCP_RR flows should not exit slow start.
+
+Cubic Hystart should reset itself at each round, instead of assuming
+every TCP flow is a bulk one.
+
+Note that even after this patch, Hystart can still trigger, depending
+on scheduling artifacts, but at a higher CWND/SSTHRESH threshold,
+keeping optimal TSO packet sizes.
+
+Tested:
+
+ip link set dev eth0 gro_ipv6_max_size 131072 gso_ipv6_max_size 131072
+nstat -n; netperf -H ... -t TCP_RR  -l 5  -- -r 80000,80000 -K cubic; nstat|egrep "Ip6InReceives|Hystart|Ip6OutRequests"
+
+Before:
+
+   8605
+Ip6InReceives                   87541              0.0
+Ip6OutRequests                  129496             0.0
+TcpExtTCPHystartTrainDetect     1                  0.0
+TcpExtTCPHystartTrainCwnd       30                 0.0
+
+After:
+
+  8760
+Ip6InReceives                   88514              0.0
+Ip6OutRequests                  87975              0.0
+
+Fixes: ae27e98a5152 ("[TCP] CUBIC v2.3")
+Co-developed-by: Neal Cardwell <ncardwell@google.com>
+Signed-off-by: Neal Cardwell <ncardwell@google.com>
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: Stephen Hemminger <stephen@networkplumber.org>
+Cc: Yuchung Cheng <ycheng@google.com>
+Cc: Soheil Hassas Yeganeh <soheil@google.com>
+Link: https://lore.kernel.org/r/20211123202535.1843771-1-eric.dumazet@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/ipv4/tcp_cubic.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
+index 00397c6add202..d710c519a0357 100644
+--- a/net/ipv4/tcp_cubic.c
++++ b/net/ipv4/tcp_cubic.c
+@@ -342,8 +342,6 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
+               return;
+       if (tcp_in_slow_start(tp)) {
+-              if (hystart && after(ack, ca->end_seq))
+-                      bictcp_hystart_reset(sk);
+               acked = tcp_slow_start(tp, acked);
+               if (!acked)
+                       return;
+@@ -394,6 +392,9 @@ static void hystart_update(struct sock *sk, u32 delay)
+       if (ca->found & hystart_detect)
+               return;
++      if (after(tp->snd_una, ca->end_seq))
++              bictcp_hystart_reset(sk);
++
+       if (hystart_detect & HYSTART_ACK_TRAIN) {
+               u32 now = bictcp_clock();
+-- 
+2.33.0
+