From: Greg Kroah-Hartman Date: Mon, 24 Jul 2023 06:47:24 +0000 (+0200) Subject: drop queue-5.15/net-annotate-accesses-to-queue-trans_start.patch X-Git-Tag: v6.1.41~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0740166eca6bfb0e33e368c168286da156833e8e;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-5.15/net-annotate-accesses-to-queue-trans_start.patch Wasn't needed, and broke the build --- diff --git a/queue-4.14/tcp-annotate-data-races-around-fastopenq.max_qlen.patch b/queue-4.14/tcp-annotate-data-races-around-fastopenq.max_qlen.patch index 403575d7668..154af006d0b 100644 --- a/queue-4.14/tcp-annotate-data-races-around-fastopenq.max_qlen.patch +++ b/queue-4.14/tcp-annotate-data-races-around-fastopenq.max_qlen.patch @@ -15,16 +15,14 @@ Link: https://lore.kernel.org/r/20230719212857.3943972-12-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- - include/linux/tcp.h | 2 +- - net/ipv4/tcp.c | 2 +- - net/ipv4/tcp_fastopen.c | 6 ++++-- + include/linux/tcp.h | 2 +- + net/ipv4/tcp.c | 2 +- + net/ipv4/tcp_fastopen.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) -diff --git a/include/linux/tcp.h b/include/linux/tcp.h -index b9bc6e3e4ef96..45a85277c2ea5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h -@@ -425,7 +425,7 @@ static inline void fastopen_queue_tune(struct sock *sk, int backlog) +@@ -425,7 +425,7 @@ static inline void fastopen_queue_tune(s struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; int somaxconn = READ_ONCE(sock_net(sk)->core.sysctl_somaxconn); @@ -33,11 +31,9 @@ index b9bc6e3e4ef96..45a85277c2ea5 100644 } static inline void tcp_move_syn(struct tcp_sock *tp, -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index bcc2a3490323b..0859f968c9b27 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c -@@ -3193,7 +3193,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level, +@@ -3193,7 +3193,7 @@ static int do_tcp_getsockopt(struct sock break; case TCP_FASTOPEN: @@ -46,11 +42,9 @@ index bcc2a3490323b..0859f968c9b27 100644 break; case TCP_FASTOPEN_CONNECT: -diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c -index 0567edb76522c..0edd8d357e3d1 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c -@@ -239,6 +239,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, +@@ -239,6 +239,7 @@ static struct sock *tcp_fastopen_create_ static bool tcp_fastopen_queue_check(struct sock *sk) { struct fastopen_queue *fastopenq; @@ -58,7 +52,7 @@ index 0567edb76522c..0edd8d357e3d1 100644 /* Make sure the listener has enabled fastopen, and we don't * exceed the max # of pending TFO requests allowed before trying -@@ -251,10 +252,11 @@ static bool tcp_fastopen_queue_check(struct sock *sk) +@@ -251,10 +252,11 @@ static bool tcp_fastopen_queue_check(str * temporarily vs a server not supporting Fast Open at all. */ fastopenq = &inet_csk(sk)->icsk_accept_queue.fastopenq; @@ -72,6 +66,3 @@ index 0567edb76522c..0edd8d357e3d1 100644 struct request_sock *req1; spin_lock(&fastopenq->lock); req1 = fastopenq->rskq_rst_head; --- -2.39.2 - diff --git a/queue-5.15/igc-avoid-transmit-queue-timeout-for-xdp.patch b/queue-5.15/igc-avoid-transmit-queue-timeout-for-xdp.patch index 43e6062d000..69f336fd3c4 100644 --- a/queue-5.15/igc-avoid-transmit-queue-timeout-for-xdp.patch +++ b/queue-5.15/igc-avoid-transmit-queue-timeout-for-xdp.patch @@ -20,14 +20,12 @@ Signed-off-by: Tony Nguyen Stable-dep-of: 78adb4bcf99e ("igc: Prevent garbled TX queue with XDP ZEROCOPY") Signed-off-by: Sasha Levin --- - drivers/net/ethernet/intel/igc/igc_main.c | 8 ++++++++ + drivers/net/ethernet/intel/igc/igc_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) -diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c -index db48979cdecbc..6b747c7dc935f 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c -@@ -2357,6 +2357,8 @@ static int igc_xdp_xmit_back(struct igc_adapter *adapter, struct xdp_buff *xdp) +@@ -2357,6 +2357,8 @@ static int igc_xdp_xmit_back(struct igc_ nq = txring_txq(ring); __netif_tx_lock(nq, cpu); @@ -36,7 +34,7 @@ index db48979cdecbc..6b747c7dc935f 100644 res = igc_xdp_init_tx_descriptor(ring, xdpf); __netif_tx_unlock(nq); return res; -@@ -2757,6 +2759,9 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring) +@@ -2757,6 +2759,9 @@ static void igc_xdp_xmit_zc(struct igc_r __netif_tx_lock(nq, cpu); @@ -46,7 +44,7 @@ index db48979cdecbc..6b747c7dc935f 100644 budget = igc_desc_unused(ring); while (xsk_tx_peek_desc(pool, &xdp_desc) && budget--) { -@@ -6251,6 +6256,9 @@ static int igc_xdp_xmit(struct net_device *dev, int num_frames, +@@ -6251,6 +6256,9 @@ static int igc_xdp_xmit(struct net_devic __netif_tx_lock(nq, cpu); @@ -56,6 +54,3 @@ index db48979cdecbc..6b747c7dc935f 100644 drops = 0; for (i = 0; i < num_frames; i++) { int err; --- -2.39.2 - diff --git a/queue-5.15/net-annotate-accesses-to-queue-trans_start.patch b/queue-5.15/net-annotate-accesses-to-queue-trans_start.patch deleted file mode 100644 index 84ffc870486..00000000000 --- a/queue-5.15/net-annotate-accesses-to-queue-trans_start.patch +++ /dev/null @@ -1,285 +0,0 @@ -From f24b5ff2bb0ef5ddbf058c64ef96bf2739be7a1a Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 16 Nov 2021 19:29:22 -0800 -Subject: net: annotate accesses to queue->trans_start - -From: Eric Dumazet - -[ Upstream commit 5337824f4dc4bb26f38fbbba4ffb425a92803f15 ] - -In following patches, dev_watchdog() will no longer stop all queues. -It will read queue->trans_start locklessly. - -Signed-off-by: Eric Dumazet -Signed-off-by: David S. Miller -Stable-dep-of: 78adb4bcf99e ("igc: Prevent garbled TX queue with XDP ZEROCOPY") -Signed-off-by: Sasha Levin ---- - drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +- - drivers/net/ethernet/atheros/ag71xx.c | 2 +- - drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 4 ++-- - drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- - drivers/net/ethernet/ibm/ibmvnic.c | 2 +- - drivers/net/ethernet/intel/igb/igb_main.c | 4 ++-- - .../ethernet/mellanox/mlx5/core/en/reporter_tx.c | 2 +- - .../net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- - drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- - drivers/net/wireless/marvell/mwifiex/init.c | 2 +- - drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- - include/linux/netdevice.h | 16 +++++++++++++--- - net/sched/sch_generic.c | 8 ++++---- - 13 files changed, 32 insertions(+), 22 deletions(-) - -diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -index 71151f675a498..292c2ce16672f 100644 ---- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -@@ -871,7 +871,7 @@ static void xgene_enet_timeout(struct net_device *ndev, unsigned int txqueue) - - for (i = 0; i < pdata->txq_cnt; i++) { - txq = netdev_get_tx_queue(ndev, i); -- txq->trans_start = jiffies; -+ txq_trans_cond_update(txq); - netif_tx_start_queue(txq); - } - } -diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c -index 9d8b214c129d2..7e83319b26c14 100644 ---- a/drivers/net/ethernet/atheros/ag71xx.c -+++ b/drivers/net/ethernet/atheros/ag71xx.c -@@ -766,7 +766,7 @@ static bool ag71xx_check_dma_stuck(struct ag71xx *ag) - unsigned long timestamp; - u32 rx_sm, tx_sm, rx_fd; - -- timestamp = netdev_get_tx_queue(ag->ndev, 0)->trans_start; -+ timestamp = READ_ONCE(netdev_get_tx_queue(ag->ndev, 0)->trans_start); - if (likely(time_before(jiffies, timestamp + HZ / 10))) - return false; - -diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c -index fe5fc2b3406f9..5f5392e6d096a 100644 ---- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c -+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c -@@ -2325,7 +2325,7 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) - txq = netdev_get_tx_queue(net_dev, queue_mapping); - - /* LLTX requires to do our own update of trans_start */ -- txq->trans_start = jiffies; -+ txq_trans_cond_update(txq); - - if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) { - fd.cmd |= cpu_to_be32(FM_FD_CMD_UPD); -@@ -2531,7 +2531,7 @@ static int dpaa_xdp_xmit_frame(struct net_device *net_dev, - - /* Bump the trans_start */ - txq = netdev_get_tx_queue(net_dev, smp_processor_id()); -- txq->trans_start = jiffies; -+ txq_trans_cond_update(txq); - - err = dpaa_xmit(priv, percpu_stats, smp_processor_id(), &fd); - if (err) { -diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c -index 2acf50ed6025a..90314a4adcfd9 100644 ---- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c -+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c -@@ -2645,7 +2645,7 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev) - unsigned long trans_start; - - q = netdev_get_tx_queue(ndev, i); -- trans_start = q->trans_start; -+ trans_start = READ_ONCE(q->trans_start); - if (netif_xmit_stopped(q) && - time_after(jiffies, - (trans_start + ndev->watchdog_timeo))) { -diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c -index 450b4fd9aa7f7..ad45158651ddf 100644 ---- a/drivers/net/ethernet/ibm/ibmvnic.c -+++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -1910,7 +1910,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) - - tx_packets++; - tx_bytes += skb->len; -- txq->trans_start = jiffies; -+ txq_trans_cond_update(txq); - ret = NETDEV_TX_OK; - goto out; - -diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c -index 3d380dfff7783..606ac667b8ec6 100644 ---- a/drivers/net/ethernet/intel/igb/igb_main.c -+++ b/drivers/net/ethernet/intel/igb/igb_main.c -@@ -2933,7 +2933,7 @@ static int igb_xdp_xmit_back(struct igb_adapter *adapter, struct xdp_buff *xdp) - nq = txring_txq(tx_ring); - __netif_tx_lock(nq, cpu); - /* Avoid transmit queue timeout since we share it with the slow path */ -- nq->trans_start = jiffies; -+ txq_trans_cond_update(nq); - ret = igb_xmit_xdp_ring(adapter, tx_ring, xdpf); - __netif_tx_unlock(nq); - -@@ -2967,7 +2967,7 @@ static int igb_xdp_xmit(struct net_device *dev, int n, - __netif_tx_lock(nq, cpu); - - /* Avoid transmit queue timeout since we share it with the slow path */ -- nq->trans_start = jiffies; -+ txq_trans_cond_update(nq); - - for (i = 0; i < n; i++) { - struct xdp_frame *xdpf = frames[i]; -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c -index 8024599994642..f7fc3c2fa100e 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c -@@ -570,7 +570,7 @@ int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq) - snprintf(err_str, sizeof(err_str), - "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x, usecs since last trans: %u", - sq->ch_ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc, -- jiffies_to_usecs(jiffies - sq->txq->trans_start)); -+ jiffies_to_usecs(jiffies - READ_ONCE(sq->txq->trans_start))); - - mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx); - return to_ctx.status; -diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index a43628dd1f4c2..f2dd8c4deb44d 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -2416,7 +2416,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget) - bool work_done = true; - - /* Avoids TX time-out as we are sharing with slow path */ -- nq->trans_start = jiffies; -+ txq_trans_cond_update(nq->trans_start); - - budget = min(budget, stmmac_tx_avail(priv, queue)); - -@@ -4731,7 +4731,7 @@ static int stmmac_xdp_xmit_back(struct stmmac_priv *priv, - - __netif_tx_lock(nq, cpu); - /* Avoids TX time-out as we are sharing with slow path */ -- nq->trans_start = jiffies; -+ txq_trans_cond_update(nq->trans_start); - - res = stmmac_xdp_xmit_xdpf(priv, queue, xdpf, false); - if (res == STMMAC_XDP_TX) -@@ -6374,7 +6374,7 @@ static int stmmac_xdp_xmit(struct net_device *dev, int num_frames, - - __netif_tx_lock(nq, cpu); - /* Avoids TX time-out as we are sharing with slow path */ -- nq->trans_start = jiffies; -+ txq_trans_cond_update(nq); - - for (i = 0; i < num_frames; i++) { - int res; -diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c -index daf0779261f3e..934d110ea351d 100644 ---- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c -+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c -@@ -345,7 +345,7 @@ static void am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev, - - netif_txq = netdev_get_tx_queue(ndev, txqueue); - tx_chn = &common->tx_chns[txqueue]; -- trans_start = netif_txq->trans_start; -+ trans_start = READ_ONCE(netif_txq->trans_start); - - netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u dql_avail:%d free_desc:%zu\n", - txqueue, -diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c -index f006a3d72b404..88c72d1827a00 100644 ---- a/drivers/net/wireless/marvell/mwifiex/init.c -+++ b/drivers/net/wireless/marvell/mwifiex/init.c -@@ -332,7 +332,7 @@ void mwifiex_set_trans_start(struct net_device *dev) - int i; - - for (i = 0; i < dev->num_tx_queues; i++) -- netdev_get_tx_queue(dev, i)->trans_start = jiffies; -+ txq_trans_cond_update(netdev_get_tx_queue(dev, i)); - - netif_trans_update(dev); - } -diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c -index ea8bc27fce494..b5a38f0a8d79b 100644 ---- a/drivers/staging/rtl8192e/rtllib_softmac.c -+++ b/drivers/staging/rtl8192e/rtllib_softmac.c -@@ -2515,7 +2515,7 @@ void rtllib_stop_all_queues(struct rtllib_device *ieee) - unsigned int i; - - for (i = 0; i < ieee->dev->num_tx_queues; i++) -- netdev_get_tx_queue(ieee->dev, i)->trans_start = jiffies; -+ txq_trans_cond_update(netdev_get_tx_queue(ieee->dev, i)); - - netif_tx_stop_all_queues(ieee->dev); - } -diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index b5df2e59a51d3..f1dd4c102e9af 100644 ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -4473,10 +4473,21 @@ static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) - spin_unlock_bh(&txq->_xmit_lock); - } - -+/* -+ * txq->trans_start can be read locklessly from dev_watchdog() -+ */ - static inline void txq_trans_update(struct netdev_queue *txq) - { - if (txq->xmit_lock_owner != -1) -- txq->trans_start = jiffies; -+ WRITE_ONCE(txq->trans_start, jiffies); -+} -+ -+static inline void txq_trans_cond_update(struct netdev_queue *txq) -+{ -+ unsigned long now = jiffies; -+ -+ if (READ_ONCE(txq->trans_start) != now) -+ WRITE_ONCE(txq->trans_start, now); - } - - /* legacy drivers only, netdev_start_xmit() sets txq->trans_start */ -@@ -4484,8 +4495,7 @@ static inline void netif_trans_update(struct net_device *dev) - { - struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); - -- if (txq->trans_start != jiffies) -- txq->trans_start = jiffies; -+ txq_trans_cond_update(txq); - } - - /** -diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c -index 02299785209c1..76ed401af066b 100644 ---- a/net/sched/sch_generic.c -+++ b/net/sched/sch_generic.c -@@ -434,9 +434,9 @@ unsigned long dev_trans_start(struct net_device *dev) - dev = vlan_dev_real_dev(dev); - else if (netif_is_macvlan(dev)) - dev = macvlan_dev_real_dev(dev); -- res = netdev_get_tx_queue(dev, 0)->trans_start; -+ res = READ_ONCE(netdev_get_tx_queue(dev, 0)->trans_start); - for (i = 1; i < dev->num_tx_queues; i++) { -- val = netdev_get_tx_queue(dev, i)->trans_start; -+ val = READ_ONCE(netdev_get_tx_queue(dev, i)->trans_start); - if (val && time_after(val, res)) - res = val; - } -@@ -462,7 +462,7 @@ static void dev_watchdog(struct timer_list *t) - struct netdev_queue *txq; - - txq = netdev_get_tx_queue(dev, i); -- trans_start = txq->trans_start; -+ trans_start = READ_ONCE(txq->trans_start); - if (netif_xmit_stopped(txq) && - time_after(jiffies, (trans_start + - dev->watchdog_timeo))) { -@@ -1172,7 +1172,7 @@ static void transition_one_qdisc(struct net_device *dev, - - rcu_assign_pointer(dev_queue->qdisc, new_qdisc); - if (need_watchdog_p) { -- dev_queue->trans_start = 0; -+ WRITE_ONCE(dev_queue->trans_start, 0); - *need_watchdog_p = 1; - } - } --- -2.39.2 - diff --git a/queue-5.15/series b/queue-5.15/series index 0b34691e8a5..33d69a7dd67 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -52,7 +52,6 @@ iavf-fix-out-of-bounds-when-setting-channels-on-remo.patch security-keys-modify-mismatched-function-name.patch octeontx2-pf-dont-allocate-bpids-for-lbk-interfaces.patch bpf-fix-subprog-idx-logic-in-check_max_stack_depth.patch -net-annotate-accesses-to-queue-trans_start.patch igc-avoid-transmit-queue-timeout-for-xdp.patch igc-prevent-garbled-tx-queue-with-xdp-zerocopy.patch tcp-annotate-data-races-around-tcp_rsk-req-ts_recent.patch