From patchwork Thu Apr 27 11:32:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 1774427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=mv1L3zyz; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q6YXJ5dZHz23v8 for ; Thu, 27 Apr 2023 21:33:35 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E2EC380CF2; Thu, 27 Apr 2023 11:33:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E2EC380CF2 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=mv1L3zyz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DKpB7FwRGVC9; Thu, 27 Apr 2023 11:33:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id DC6B583CE5; Thu, 27 Apr 2023 11:33:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DC6B583CE5 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AD297C0036; Thu, 27 Apr 2023 11:33:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3735AC002A for ; Thu, 27 Apr 2023 11:33:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D28E840510 for ; Thu, 27 Apr 2023 11:33:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D28E840510 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=mv1L3zyz X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h1z0bpydU5yN for ; Thu, 27 Apr 2023 11:33:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8B2684043D Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20605.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::605]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8B2684043D for ; Thu, 27 Apr 2023 11:33:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wl2PNL2RUEUfcYN2lGQ/F2MqFdB1m50h5eapA+dH2NPBUCL8NlvAzU6JjxO5+08T7QUBUWyU2lCp79RBDGU2oPE0DtkKQ2exOY9V/DtKVfbZKVKkUb7uCwWP5nUu0w+hJa5AtxW2O9Af+y6H0lbA4b21+uKbrZZ0dCN2p4NNvtwUI1bCrnI6FydVR8Tsvm10PBJ6hvFDi6X+3SjbAZEwWKPIv0aKHmHM62SQrtqmp0ifZtYKhbltil9ntf7QsgVIQAFjPzT/UvZ6Agj3BNFj8dEOgZR3fJCQy00kTpO5trs8ZLWrb8s0Y10wVOzQwI1qxz+9L0Ru40y/ABJ3Bgxrnw== 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=uTFcME2NVbskgIleEkM489K2jbTczCH6n68Gp6weIEw=; b=IV9acv+N8zNSQfxUT9MBsfmIUwRDXnvIwN/FjGTnNJ45aVZAQdZnLsMXwW/idOYgvPuWjGanB0bN5+gWlOAJNOb5PVxR67a9VC8a7n1p12quB5WRaXvqyfbf6/WppnNFKkuoTCxzUr1LBSercQn9P+lhTgOWJ6UsuDntGMyWUYCXOK4zVNuzPXkINalYfF+rZ/bzaJyBybHDacKp9VFq0/xmxBCUKQt8OmXf7UeCqbZ5y/Dwv4XVYefKEnzfYj2PXJIq0fwFF+45GqTAk5gJUua/L9dEZ4SOB/2oM4t5EvOwl786FdkMY8QpYCZQv0W3XV4KDDIyEUkvb77yLUkCVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uTFcME2NVbskgIleEkM489K2jbTczCH6n68Gp6weIEw=; b=mv1L3zyzsDkV/3JqGXQj0y6+zWNcL7F0ffld9DgYUsdcpw8C/QH7axaUzzZ9ocau8BcfoT6Wipnx4GNnivc0PmYbZDIkgKQoGptLKB2kyTCe2GeOwSNU+W8BWTwWADttZU7+oHkpxGBqGU1ZhxZCcxxqdNtKbBCMruf1yNJgzt23us2ikWvlPo6lTsZ+Dy7rSwEZ4q/3XBgmzy0GZ0qelZ2HlqHAJTHTnwK870NP11jQpjEJzbm+yQbD+X4tdtaOLgMBz0aKpQMx8S0v23F/NkKCmP4OJoQ792bLks1mWqf4WKjE1d6ZOw34TkABVaR0Sf6VMupv6HHWdkoMQxO9iQ== Received: from MW4PR02CA0015.namprd02.prod.outlook.com (2603:10b6:303:16d::6) by BY5PR12MB4904.namprd12.prod.outlook.com (2603:10b6:a03:1d3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22; Thu, 27 Apr 2023 11:33:18 +0000 Received: from CO1NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:303:16d:cafe::f4) by MW4PR02CA0015.outlook.office365.com (2603:10b6:303:16d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22 via Frontend Transport; Thu, 27 Apr 2023 11:33:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT006.mail.protection.outlook.com (10.13.174.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22 via Frontend Transport; Thu, 27 Apr 2023 11:33:18 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Thu, 27 Apr 2023 04:33:06 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Thu, 27 Apr 2023 04:33:05 -0700 Received: from dev-r-vrt-138.mtr.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Thu, 27 Apr 2023 04:33:04 -0700 To: Date: Thu, 27 Apr 2023 14:32:58 +0300 Message-ID: <20230427113258.2508263-1-roid@nvidia.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT006:EE_|BY5PR12MB4904:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d65c947-c95c-4f3a-9d07-08db471332a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jkw48Wvm4oRUsbqVjvqfyitFovI++qITEmbiwPMGXhFp4X2e4rJ4sDlZb+lLBKc9FOf9dOc+ob8diEiL/hq52KcPAnW2IA1SInFODwgMukQDDjMp2s2NvOjrc8o4NPtoNBWatA0LUmqEvx7B3dK7Nt3zWgah/CiDBGmYgMryhFllYGi/m9/K25mLm1Ti+jyLgdHnC9YGp8UFJxHCjQxg7sK6sLdMxk44g4Oben+rt9XyDwV/auRTJS7rmvlb6zY7OlKxLWpHBRzWRqJmLDiX/lckrB3gs2ZKrGWOF77P3B1gYx7axFqSebcEnr47XVgeFIG9JsqUJ/uEtP8+icYiabVgaS8nDjY/AWINRc7UQkpvlAe2WorUlGzMQzCLj4VC3n91ub2Y6h7e5C+jk0i47Jsrl4/sXNYg84MUi+G558IRiIl+oV6NJxwMbRtcttuRRg+uZZEvdw7QYgzDmRhkmjLv3E/9dr2bljuq5iaHZhu3ikVZWRjk59b5e+jAmc9ObHB5W4URe/9DGojuBvn1V0hs393n0h7aWrXWJbHAU00fCA2jxMRV0iBlgakOxjYYcNrXN4yZfqS1MA63aSDEex2ozyhGQr3F8XNjhUX62UtocvYhmqSn9EsEc8U8wZvEaz87p8ZgwnpNPHYLWYYsWQWl8Qg2GO1qwxB7TZzjsqDfj5xi1NJ9JumCojT39DtRVltGRLZPfgErV2U/3xbd5toOHHNmPMWN09/eXAQYmzI= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199021)(46966006)(36840700001)(40470700004)(86362001)(47076005)(36756003)(82310400005)(2906002)(40480700001)(6666004)(34020700004)(186003)(83380400001)(2616005)(36860700001)(426003)(336012)(26005)(1076003)(70206006)(4326008)(6916009)(70586007)(478600001)(40460700003)(54906003)(316002)(82740400003)(356005)(7636003)(41300700001)(8676002)(5660300002)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2023 11:33:18.1422 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d65c947-c95c-4f3a-9d07-08db471332a9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4904 Cc: Simon Horman , Ilya Maximets Subject: [ovs-dev] [PATCH v2 1/1] tc: Fix cleaning chains 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: , X-Patchwork-Original-From: Roi Dayan via dev From: Roi Dayan Reply-To: Roi Dayan Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Sometimes there is a need to clean empty chains as done in delete_chains_from_netdev(). The cited commit doesn't remove the chain completely which cause adding ingress_block later to fail. This can be reproduced with adding bond as ovs port which makes ovs use ingress_block for it. While at it add the netdev name that fails to the log. Fixes: e1e5eac5b016 ("tc: Add TCA_KIND flower to delete and get operation to avoid rtnl_lock().") Signed-off-by: Roi Dayan --- Change-log v2: - Add comment in code about using tc del filter without TCA_KIND. lib/netdev-offload-tc.c | 11 ++++++++--- lib/tc.c | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c index c9662081fc60..4f26dd8cca5f 100644 --- a/lib/netdev-offload-tc.c +++ b/lib/netdev-offload-tc.c @@ -525,7 +525,11 @@ delete_chains_from_netdev(struct netdev *netdev, struct tcf_id *id) */ HMAP_FOR_EACH_POP (chain_node, node, &map) { id->chain = chain_node->chain; - tc_del_flower_filter(id); + /* Delete empty chain doesn't seem to work with + * tc_del_flower_filter() so use tc_del_filter() + * without specifying TCA_KIND. + */ + tc_del_filter(id, NULL); free(chain_node); } } @@ -2879,8 +2883,9 @@ netdev_tc_init_flow_api(struct netdev *netdev) error = tc_add_del_qdisc(ifindex, true, block_id, hook); if (error && error != EEXIST) { - VLOG_INFO("failed adding ingress qdisc required for offloading: %s", - ovs_strerror(error)); + VLOG_INFO("failed adding ingress qdisc required for offloading " + "on %s: %s", + netdev_get_name(netdev), ovs_strerror(error)); return error; } diff --git a/lib/tc.c b/lib/tc.c index 4c07e22162e7..5c32c6f971da 100644 --- a/lib/tc.c +++ b/lib/tc.c @@ -2354,7 +2354,9 @@ tc_del_filter(struct tcf_id *id, const char *kind) struct ofpbuf request; request_from_tcf_id(id, 0, RTM_DELTFILTER, NLM_F_ACK, &request); - nl_msg_put_string(&request, TCA_KIND, kind); + if (kind) { + nl_msg_put_string(&request, TCA_KIND, kind); + } return tc_transact(&request, NULL); }