From a671036a7ea3de8986b1d1bd5102e29501b633ce Mon Sep 17 00:00:00 2001 From: Kernel Build Daemon Date: Mar 02 2023 06:17:09 +0000 Subject: Merge branch 'SLE12-SP5' into SLE12-SP5-AZURE --- diff --git a/patches.suse/af_unix-fix-races-in-sk_peer_pid-and-sk_peer_cred-ac.patch b/patches.suse/af_unix-fix-races-in-sk_peer_pid-and-sk_peer_cred-ac.patch index b2efb83..638c5f4 100644 --- a/patches.suse/af_unix-fix-races-in-sk_peer_pid-and-sk_peer_cred-ac.patch +++ b/patches.suse/af_unix-fix-races-in-sk_peer_pid-and-sk_peer_cred-ac.patch @@ -52,23 +52,6 @@ diff --git a/net/core/sock.c b/net/core/sock.c index 2ca13103c749..9dbca0c72593 100644 --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -1064,6 +1064,16 @@ int sock_setsockopt(struct socket *sock, int level, int optname, - } - EXPORT_SYMBOL(sock_setsockopt); - -+static const struct cred *sk_get_peer_cred(struct sock *sk) -+{ -+ const struct cred *cred; -+ -+ spin_lock(&sk->sk_peer_lock); -+ cred = get_cred(sk->sk_peer_cred); -+ spin_unlock(&sk->sk_peer_lock); -+ -+ return cred; -+} - - static void cred_to_ucred(struct pid *pid, const struct cred *cred, - struct ucred *ucred) @@ -1225,7 +1235,11 @@ int sock_getsockopt(struct socket *sock, int level, int optname, struct ucred peercred; if (len > sizeof(peercred)) diff --git a/patches.suse/net-bmac-Fix-read-of-MAC-address-from-ROM.patch b/patches.suse/net-bmac-Fix-read-of-MAC-address-from-ROM.patch new file mode 100644 index 0000000..325e575 --- /dev/null +++ b/patches.suse/net-bmac-Fix-read-of-MAC-address-from-ROM.patch @@ -0,0 +1,42 @@ +From e676963003245bbe19f8feb4ea37dd0e7c1b1101 Mon Sep 17 00:00:00 2001 +From: Jeremy Kerr +Date: Tue, 19 May 2020 09:05:58 +0800 +Subject: [PATCH] net: bmac: Fix read of MAC address from ROM +Git-commit: ef01cee2ee1b369c57a936166483d40942bcc3e3 +Patch-mainline: v5.7-rc7 +References: git-fixes + +In bmac_get_station_address, We're reading two bytes at a time from ROM, +but we do that six times, resulting in 12 bytes of read & writes. This +means we will write off the end of the six-byte destination buffer. + +This change fixes the for-loop to only read/write six bytes. + +Based on a proposed fix from Finn Thain . + +Signed-off-by: Jeremy Kerr +Reported-by: Stan Johnson +Tested-by: Stan Johnson +Reported-by: Finn Thain +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/apple/bmac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/apple/bmac.c b/drivers/net/ethernet/apple/bmac.c +index 2b2d87089987..699a8c35d3fd 100644 +--- a/drivers/net/ethernet/apple/bmac.c ++++ b/drivers/net/ethernet/apple/bmac.c +@@ -1187,7 +1187,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea) + int i; + unsigned short data; + +- for (i = 0; i < 6; i++) ++ for (i = 0; i < 3; i++) + { + reset_and_select_srom(dev); + data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits); +-- +2.16.4 + diff --git a/patches.suse/net-ethernet-freescale-rework-quiesce-activate-for-u.patch b/patches.suse/net-ethernet-freescale-rework-quiesce-activate-for-u.patch new file mode 100644 index 0000000..e0b15bb --- /dev/null +++ b/patches.suse/net-ethernet-freescale-rework-quiesce-activate-for-u.patch @@ -0,0 +1,77 @@ +From a172507090f97b255ac1f6bdad2712f133dfedee Mon Sep 17 00:00:00 2001 +From: Valentin Longchamp +Date: Wed, 20 May 2020 17:53:50 +0200 +Subject: [PATCH] net/ethernet/freescale: rework quiesce/activate for ucc_geth +Git-commit: 79dde73cf9bcf1dd317a2667f78b758e9fe139ed +Patch-mainline: v5.7-rc7 +References: git-fixes + +ugeth_quiesce/activate are used to halt the controller when there is a +link change that requires to reconfigure the mac. + +The previous implementation called netif_device_detach(). This however +causes the initial activation of the netdevice to fail precisely because +it's detached. For details, see [1]. + +A possible workaround was the revert of commit +net: linkwatch: add check for netdevice being present to linkwatch_do_dev +However, the check introduced in the above commit is correct and shall be +kept. + +The netif_device_detach() is thus replaced with +netif_tx_stop_all_queues() that prevents any tranmission. This allows to +perform mac config change required by the link change, without detaching +the corresponding netdevice and thus not preventing its initial +activation. + +[1] https://lists.openwall.net/netdev/2020/01/08/201 + +Signed-off-by: Valentin Longchamp +Acked-by: Matteo Ghidoni +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/freescale/ucc_geth.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c +index 168720d5b476..c3781334ada2 100644 +--- a/drivers/net/ethernet/freescale/ucc_geth.c ++++ b/drivers/net/ethernet/freescale/ucc_geth.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #include "ucc_geth.h" + +@@ -1551,11 +1552,8 @@ static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode) + + static void ugeth_quiesce(struct ucc_geth_private *ugeth) + { +- /* Prevent any further xmits, plus detach the device. */ +- netif_device_detach(ugeth->ndev); +- +- /* Wait for any current xmits to finish. */ +- netif_tx_disable(ugeth->ndev); ++ /* Prevent any further xmits */ ++ netif_tx_stop_all_queues(ugeth->ndev); + + /* Disable the interrupt to avoid NAPI rescheduling. */ + disable_irq(ugeth->ug_info->uf_info.irq); +@@ -1568,7 +1566,10 @@ static void ugeth_activate(struct ucc_geth_private *ugeth) + { + napi_enable(&ugeth->napi); + enable_irq(ugeth->ug_info->uf_info.irq); +- netif_device_attach(ugeth->ndev); ++ ++ /* allow to xmit again */ ++ netif_tx_wake_all_queues(ugeth->ndev); ++ __netdev_watchdog_up(ugeth->ndev); + } + + /* Called every time the controller might need to be made +-- +2.16.4 + diff --git a/patches.suse/net-qed-Reduce-RX-and-TX-default-ring-count-when-run.patch b/patches.suse/net-qed-Reduce-RX-and-TX-default-ring-count-when-run.patch new file mode 100644 index 0000000..8a9bf76 --- /dev/null +++ b/patches.suse/net-qed-Reduce-RX-and-TX-default-ring-count-when-run.patch @@ -0,0 +1,144 @@ +From 4cd1a0d26272d69f74e6b3e859514b2b5d601883 Mon Sep 17 00:00:00 2001 +From: Bhupesh Sharma +Date: Mon, 11 May 2020 15:41:41 +0530 +Subject: [PATCH] net: qed*: Reduce RX and TX default ring count when running + inside kdump kernel +Git-commit: 73e030977f7884dbe1be0018bab517e8d02760f8 +Patch-mainline: v5.8-rc1 +References: git-fixes + +Normally kdump kernel(s) run under severe memory constraint with the +basic idea being to save the crashdump vmcore reliably when the primary +kernel panics/hangs. + +Currently the qed* ethernet driver ends up consuming a lot of memory in +the kdump kernel, leading to kdump kernel panic when one tries to save +the vmcore via ssh/nfs (thus utilizing the services of the underlying +qed* network interfaces). + +An example OOM message log seen in the kdump kernel can be seen here +[1], with crashkernel size reservation of 512M. + +Using tools like memstrack (see [2]), we can track the modules taking up +the bulk of memory in the kdump kernel and organize the memory usage +output as per 'highest allocator first'. An example log for the OOM case +indicates that the qed* modules end up allocating approximately 216M +memory, which is a large part of the total crashkernel size: + + dracut-pre-pivot[676]: ======== Report format module_summary: ======== + dracut-pre-pivot[676]: Module qed using 149.6MB (2394 pages), peak allocation 149.6MB (2394 pages) + dracut-pre-pivot[676]: Module qede using 65.3MB (1045 pages), peak allocation 65.3MB (1045 pages) + +This patch reduces the default RX and TX ring count from 1024 to 64 +when running inside kdump kernel, which leads to a significant memory +saving. + +An example log with the patch applied shows the reduced memory +allocation in the kdump kernel: + dracut-pre-pivot[674]: ======== Report format module_summary: ======== + dracut-pre-pivot[674]: Module qed using 141.8MB (2268 pages), peak allocation 141.8MB (2268 pages) + <..snip..> +[dracut-pre-pivot[674]: Module qede using 4.8MB (76 pages), peak allocation 4.9MB (78 pages) + +Tested crashdump vmcore save via ssh/nfs protocol using underlying qed* +network interface after applying this patch. + +[1] OOM log: +------------ + + kworker/0:6: page allocation failure: order:6, + mode:0x60c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null) + kworker/0:6 cpuset=/ mems_allowed=0 + CPU: 0 PID: 145 Comm: kworker/0:6 Not tainted 4.18.0-109.el8.aarch64 #1 + Hardware name: To be filled by O.E.M. Saber/Saber, BIOS 0ACKL025 + 01/18/2019 + Workqueue: events work_for_cpu_fn + Call trace: + dump_backtrace+0x0/0x188 + show_stack+0x24/0x30 + dump_stack+0x90/0xb4 + warn_alloc+0xf4/0x178 + __alloc_pages_nodemask+0xcac/0xd58 + alloc_pages_current+0x8c/0xf8 + kmalloc_order_trace+0x38/0x108 + qed_iov_alloc+0x40/0x248 [qed] + qed_resc_alloc+0x224/0x518 [qed] + qed_slowpath_start+0x254/0x928 [qed] + __qede_probe+0xf8/0x5e0 [qede] + qede_probe+0x68/0xd8 [qede] + local_pci_probe+0x44/0xa8 + work_for_cpu_fn+0x20/0x30 + process_one_work+0x1ac/0x3e8 + worker_thread+0x44/0x448 + kthread+0x130/0x138 + ret_from_fork+0x10/0x18 + Cannot start slowpath + qede: probe of 0000:05:00.1 failed with error -12 + +[2]. Memstrack tool: https://github.com/ryncsn/memstrack + +Cc: kexec@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +Cc: Ariel Elior +Cc: GR-everest-linux-l2@marvell.com +Cc: Manish Chopra +Cc: David S. Miller +Signed-off-by: Bhupesh Sharma +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/qlogic/qede/qede.h | 2 ++ + drivers/net/ethernet/qlogic/qede/qede_main.c | 11 +++++++++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/qlogic/qede/qede.h b/drivers/net/ethernet/qlogic/qede/qede.h +index 787cc990e8c0..8ada3b2f8cb3 100644 +--- a/drivers/net/ethernet/qlogic/qede/qede.h ++++ b/drivers/net/ethernet/qlogic/qede/qede.h +@@ -560,12 +560,14 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, + #define RX_RING_SIZE ((u16)BIT(RX_RING_SIZE_POW)) + #define NUM_RX_BDS_MAX (RX_RING_SIZE - 1) + #define NUM_RX_BDS_MIN 128 ++#define NUM_RX_BDS_KDUMP_MIN 63 + #define NUM_RX_BDS_DEF ((u16)BIT(10) - 1) + + #define TX_RING_SIZE_POW 13 + #define TX_RING_SIZE ((u16)BIT(TX_RING_SIZE_POW)) + #define NUM_TX_BDS_MAX (TX_RING_SIZE - 1) + #define NUM_TX_BDS_MIN 128 ++#define NUM_TX_BDS_KDUMP_MIN 63 + #define NUM_TX_BDS_DEF NUM_TX_BDS_MAX + + #define QEDE_MIN_PKT_LEN 64 +diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c +index 010a08a0640e..985d3ae032d3 100644 +--- a/drivers/net/ethernet/qlogic/qede/qede_main.c ++++ b/drivers/net/ethernet/qlogic/qede/qede_main.c +@@ -29,6 +29,7 @@ + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ ++#include + #include + #include + #include +@@ -721,8 +722,14 @@ static struct qede_dev *qede_alloc_etherdev(struct qed_dev *cdev, + edev->dp_module = dp_module; + edev->dp_level = dp_level; + edev->ops = qed_ops; +- edev->q_num_rx_buffers = NUM_RX_BDS_DEF; +- edev->q_num_tx_buffers = NUM_TX_BDS_DEF; ++ ++ if (is_kdump_kernel()) { ++ edev->q_num_rx_buffers = NUM_RX_BDS_KDUMP_MIN; ++ edev->q_num_tx_buffers = NUM_TX_BDS_KDUMP_MIN; ++ } else { ++ edev->q_num_rx_buffers = NUM_RX_BDS_DEF; ++ edev->q_num_tx_buffers = NUM_TX_BDS_DEF; ++ } + + DP_INFO(edev, "Allocated netdev with %d tx queues and %d rx queues\n", + info->num_queues, info->num_queues); +-- +2.16.4 + diff --git a/patches.suse/sunrpc-make-lockless-test-safe.patch b/patches.suse/sunrpc-make-lockless-test-safe.patch new file mode 100644 index 0000000..5412b6c --- /dev/null +++ b/patches.suse/sunrpc-make-lockless-test-safe.patch @@ -0,0 +1,34 @@ +From: NeilBrown +Subject: SUNRPC: make lockless test safe. +Patch-mainline: never, code has changed substantually +References: bsc#1207201 + +When queuing a newly ready socket, we perform a lockless test of +RQ_BUSY. That can sometimes use old data and a thread can appear to +still be busy even though it has already cleared the BUSY flag and and +checked that the queue is empty one last time. This can result in all +threads waiting even though a socket as been queued: the ghost RQ_BUSY +prevented a wakeup. + +So add a memory barrier after queuing the socket to ensure that the +subsequent test of RQ_BUSY is proplery ordered. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/svc_xprt.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/net/sunrpc/svc_xprt.c ++++ b/net/sunrpc/svc_xprt.c +@@ -460,6 +460,10 @@ redo_search: + list_add_tail(&xprt->xpt_ready, &pool->sp_sockets); + pool->sp_stats.sockets_queued++; + spin_unlock_bh(&pool->sp_lock); ++ /* Ensure the "lockless check" of RQ_BUSY sees rq_flags ++ * *after* we have added to the sp_sockets queue. ++ */ ++ smp_mb(); + goto redo_search; + } + rqstp = NULL; diff --git a/series.conf b/series.conf index 32d7760..10ee403 100644 --- a/series.conf +++ b/series.conf @@ -56379,6 +56379,7 @@ patches.suse/net-dsa-mt7530-fix-roaming-from-DSA-user-ports.patch patches.suse/net-revert-net-get-rid-of-an-signed-integer-overflow.patch patches.suse/net-sched-fix-reporting-the-first-time-use-timestamp.patch + patches.suse/net-bmac-Fix-read-of-MAC-address-from-ROM.patch patches.suse/r8152-support-additional-Microsoft-Surface-Ethernet-.patch patches.suse/net-inet_csk-Fix-so_reuseport-bind-address-cache-in-.patch patches.suse/__netif_receive_skb_core-pass-skb-by-reference.patch @@ -56387,6 +56388,7 @@ patches.suse/net-qrtr-Fix-passing-invalid-reference-to-qrtr_local.patch patches.suse/net-ipip-fix-wrong-address-family-in-init-error-path.patch patches.suse/sctp-Start-shutdown-on-association-restart-if-in-SHU.patch + patches.suse/net-ethernet-freescale-rework-quiesce-activate-for-u.patch patches.suse/mlxsw-spectrum-Fix-use-after-free-of-split-unsplit-t.patch patches.suse/0002-net-sun-fix-missing-release-regions-in-cas_init_one.patch patches.suse/net-mlx4_core-fix-a-memory-leak-bug.patch @@ -56553,6 +56555,7 @@ patches.suse/carl9170-remove-P2P_GO-support.patch patches.suse/ath9k_htc-Silence-undersized-packet-warnings.patch patches.suse/net-usb-ax88179_178a-remove-redundant-assignment-to-.patch + patches.suse/net-qed-Reduce-RX-and-TX-default-ring-count-when-run.patch patches.suse/Bluetooth-Handle-Inquiry-Cancel-error-after-Inquiry-.patch patches.suse/veth-Adjust-hard_start-offset-on-redirect-XDP-frames.patch patches.suse/ixgbe-Fix-XDP-redirect-on-archs-with-PAGE_SIZE-above.patch @@ -63393,6 +63396,7 @@ patches.suse/SUNRPC-change-locking-for-xs_swap_enable-disable.patch patches.suse/nfs-access-cache-no-negative.patch patches.suse/NFS-Handle-missing-attributes-in-OPEN.patch + patches.suse/sunrpc-make-lockless-test-safe.patch ######################################################## # Overlayfs