From patchwork Fri Jul 15 23:26:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12919915 X-Patchwork-Delegate: kuba@kernel.org 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 D78D9C43334 for ; Fri, 15 Jul 2022 23:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbiGOX1i (ORCPT ); Fri, 15 Jul 2022 19:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232531AbiGOX1X (ORCPT ); Fri, 15 Jul 2022 19:27:23 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2078.outbound.protection.outlook.com [40.107.20.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6550D95B27 for ; Fri, 15 Jul 2022 16:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fFaeS8MR7zHu11vFXfpkuCv/OlSETZAOjkmROMD3ntsYDyagEhigpw2+5Elsvk0bPIMu25fBspOTL+avolkunTM+s403jwpbare8egQqyzL1LG05W3IWnBlhiWuQP99gatSPySo2ma49crCi1iOci0MMSC+21lH/QDA9vuubAkcJwUJ/f8qcD3cDaXu7plcFZAD6Z5w5OmR+PS5F9tpqC3mDsfDmo5RUaM4u9AweY4sMGx1PPoOaM6fHQQTUoBDveofdIdacWjT112lzcaLUo6YGwK0OSXzwCyD5kDbOTUZYaKhTLi+WdOOJSjP0BS/Cskx6iitkdY2zB/HelFLFHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HV6kGXxdfBdgL42nF/HH1aZFxuJJBAbh8SL35l/+o5g=; b=k5RFBvA8+QcAw+A+upmF+cclu4oobvXpPeRU7PAVwSiGCYPzBEKgYjQuKwC9Xwo/xdF7VHUwlJTL4ij2CUb9MFuEBA2DEML/dp8/dlpSMrjYdIHKjRJ2TrgudD1gT59UaFoZ9RB6U/uCWP+F8trp2QMelmPR//DJ/uB9CqyayvHIjvQejrXkL4rvh2FdJpYeV9RzZ1kHzG8YVEoi3QiBjpBje3MCM2R4+aP/8++G9aCLpexI/MWtqkAMCIflSWzg21zgGJUWJFKIbJWkYamzn6UaCQm84qerakSwjPTbe/uYmHrEA1oE6kt92cQOvZ+bCoAsmERfPMvvsbXIFhB8SA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HV6kGXxdfBdgL42nF/HH1aZFxuJJBAbh8SL35l/+o5g=; b=Q5owLgWpb/3P77fHkbV6gjQk+XVx8XA9YtWK4oCf6DTlNmkzTmd3IpV3+dJ9NmkvLp+jKp7DuuFT2n+2NmKBW9wZEtgFfDEv7iKfoCdGlIDmsibZYhO3Or9q7p5WSZBLBkyWYbxbPoz1rZS/6738ua2hdKOCinSPRH6ChqEAWXQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by AS8PR04MB8707.eurprd04.prod.outlook.com (2603:10a6:20b:42a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.20; Fri, 15 Jul 2022 23:26:50 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::71b7:8ed1:e4e0:3857]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::71b7:8ed1:e4e0:3857%4]) with mapi id 15.20.5438.015; Fri, 15 Jul 2022 23:26:50 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org 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 Subject: [PATCH net] net: dsa: fix bonding with ARP monitoring by updating trans_start manually Date: Sat, 16 Jul 2022 02:26:41 +0300 Message-Id: <20220715232641.952532-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR02CA0109.eurprd02.prod.outlook.com (2603:10a6:20b:28c::6) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e02fe347-2a66-4186-89e1-08da66b97e37 X-MS-TrafficTypeDiagnostic: AS8PR04MB8707:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kW14HJ3JE5/pR8LEZdUtT9kCJuzaIgdplsnousQN67mp6YoOUw2SILXy+dRLvPh43wC7dxRa2Fwu0kTY2jfCmb5xbz5cFDNQScMf1ksbGxWO7EuwLjRtiXi7FgudnDsmNxmHct+oksOQw3BFw5s6L5PQMhMM+Q2VvWbf59Cn+sHeRsSfaRsaNs7Dhn3YeCGKw2DsMECxfBFUErPtdWkyuMdhZX/aoKER5WfaIeRQ27p1F4M6Rt8tAblJc6K6E/rR7eA+H354uw+5JW7+w4ukmrVA6zGxHOSD+EAQwVa2qb/3e9U4YU+GY6ky5V9n58gErLr/yG/4C2EN6+xcs3tOXigCNVVkhfXvXHWTP3hZ9iL0AonhxE73XP/chN4LW3DeL+6b+snKVA2PVZRp5iINAJwVDLnTtbDTbg9q76hDkco0PMZJuCGF+AjvIHqe51KmMSCkBijR3B7xHR6m2pl2XGA0aARn8D+l01OeCbig7ksB2b6JupRbaUd7mlQkJ/c5/W01R1fqsGvdLE0a9GlO/yNxRsTw9R3WMGB/sIf5s9cxMSJaSrTHX3rBAKuRXvwmN/JvOj5szv92qVAT/6xNUA1rcrVxIuDxNbjVV/pUdwB2L2BroGgWm9XBZOZzFSLxkV6jo0JpxHtYNK2/MLqqx6ZAMq5rR3osNOAoQ40oK/aXENczEa7fIcYGqzwXjJxQQ7OK/X/2En3XNyNwdgi7q5iB2IIyZN8QY6eEsrBFo2M0U+Iahk7oqXwKiTVAdhZsOJrYY6ZUbaZxQJyIOCoQdz/THMNlOh83d90AO9AGdMrmNmUY8AdYpvE9qmBIpcio X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(346002)(376002)(136003)(39860400002)(396003)(186003)(6666004)(41300700001)(2906002)(6512007)(26005)(1076003)(6506007)(2616005)(38100700002)(38350700002)(86362001)(52116002)(83380400001)(8936002)(8676002)(316002)(54906003)(4326008)(6916009)(5660300002)(7416002)(66476007)(66556008)(66946007)(36756003)(44832011)(6486002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fAGpTUnhOERt6hETRmF/YZia1/pj6CPPVoEYjToEwevWlVob/7Hvr3wnCJRcWJmPmIv94W4fI3Y/KUXN9d+LPBRwQtvEc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xtZGcP6QrPDFOWYfjE+ktnH+md92dlPk9BYROKt4CSOU3tgGH3oUWj5kdKe6/kixHvLkBbzo0JvugmT9CTjtJkBHF4uhcoQvEUou8imsIphrrL8HnVjfDhVhDikvgrmo80fQtnhbUU5O8cBiZ84+TlLdZ15sjxeD21TCIKeFMlFVf5t1flBTDtkOxOEQhk0W/ijT4iSn1dvPj/m94nyf7oZxqlbPfvsN/zGH9sxPq/aXIW15kRN243Tzj5au+giY3/K1hFetFwJ7IxsYUAbHvAqg+5eR7dyb81ERp9AiIIETK0WLVvsia+ma1aSw+fsWlN2OCq+B3X+z1YrstghQnE56+oklRPLvpXGA3DZavwDhLWIfEEMzhgDp6bpqG1fTnW9BpCqZy8jwo65W1xFwISAKKQjGqH1oXaKPzHKG8OabX4/c9JVesnUs3ZZ5DW0tzDmu/A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e02fe347-2a66-4186-89e1-08da66b97e37 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 23:26:50.0773 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 61lghcOQN57miUKtsayuW+3OjzJuDpTkchleagQd18p7KRR/p0x0rLyfAW+TWQu7gostu2zqQoC4qYA1whk6Ng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8707 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- 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 */