Skip to content

Commit a31d27f

Browse files
NicolasDichteldavem330
authored andcommitted
tun: fix bonding active backup with arp monitoring
As stated in the bonding doc, trans_start must be set manually for drivers using NETIF_F_LLTX: Drivers that use NETIF_F_LLTX flag must also update netdev_queue->trans_start. If they do not, then the ARP monitor will immediately fail any slaves using that driver, and those slaves will stay down. Link: https://www.kernel.org/doc/html/v5.15/networking/bonding.html#arp-monitor-operation Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 86c3a3e commit a31d27f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/tun.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
10101010
{
10111011
struct tun_struct *tun = netdev_priv(dev);
10121012
int txq = skb->queue_mapping;
1013+
struct netdev_queue *queue;
10131014
struct tun_file *tfile;
10141015
int len = skb->len;
10151016

@@ -1054,6 +1055,10 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
10541055
if (ptr_ring_produce(&tfile->tx_ring, skb))
10551056
goto drop;
10561057

1058+
/* NETIF_F_LLTX requires to do our own update of trans_start */
1059+
queue = netdev_get_tx_queue(dev, txq);
1060+
queue->trans_start = jiffies;
1061+
10571062
/* Notify and wake up reader process */
10581063
if (tfile->flags & TUN_FASYNC)
10591064
kill_fasync(&tfile->fasync, SIGIO, POLL_IN);

0 commit comments

Comments
 (0)