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 25F5CC433FE for ; Wed, 24 Nov 2021 12:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244429AbhKXMcY (ORCPT ); Wed, 24 Nov 2021 07:32:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:42362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245301AbhKXMZR (ORCPT ); Wed, 24 Nov 2021 07:25:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D15E161108; Wed, 24 Nov 2021 12:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637756150; bh=Wy0zgEHaPo5WFsIcANYq3Jg9Lg3HHQlbR3eyo1u/Ftg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=km3LVJ6rvRqHvrtpgnOxMVeHzAMl8lHaaeR62rcvrKn/SX1Ud2H5R9ukNbyYdcyyq VTlvO5YPCM3ti0jBy71Q/P81U9PN7p68EvZaFX87JAYq+TiEc+xjGAbBc/1P7Cypwy LYoFzvF+Oq85DRciQiZcM6CF8QOovnX8U8zdMZGg= 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.9 190/207] tun: fix bonding active backup with arp monitoring Date: Wed, 24 Nov 2021 12:57:41 +0100 Message-Id: <20211124115710.109913289@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115703.941380739@linuxfoundation.org> References: <20211124115703.941380739@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 @@ -855,6 +855,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; @@ -920,6 +921,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);