From ec82b6fcb95bf50e851e13cf729ed802be2a3146 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 19 Jun 2024 11:54:45 +0200 Subject: [PATCH] 6.1-stable patches added patches: mptcp-pm-update-add_addr-counters-after-connect.patch serial-8250_pxa-configure-tx_loadsz-to-match-fifo-irq-level.patch --- ...date-add_addr-counters-after-connect.patch | 105 ++++++++++++++++++ ...re-tx_loadsz-to-match-fifo-irq-level.patch | 35 ++++++ queue-6.1/series | 2 + 3 files changed, 142 insertions(+) create mode 100644 queue-6.1/mptcp-pm-update-add_addr-counters-after-connect.patch create mode 100644 queue-6.1/serial-8250_pxa-configure-tx_loadsz-to-match-fifo-irq-level.patch diff --git a/queue-6.1/mptcp-pm-update-add_addr-counters-after-connect.patch b/queue-6.1/mptcp-pm-update-add_addr-counters-after-connect.patch new file mode 100644 index 00000000000..8fd5e603c85 --- /dev/null +++ b/queue-6.1/mptcp-pm-update-add_addr-counters-after-connect.patch @@ -0,0 +1,105 @@ +From 40eec1795cc27b076d49236649a29507c7ed8c2d Mon Sep 17 00:00:00 2001 +From: YonglongLi +Date: Fri, 7 Jun 2024 17:01:50 +0200 +Subject: mptcp: pm: update add_addr counters after connect + +From: YonglongLi + +commit 40eec1795cc27b076d49236649a29507c7ed8c2d upstream. + +The creation of new subflows can fail for different reasons. If no +subflow have been created using the received ADD_ADDR, the related +counters should not be updated, otherwise they will never be decremented +for events related to this ID later on. + +For the moment, the number of accepted ADD_ADDR is only decremented upon +the reception of a related RM_ADDR, and only if the remote address ID is +currently being used by at least one subflow. In other words, if no +subflow can be created with the received address, the counter will not +be decremented. In this case, it is then important not to increment +pm.add_addr_accepted counter, and not to modify pm.accept_addr bit. + +Note that this patch does not modify the behaviour in case of failures +later on, e.g. if the MP Join is dropped or rejected. + +The "remove invalid addresses" MP Join subtest has been modified to +validate this case. The broadcast IP address is added before the "valid" +address that will be used to successfully create a subflow, and the +limit is decreased by one: without this patch, it was not possible to +create the last subflow, because: + +- the broadcast address would have been accepted even if it was not + usable: the creation of a subflow to this address results in an error, + +- the limit of 2 accepted ADD_ADDR would have then been reached. + +Fixes: 01cacb00b35c ("mptcp: add netlink-based PM") +Cc: stable@vger.kernel.org +Co-developed-by: Matthieu Baerts (NGI0) +Signed-off-by: Matthieu Baerts (NGI0) +Signed-off-by: YonglongLi +Reviewed-by: Mat Martineau +Signed-off-by: Matthieu Baerts (NGI0) +Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-3-1ab9ddfa3d00@kernel.org +Signed-off-by: Jakub Kicinski +[ Conflicts in the selftests, in the same context, because the next line + with 'run_tests' has been updated later by a few commits like commit + e571fb09c893 ("selftests: mptcp: add speed env var"). We don't need to + touch this line, nor to backport the long refactoring series. ] +Signed-off-by: Matthieu Baerts (NGI0) +Signed-off-by: Greg Kroah-Hartman +--- + net/mptcp/pm_netlink.c | 16 ++++++++++------ + tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 ++-- + 2 files changed, 12 insertions(+), 8 deletions(-) + +--- a/net/mptcp/pm_netlink.c ++++ b/net/mptcp/pm_netlink.c +@@ -685,6 +685,7 @@ static void mptcp_pm_nl_add_addr_receive + unsigned int add_addr_accept_max; + struct mptcp_addr_info remote; + unsigned int subflows_max; ++ bool sf_created = false; + int i, nr; + + add_addr_accept_max = mptcp_pm_get_add_addr_accept_max(msk); +@@ -710,15 +711,18 @@ static void mptcp_pm_nl_add_addr_receive + */ + nr = fill_local_addresses_vec(msk, addrs); + +- msk->pm.add_addr_accepted++; +- if (msk->pm.add_addr_accepted >= add_addr_accept_max || +- msk->pm.subflows >= subflows_max) +- WRITE_ONCE(msk->pm.accept_addr, false); +- + spin_unlock_bh(&msk->pm.lock); + for (i = 0; i < nr; i++) +- __mptcp_subflow_connect(sk, &addrs[i], &remote); ++ if (__mptcp_subflow_connect(sk, &addrs[i], &remote) == 0) ++ sf_created = true; + spin_lock_bh(&msk->pm.lock); ++ ++ if (sf_created) { ++ msk->pm.add_addr_accepted++; ++ if (msk->pm.add_addr_accepted >= add_addr_accept_max || ++ msk->pm.subflows >= subflows_max) ++ WRITE_ONCE(msk->pm.accept_addr, false); ++ } + } + + void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk) +--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh ++++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh +@@ -2343,10 +2343,10 @@ remove_tests() + if reset "remove invalid addresses"; then + pm_nl_set_limits $ns1 3 3 + pm_nl_add_endpoint $ns1 10.0.12.1 flags signal +- pm_nl_add_endpoint $ns1 10.0.3.1 flags signal + # broadcast IP: no packet for this address will be received on ns1 + pm_nl_add_endpoint $ns1 224.0.0.1 flags signal +- pm_nl_set_limits $ns2 3 3 ++ pm_nl_add_endpoint $ns1 10.0.3.1 flags signal ++ pm_nl_set_limits $ns2 2 2 + run_tests $ns1 $ns2 10.0.1.1 0 -3 0 speed_10 + chk_join_nr 1 1 1 + chk_add_nr 3 3 diff --git a/queue-6.1/serial-8250_pxa-configure-tx_loadsz-to-match-fifo-irq-level.patch b/queue-6.1/serial-8250_pxa-configure-tx_loadsz-to-match-fifo-irq-level.patch new file mode 100644 index 00000000000..f1d87a26e2d --- /dev/null +++ b/queue-6.1/serial-8250_pxa-configure-tx_loadsz-to-match-fifo-irq-level.patch @@ -0,0 +1,35 @@ +From 5208e7ced520a813b4f4774451fbac4e517e78b2 Mon Sep 17 00:00:00 2001 +From: Doug Brown +Date: Sun, 19 May 2024 12:19:30 -0700 +Subject: serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level + +From: Doug Brown + +commit 5208e7ced520a813b4f4774451fbac4e517e78b2 upstream. + +The FIFO is 64 bytes, but the FCR is configured to fire the TX interrupt +when the FIFO is half empty (bit 3 = 0). Thus, we should only write 32 +bytes when a TX interrupt occurs. + +This fixes a problem observed on the PXA168 that dropped a bunch of TX +bytes during large transmissions. + +Fixes: ab28f51c77cd ("serial: rewrite pxa2xx-uart to use 8250_core") +Signed-off-by: Doug Brown +Link: https://lore.kernel.org/r/20240519191929.122202-1-doug@schmorgal.com +Cc: stable +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_pxa.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/tty/serial/8250/8250_pxa.c ++++ b/drivers/tty/serial/8250/8250_pxa.c +@@ -124,6 +124,7 @@ static int serial_pxa_probe(struct platf + uart.port.regshift = 2; + uart.port.irq = irq; + uart.port.fifosize = 64; ++ uart.tx_loadsz = 32; + uart.port.flags = UPF_IOREMAP | UPF_SKIP_TEST | UPF_FIXED_TYPE; + uart.port.dev = &pdev->dev; + uart.port.uartclk = clk_get_rate(data->clk); diff --git a/queue-6.1/series b/queue-6.1/series index a24a79a8834..e4aa0afd642 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -205,3 +205,5 @@ nilfs2-fix-potential-kernel-bug-due-to-lack-of-writeback-flag-waiting.patch tick-nohz_full-don-t-abuse-smp_call_function_single-in-tick_setup_device.patch mm-huge_memory-don-t-unpoison-huge_zero_folio.patch mm-memory-failure-fix-handling-of-dissolved-but-not-taken-off-from-buddy-pages.patch +serial-8250_pxa-configure-tx_loadsz-to-match-fifo-irq-level.patch +mptcp-pm-update-add_addr-counters-after-connect.patch -- 2.47.3