Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D175BC433EF for ; Wed, 24 Nov 2021 12:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345449AbhKXMu0 (ORCPT ); Wed, 24 Nov 2021 07:50:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:55390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345389AbhKXMrj (ORCPT ); Wed, 24 Nov 2021 07:47:39 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5FFF361263; Wed, 24 Nov 2021 12:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637756867; bh=lcAMPWBe99l55Kq0vLMXX+V+uJFrqbZcZWfVapRskv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=isW/oFUd0NyZjTQeLgPoeBLgVpVxWTYXvLFoQnleetHiIXcInVf04Y32sI++eMU50 1JdX2+SXKai1H3Kxc2ei6FmP3sKbZ/LeL2ZhiLWKhsFcLerfNHB5p/DpQSSdBN1VAr HqS/wrDZgtpDRphKuBCwlCKw35M/GpYBtnu4tVXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Dichtel , "David S. Miller" Subject: [PATCH 4.14 234/251] tun: fix bonding active backup with arp monitoring Date: Wed, 24 Nov 2021 12:57:56 +0100 Message-Id: <20211124115718.444003202@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115710.214900256@linuxfoundation.org> References: <20211124115710.214900256@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Dichtel commit a31d27fbed5d518734cb60956303eb15089a7634 upstream. 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/tun.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -858,6 +858,7 @@ static netdev_tx_t tun_net_xmit(struct s { struct tun_struct *tun = netdev_priv(dev); int txq = skb->queue_mapping; + struct netdev_queue *queue; struct tun_file *tfile; u32 numqueues = 0; @@ -916,6 +917,10 @@ static netdev_tx_t tun_net_xmit(struct s if (skb_array_produce(&tfile->tx_array, skb)) goto drop; + /* NETIF_F_LLTX requires to do our own update of trans_start */ + queue = netdev_get_tx_queue(dev, txq); + queue->trans_start = jiffies; + /* Notify and wake up reader process */ if (tfile->flags & TUN_FASYNC) kill_fasync(&tfile->fasync, SIGIO, POLL_IN);