netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: fix bonding with ARP monitoring by updating trans_start manually
@ 2022-07-15 23:26 Vladimir Oltean
  2022-07-15 23:52 ` Florian Fainelli
  2022-07-16  0:00 ` Jakub Kicinski
  0 siblings, 2 replies; 13+ messages in thread
From: Vladimir Oltean @ 2022-07-15 23:26 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Vivien Didelot, Florian Fainelli, Jonathan Toppins,
	Jay Vosburgh, Veaceslav Falico, Hangbin Liu, Brian Hutchinson

Documentation/networking/bonding.rst points out that for ARP monitoring
to work, dev_trans_start() must be able to verify the latest trans_start
update of any slave_dev TX queue. However, with NETIF_F_LLTX,
netdev_start_xmit() -> txq_trans_update() fails to do anything, because
the TX queue hasn't been locked.

Fix this by manually updating the current TX queue's trans_start for
each packet sent.

Fixes: 2b86cb829976 ("net: dsa: declare lockless TX feature for slave ports")
Reported-by: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/dsa/slave.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index ad6a6663feeb..c1b5c549698d 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -746,12 +746,17 @@ static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p,
 
 netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev)
 {
+	struct netdev_queue *q = netdev_get_tx_queue(dev, skb->queue_mapping);
+
 	/* SKB for netpoll still need to be mangled with the protocol-specific
 	 * tag to be successfully transmitted
 	 */
 	if (unlikely(netpoll_tx_running(dev)))
 		return dsa_slave_netpoll_send_skb(dev, skb);
 
+	/* NETIF_F_LLTX requires us to update q->trans_start manually */
+	WRITE_ONCE(q->trans_start, jiffies);
+
 	/* Queue the SKB for transmission on the parent interface, but
 	 * do not modify its EtherType
 	 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-25 21:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15 23:26 [PATCH net] net: dsa: fix bonding with ARP monitoring by updating trans_start manually Vladimir Oltean
2022-07-15 23:52 ` Florian Fainelli
2022-07-16  0:00 ` Jakub Kicinski
2022-07-16  0:14   ` Vladimir Oltean
2022-07-16  0:19     ` Jakub Kicinski
2022-07-16  0:26       ` Vladimir Oltean
2022-07-16  0:55         ` Jakub Kicinski
2022-07-16 13:30           ` Vladimir Oltean
2022-07-16 23:33             ` Jakub Kicinski
2022-07-25 20:31               ` Vladimir Oltean
2022-07-25 20:40                 ` Jakub Kicinski
2022-07-25 21:39                 ` Jonathan Toppins
2022-07-25 21:53                   ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).