From patchwork Tue Jun 21 06:10:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Liu X-Patchwork-Id: 1645854 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LRx3K0vZjz9sGT for ; Tue, 21 Jun 2022 16:11:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9CA5A40B83; Tue, 21 Jun 2022 06:11:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9CA5A40B83 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3G_NGFTNbJsJ; Tue, 21 Jun 2022 06:11:01 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id C16B840AF3; Tue, 21 Jun 2022 06:11:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C16B840AF3 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8B68EC0032; Tue, 21 Jun 2022 06:11:00 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 28EC2C002D for ; Tue, 21 Jun 2022 06:10:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F18FA60BC0 for ; Tue, 21 Jun 2022 06:10:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F18FA60BC0 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 72ru0jQq_jxP for ; Tue, 21 Jun 2022 06:10:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 583B4608A5 Received: from mail-m2835.qiye.163.com (mail-m2835.qiye.163.com [103.74.28.35]) by smtp3.osuosl.org (Postfix) with ESMTPS id 583B4608A5 for ; Tue, 21 Jun 2022 06:10:56 +0000 (UTC) Received: from localhost.localdomain (unknown [124.126.141.227]) by mail-m2835.qiye.163.com (Hmail) with ESMTPA id 568D98A01B3; Tue, 21 Jun 2022 14:10:47 +0800 (CST) From: Tao Liu To: dev@openvswitch.org Date: Tue, 21 Jun 2022 14:10:39 +0800 Message-Id: <20220621061039.22524-1-thomas.liu@ucloud.cn> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFJQjdXWS1ZQUlXWQ8JGhUIEh9ZQVlCSE4aVklOGEpLGEIfTBkdH1UZERMWGhIXJBQOD1 lXWRgSC1lBWUpJT1VKSU1VSk9KVUlJTFlXWRYaDxIVHRRZQVlPS0hVSkpLSE1KVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MDo6Mzo*LzIOOR4ZGRwyOAIB TRcKCQpVSlVKTU5OTEJKQ09MTE1NVTMWGhIXVQ8TFBYaCFUXEg47DhgXFA4fVRgVRVlXWRILWUFZ SklPVUpJTVVKT0pVSUlMWVdZCAFZQUlKSko3Bg++ X-HM-Tid: 0a8184e28818841dkuqw568d98a01b3 Cc: thomas.liu@ucloud.cn, paulb@nvidia.com, i.maximets@ovn.org, maord@nvidia.com Subject: [ovs-dev] [PATCH v2] netdev-linux: do not touch LAG slaves if master is not attached to ovs. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Bond master netdev may be created without a classification type, due to routing or tunneling code. If bond master is not attached to ovs, the ingress block on slaves shoud not be updated. Simple reproducer: ip a add 10.1.1.1/30 dev bond0 ip l set net3 master bond0 tc q ls dev net3 Fixes: d22f8927c3c9 ("netdev-linux: monitor and offload LAG slaves to TC") Signed-off-by: Tao Liu Reviewed-by: Marcelo Ricardo Leitner Reviewed-by: Roi Dayan --- lib/netdev-linux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 9d12502..b9e0c99 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -682,7 +682,10 @@ netdev_linux_update_lag(struct rtnetlink_change *change) return; } - if (is_netdev_linux_class(master_netdev->netdev_class)) { + /* If bond master is not attached to ovs, ingress block on slaves + * shoud not be updated. */ + if (!master_netdev->auto_classified && + is_netdev_linux_class(master_netdev->netdev_class)) { block_id = netdev_get_block_id(master_netdev); if (!block_id) { netdev_close(master_netdev);