From: Sasha Levin Date: Sun, 24 Mar 2024 21:35:46 +0000 (-0400) Subject: Drop broken 4.19 rcu backport X-Git-Tag: v6.8.2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6ef17461898bf414c26efc8af816bab416a9012;p=thirdparty%2Fkernel%2Fstable-queue.git Drop broken 4.19 rcu backport --- diff --git a/queue-4.19/bpf-report-rcu-qs-in-cpumap-kthread.patch b/queue-4.19/bpf-report-rcu-qs-in-cpumap-kthread.patch deleted file mode 100644 index e710e3934d8..00000000000 --- a/queue-4.19/bpf-report-rcu-qs-in-cpumap-kthread.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 640adab17cd2c6afde6f29eb470a4b3c8cad3553 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 19 Mar 2024 13:44:40 -0700 -Subject: bpf: report RCU QS in cpumap kthread - -From: Yan Zhai - -[ Upstream commit 00bf63122459e87193ee7f1bc6161c83a525569f ] - -When there are heavy load, cpumap kernel threads can be busy polling -packets from redirect queues and block out RCU tasks from reaching -quiescent states. It is insufficient to just call cond_resched() in such -context. Periodically raise a consolidated RCU QS before cond_resched -fixes the problem. - -Fixes: 6710e1126934 ("bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP") -Reviewed-by: Jesper Dangaard Brouer -Signed-off-by: Yan Zhai -Acked-by: Paul E. McKenney -Acked-by: Jesper Dangaard Brouer -Link: https://lore.kernel.org/r/c17b9f1517e19d813da3ede5ed33ee18496bb5d8.1710877680.git.yan@cloudflare.com -Signed-off-by: Jakub Kicinski -Signed-off-by: Sasha Levin ---- - kernel/bpf/cpumap.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c -index 61fbcae82f0a1..6f7548138435b 100644 ---- a/kernel/bpf/cpumap.c -+++ b/kernel/bpf/cpumap.c -@@ -243,6 +243,7 @@ static void put_cpu_map_entry(struct bpf_cpu_map_entry *rcpu) - static int cpu_map_kthread_run(void *data) - { - struct bpf_cpu_map_entry *rcpu = data; -+ unsigned long last_qs = jiffies; - - set_current_state(TASK_INTERRUPTIBLE); - -@@ -262,10 +263,12 @@ static int cpu_map_kthread_run(void *data) - if (__ptr_ring_empty(rcpu->queue)) { - schedule(); - sched = 1; -+ last_qs = jiffies; - } else { - __set_current_state(TASK_RUNNING); - } - } else { -+ rcu_softirq_qs_periodic(last_qs); - sched = cond_resched(); - } - --- -2.43.0 - diff --git a/queue-4.19/ice-rework-flex-descriptor-programming.patch b/queue-4.19/ice-rework-flex-descriptor-programming.patch deleted file mode 100644 index ef79983664e..00000000000 --- a/queue-4.19/ice-rework-flex-descriptor-programming.patch +++ /dev/null @@ -1,206 +0,0 @@ -From 88164cd4365dd53a8c522454c94da23923f4cd7b Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 9 Aug 2018 06:29:44 -0700 -Subject: ice: Rework flex descriptor programming - -From: Anirudh Venkataramanan - -[ Upstream commit 22ef683b48182f4d6125a2fb2725eb8a141514ff ] - -The driver can support two flex descriptor profiles, ICE_RXDID_FLEX_NIC -and ICE_RXDID_FLEX_NIC_2. This patch reworks the current flex programming -logic to add support for the latter profile. - -Signed-off-by: Anirudh Venkataramanan -Tested-by: Tony Brelinski -Signed-off-by: Jeff Kirsher -Stable-dep-of: 00bf63122459 ("bpf: report RCU QS in cpumap kthread") -Signed-off-by: Sasha Levin ---- - drivers/net/ethernet/intel/ice/ice_common.c | 102 ++++++++++++++---- - .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 24 +++-- - 2 files changed, 92 insertions(+), 34 deletions(-) - -diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c -index f8d00263d9019..72a6f22ee423f 100644 ---- a/drivers/net/ethernet/intel/ice/ice_common.c -+++ b/drivers/net/ethernet/intel/ice/ice_common.c -@@ -7,16 +7,16 @@ - - #define ICE_PF_RESET_WAIT_COUNT 200 - --#define ICE_NIC_FLX_ENTRY(hw, mdid, idx) \ -- wr32((hw), GLFLXP_RXDID_FLX_WRD_##idx(ICE_RXDID_FLEX_NIC), \ -+#define ICE_PROG_FLEX_ENTRY(hw, rxdid, mdid, idx) \ -+ wr32((hw), GLFLXP_RXDID_FLX_WRD_##idx(rxdid), \ - ((ICE_RX_OPC_MDID << \ - GLFLXP_RXDID_FLX_WRD_##idx##_RXDID_OPCODE_S) & \ - GLFLXP_RXDID_FLX_WRD_##idx##_RXDID_OPCODE_M) | \ - (((mdid) << GLFLXP_RXDID_FLX_WRD_##idx##_PROT_MDID_S) & \ - GLFLXP_RXDID_FLX_WRD_##idx##_PROT_MDID_M)) - --#define ICE_NIC_FLX_FLG_ENTRY(hw, flg_0, flg_1, flg_2, flg_3, idx) \ -- wr32((hw), GLFLXP_RXDID_FLAGS(ICE_RXDID_FLEX_NIC, idx), \ -+#define ICE_PROG_FLG_ENTRY(hw, rxdid, flg_0, flg_1, flg_2, flg_3, idx) \ -+ wr32((hw), GLFLXP_RXDID_FLAGS(rxdid, idx), \ - (((flg_0) << GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_S) & \ - GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_M) | \ - (((flg_1) << GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_1_S) & \ -@@ -290,30 +290,85 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, - } - - /** -- * ice_init_flex_parser - initialize rx flex parser -+ * ice_init_flex_flags - * @hw: pointer to the hardware structure -+ * @prof_id: Rx Descriptor Builder profile ID - * -- * Function to initialize flex descriptors -+ * Function to initialize Rx flex flags - */ --static void ice_init_flex_parser(struct ice_hw *hw) -+static void ice_init_flex_flags(struct ice_hw *hw, enum ice_rxdid prof_id) - { - u8 idx = 0; - -- ICE_NIC_FLX_ENTRY(hw, ICE_RX_MDID_HASH_LOW, 0); -- ICE_NIC_FLX_ENTRY(hw, ICE_RX_MDID_HASH_HIGH, 1); -- ICE_NIC_FLX_ENTRY(hw, ICE_RX_MDID_FLOW_ID_LOWER, 2); -- ICE_NIC_FLX_ENTRY(hw, ICE_RX_MDID_FLOW_ID_HIGH, 3); -- ICE_NIC_FLX_FLG_ENTRY(hw, ICE_RXFLG_PKT_FRG, ICE_RXFLG_UDP_GRE, -- ICE_RXFLG_PKT_DSI, ICE_RXFLG_FIN, idx++); -- ICE_NIC_FLX_FLG_ENTRY(hw, ICE_RXFLG_SYN, ICE_RXFLG_RST, -- ICE_RXFLG_PKT_DSI, ICE_RXFLG_PKT_DSI, idx++); -- ICE_NIC_FLX_FLG_ENTRY(hw, ICE_RXFLG_PKT_DSI, ICE_RXFLG_PKT_DSI, -- ICE_RXFLG_EVLAN_x8100, ICE_RXFLG_EVLAN_x9100, -- idx++); -- ICE_NIC_FLX_FLG_ENTRY(hw, ICE_RXFLG_VLAN_x8100, ICE_RXFLG_TNL_VLAN, -- ICE_RXFLG_TNL_MAC, ICE_RXFLG_TNL0, idx++); -- ICE_NIC_FLX_FLG_ENTRY(hw, ICE_RXFLG_TNL1, ICE_RXFLG_TNL2, -- ICE_RXFLG_PKT_DSI, ICE_RXFLG_PKT_DSI, idx); -+ /* Flex-flag fields (0-2) are programmed with FLG64 bits with layout: -+ * flexiflags0[5:0] - TCP flags, is_packet_fragmented, is_packet_UDP_GRE -+ * flexiflags1[3:0] - Not used for flag programming -+ * flexiflags2[7:0] - Tunnel and VLAN types -+ * 2 invalid fields in last index -+ */ -+ switch (prof_id) { -+ /* Rx flex flags are currently programmed for the NIC profiles only. -+ * Different flag bit programming configurations can be added per -+ * profile as needed. -+ */ -+ case ICE_RXDID_FLEX_NIC: -+ case ICE_RXDID_FLEX_NIC_2: -+ ICE_PROG_FLG_ENTRY(hw, prof_id, ICE_RXFLG_PKT_FRG, -+ ICE_RXFLG_UDP_GRE, ICE_RXFLG_PKT_DSI, -+ ICE_RXFLG_FIN, idx++); -+ /* flex flag 1 is not used for flexi-flag programming, skipping -+ * these four FLG64 bits. -+ */ -+ ICE_PROG_FLG_ENTRY(hw, prof_id, ICE_RXFLG_SYN, ICE_RXFLG_RST, -+ ICE_RXFLG_PKT_DSI, ICE_RXFLG_PKT_DSI, idx++); -+ ICE_PROG_FLG_ENTRY(hw, prof_id, ICE_RXFLG_PKT_DSI, -+ ICE_RXFLG_PKT_DSI, ICE_RXFLG_EVLAN_x8100, -+ ICE_RXFLG_EVLAN_x9100, idx++); -+ ICE_PROG_FLG_ENTRY(hw, prof_id, ICE_RXFLG_VLAN_x8100, -+ ICE_RXFLG_TNL_VLAN, ICE_RXFLG_TNL_MAC, -+ ICE_RXFLG_TNL0, idx++); -+ ICE_PROG_FLG_ENTRY(hw, prof_id, ICE_RXFLG_TNL1, ICE_RXFLG_TNL2, -+ ICE_RXFLG_PKT_DSI, ICE_RXFLG_PKT_DSI, idx); -+ break; -+ -+ default: -+ ice_debug(hw, ICE_DBG_INIT, -+ "Flag programming for profile ID %d not supported\n", -+ prof_id); -+ } -+} -+ -+/** -+ * ice_init_flex_flds -+ * @hw: pointer to the hardware structure -+ * @prof_id: Rx Descriptor Builder profile ID -+ * -+ * Function to initialize flex descriptors -+ */ -+static void ice_init_flex_flds(struct ice_hw *hw, enum ice_rxdid prof_id) -+{ -+ enum ice_flex_rx_mdid mdid; -+ -+ switch (prof_id) { -+ case ICE_RXDID_FLEX_NIC: -+ case ICE_RXDID_FLEX_NIC_2: -+ ICE_PROG_FLEX_ENTRY(hw, prof_id, ICE_RX_MDID_HASH_LOW, 0); -+ ICE_PROG_FLEX_ENTRY(hw, prof_id, ICE_RX_MDID_HASH_HIGH, 1); -+ ICE_PROG_FLEX_ENTRY(hw, prof_id, ICE_RX_MDID_FLOW_ID_LOWER, 2); -+ -+ mdid = (prof_id == ICE_RXDID_FLEX_NIC_2) ? -+ ICE_RX_MDID_SRC_VSI : ICE_RX_MDID_FLOW_ID_HIGH; -+ -+ ICE_PROG_FLEX_ENTRY(hw, prof_id, mdid, 3); -+ -+ ice_init_flex_flags(hw, prof_id); -+ break; -+ -+ default: -+ ice_debug(hw, ICE_DBG_INIT, -+ "Field init for profile ID %d not supported\n", -+ prof_id); -+ } - } - - /** -@@ -494,7 +549,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) - if (status) - goto err_unroll_fltr_mgmt_struct; - -- ice_init_flex_parser(hw); -+ ice_init_flex_flds(hw, ICE_RXDID_FLEX_NIC); -+ ice_init_flex_flds(hw, ICE_RXDID_FLEX_NIC_2); - - return 0; - -diff --git a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h -index 068dbc740b766..94504023d86e2 100644 ---- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h -+++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h -@@ -188,23 +188,25 @@ struct ice_32b_rx_flex_desc_nic { - * with a specific metadata (profile 7 reserved for HW) - */ - enum ice_rxdid { -- ICE_RXDID_START = 0, -- ICE_RXDID_LEGACY_0 = ICE_RXDID_START, -- ICE_RXDID_LEGACY_1, -- ICE_RXDID_FLX_START, -- ICE_RXDID_FLEX_NIC = ICE_RXDID_FLX_START, -- ICE_RXDID_FLX_LAST = 63, -- ICE_RXDID_LAST = ICE_RXDID_FLX_LAST -+ ICE_RXDID_LEGACY_0 = 0, -+ ICE_RXDID_LEGACY_1 = 1, -+ ICE_RXDID_FLEX_NIC = 2, -+ ICE_RXDID_FLEX_NIC_2 = 6, -+ ICE_RXDID_HW = 7, -+ ICE_RXDID_LAST = 63, - }; - - /* Receive Flex Descriptor Rx opcode values */ - #define ICE_RX_OPC_MDID 0x01 - - /* Receive Descriptor MDID values */ --#define ICE_RX_MDID_FLOW_ID_LOWER 5 --#define ICE_RX_MDID_FLOW_ID_HIGH 6 --#define ICE_RX_MDID_HASH_LOW 56 --#define ICE_RX_MDID_HASH_HIGH 57 -+enum ice_flex_rx_mdid { -+ ICE_RX_MDID_FLOW_ID_LOWER = 5, -+ ICE_RX_MDID_FLOW_ID_HIGH, -+ ICE_RX_MDID_SRC_VSI = 19, -+ ICE_RX_MDID_HASH_LOW = 56, -+ ICE_RX_MDID_HASH_HIGH, -+}; - - /* Rx Flag64 packet flag bits */ - enum ice_rx_flg64_bits { --- -2.43.0 - diff --git a/queue-4.19/rcu-add-a-helper-to-report-consolidated-flavor-qs.patch b/queue-4.19/rcu-add-a-helper-to-report-consolidated-flavor-qs.patch deleted file mode 100644 index 212d1803914..00000000000 --- a/queue-4.19/rcu-add-a-helper-to-report-consolidated-flavor-qs.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 7f8ef8fa7550564abba9bdeaf20658d97938cf49 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 19 Mar 2024 13:44:34 -0700 -Subject: rcu: add a helper to report consolidated flavor QS - -From: Yan Zhai - -[ Upstream commit 1a77557d48cff187a169c2aec01c0dd78a5e7e50 ] - -When under heavy load, network processing can run CPU-bound for many -tens of seconds. Even in preemptible kernels (non-RT kernel), this can -block RCU Tasks grace periods, which can cause trace-event removal to -take more than a minute, which is unacceptably long. - -This commit therefore creates a new helper function that passes through -both RCU and RCU-Tasks quiescent states every 100 milliseconds. This -hard-coded value suffices for current workloads. - -Suggested-by: Paul E. McKenney -Reviewed-by: Jesper Dangaard Brouer -Signed-off-by: Yan Zhai -Reviewed-by: Paul E. McKenney -Acked-by: Jesper Dangaard Brouer -Link: https://lore.kernel.org/r/90431d46ee112d2b0af04dbfe936faaca11810a5.1710877680.git.yan@cloudflare.com -Signed-off-by: Jakub Kicinski -Stable-dep-of: 00bf63122459 ("bpf: report RCU QS in cpumap kthread") -Signed-off-by: Sasha Levin ---- - include/linux/rcupdate.h | 31 +++++++++++++++++++++++++++++++ - 1 file changed, 31 insertions(+) - -diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index cf139d6e5c1d3..38a9730b685b9 100644 ---- a/include/linux/rcupdate.h -+++ b/include/linux/rcupdate.h -@@ -196,6 +196,37 @@ do { \ - cond_resched(); \ - } while (0) - -+/** -+ * rcu_softirq_qs_periodic - Report RCU and RCU-Tasks quiescent states -+ * @old_ts: jiffies at start of processing. -+ * -+ * This helper is for long-running softirq handlers, such as NAPI threads in -+ * networking. The caller should initialize the variable passed in as @old_ts -+ * at the beginning of the softirq handler. When invoked frequently, this macro -+ * will invoke rcu_softirq_qs() every 100 milliseconds thereafter, which will -+ * provide both RCU and RCU-Tasks quiescent states. Note that this macro -+ * modifies its old_ts argument. -+ * -+ * Because regions of code that have disabled softirq act as RCU read-side -+ * critical sections, this macro should be invoked with softirq (and -+ * preemption) enabled. -+ * -+ * The macro is not needed when CONFIG_PREEMPT_RT is defined. RT kernels would -+ * have more chance to invoke schedule() calls and provide necessary quiescent -+ * states. As a contrast, calling cond_resched() only won't achieve the same -+ * effect because cond_resched() does not provide RCU-Tasks quiescent states. -+ */ -+#define rcu_softirq_qs_periodic(old_ts) \ -+do { \ -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT) && \ -+ time_after(jiffies, (old_ts) + HZ / 10)) { \ -+ preempt_disable(); \ -+ rcu_softirq_qs(); \ -+ preempt_enable(); \ -+ (old_ts) = jiffies; \ -+ } \ -+} while (0) -+ - /* - * Infrastructure to implement the synchronize_() primitives in - * TREE_RCU and rcu_barrier_() primitives in TINY_RCU. --- -2.43.0 - diff --git a/queue-4.19/series b/queue-4.19/series index 22fcd69009e..c5e9b55b1cb 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -144,7 +144,4 @@ hsr-fix-uninit-value-access-in-hsr_get_node.patch rds-introduce-acquire-release-ordering-in-acquire-re.patch hsr-handle-failures-in-module-init.patch net-bnx2x-prevent-access-to-a-freed-page-in-page_poo.patch -ice-rework-flex-descriptor-programming.patch -rcu-add-a-helper-to-report-consolidated-flavor-qs.patch -bpf-report-rcu-qs-in-cpumap-kthread.patch spi-spi-mt65xx-fix-null-pointer-access-in-interrupt-.patch