[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220715232641.952532-1-vladimir.oltean@nxp.com>
Date: Sat, 16 Jul 2022 02:26:41 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Jonathan Toppins <jtoppins@...hat.com>,
Jay Vosburgh <j.vosburgh@...il.com>,
Veaceslav Falico <vfalico@...il.com>,
Hangbin Liu <liuhangbin@...il.com>,
Brian Hutchinson <b.hutchman@...il.com>
Subject: [PATCH net] net: dsa: fix bonding with ARP monitoring by updating trans_start manually
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@...il.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@....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
Powered by blists - more mailing lists