From patchwork Wed Sep 29 14:33:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: miter X-Patchwork-Id: 1534415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.a=rsa-sha256 header.s=selector1 header.b=pGd9L021; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HKJlT2n0Rz9sRf for ; Thu, 30 Sep 2021 00:33:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2F29960BE0; Wed, 29 Sep 2021 14:33:39 +0000 (UTC) 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 j3v9COj2ozuf; Wed, 29 Sep 2021 14:33:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 72FBB60704; Wed, 29 Sep 2021 14:33:37 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 47592C000F; Wed, 29 Sep 2021 14:33:37 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7D7E3C000D for ; Wed, 29 Sep 2021 14:33:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 556B2402AF for ; Wed, 29 Sep 2021 14:33:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=outlook.com 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 jwLtgM2-ERuj for ; Wed, 29 Sep 2021 14:33:34 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01olkn2160.outbound.protection.outlook.com [40.92.63.160]) by smtp2.osuosl.org (Postfix) with ESMTPS id D07FC40015 for ; Wed, 29 Sep 2021 14:33:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gt4mHjmYRr5vcrmYL3eNswvNBfcpDLHkWdd6+qirtrd1dqw0FPN4SsrZydO9NSWKk3j66vMesmyQWT93PGheTlQvgeCLt3+xqJmhptrPpoeOUa1DFCSql2wV1KfE21B8Or3MpxbfrnPh2C+H45qgy9jkjGZqhK7kR9ECqvAH47SOSJzrYLOiszV9bOvFdt+yrpxlx2S7bK9LflrPAHIcVwfXgupnscbZm5Yqnyjh0dfMZDbD4FRDGw2zchEAsASozegjAOOu9zYF5t7sPLiCCQu2sfE/OFoCY6+mbWAL7wBZBstzHOOb4AFo7acfIJFS8lhBuqw1qNf0XZgNsD6Ufg== 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; bh=2LwkfvJLBMN99LUy70a7nL/5mH0Q14isSpGfpvJh1AY=; b=P+DMNuNpT83Ue3xvkvIZTtpMX1mdMNZGWQ5vTasfxZVFImVvRYOoIY8zvzT0uvpDQ62emu8f4ib5EY3gS0rYwsoMYc498VFfAhUUQ/vWZEeYt1Lp9o/Xhb2Xx9flUuEj8zudedeY0YyNqrsmc7lFCWakaNJpj9h0GmGdNeEzaSrEf3DoWLtWwn4SEUHSz1Q3muRe+P24gWnHebuKnGzyQ7URH/yzR99DAsU7RAfC0E+3jtGZqgBea2DfkHx8wLrGGc3hhuORWcQ4D/LC3iXSfhzjZNOyKhzWiTB7PfNYW3aldVrAzWIX535nsr4JH5oSkc91pnqfEl00EE0c1vk1BA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2LwkfvJLBMN99LUy70a7nL/5mH0Q14isSpGfpvJh1AY=; b=pGd9L021urmz2ucywQulOSntBWoIfgi9kF1+8WVFWmv2t/Dyp4j6egKlOj+lFYb4qcH3mU5It3++Dvou/26skEe244u8p6lLcnIBNJGpFdUJlHtDhemI6yoSgvJ7wAKINMk3UoyWfl34gQboyCl7NPwMOFAaT6hwXhVdeYy4LYLHeF2Yaz7TVMqwGv83ke94tcUlPd8MvjgKB3XhConXSme2ZNB5X3obwAy0DoqOH4shH/g3BkjZQ3FfGRt7UnoeqVfNveJ3pIwLUpg1XkgOLuq6wqIkfkA28ZpPasPc7tQ+CudCgjlhaFQo0HNg5u8CvBj6gPfE5ynZPEui83VpPQ== Received: from MEYP282MB3302.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:15b::24) by MEYP282MB3072.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:14b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Wed, 29 Sep 2021 14:33:26 +0000 Received: from MEYP282MB3302.AUSP282.PROD.OUTLOOK.COM ([fe80::e004:370e:5de0:b235]) by MEYP282MB3302.AUSP282.PROD.OUTLOOK.COM ([fe80::e004:370e:5de0:b235%9]) with mapi id 15.20.4544.022; Wed, 29 Sep 2021 14:33:26 +0000 From: lin huang To: "dev@openvswitch.org" Thread-Topic: [PATCH] netdev-vport : Fix userspace tunnel ioctl(SIOCGIFINDEX) info logs. Thread-Index: AQHXtT5gebtizRHbOUOWA+Tw/BijCw== Date: Wed, 29 Sep 2021 14:33:26 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 258ff194-7ee7-cd49-dc23-f6d7b7788867 x-tmn: [Jj0eiaLFFmnlmS288Tl5saaQtkAUbwLq] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 26d233fc-67d6-450f-dba8-08d983561987 x-ms-traffictypediagnostic: MEYP282MB3072: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P15Ajs29PVx0ULjDw0Wgg6JpDdLrDqva1yFSEnat0h9HHYXan3NiU48fuSdDTW/CpCLfcZuq6Q8r1WpECck4WjJyt/0+OuvdBDYR4LnJGIxGKCNIbPdS0exbi4XhWchTNYfkxAQs1YAuyWFxW+D0hFvdxGWSL1XMli9xWCguD6z1+DY6LGCATdx47g3VJIR9yxp8rgYRFiXblCDSM42rIlukLp+qFcoU6wbkUpylvtSboV7UXircwuHjpGH+E7+TLWSYSzx6yGGGcY1DdYgDE7733H2OBfKWpZPidP0xQMK73XIUPJjV21fZHlSXE418MfrUP9ncXJ5iqeg2P1zZyVcP9+2cjqv7TRjEEJ713+zoBC1xA/igFMXhJq6nwIhEXY3zxrLNw9iBhz0ZOdEBaxL9W03NF/09HhpsA3Ekvte0RJKk8y61xcqC/Cx9/fTk x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: nmQGl+6DCTEYy00PAsQf3k2uxUcr/CYJLuyFQEFCWb/1zkkrzuhG7z7WLsCBs9RWnAWIJvnMhRgLi0v+qmD55Eq+N7DGDvD/EHdbn2EcfSDl+eje8IVvOVTqW+7GnDXdVEXcXX5+7wLwb2DS2GKKkA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MEYP282MB3302.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 26d233fc-67d6-450f-dba8-08d983561987 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2021 14:33:26.7300 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MEYP282MB3072 Cc: "david.marchand@redhat.com" , Ilya Maximets Subject: [ovs-dev] [PATCH] netdev-vport : Fix userspace tunnel ioctl(SIOCGIFINDEX) info logs. 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" From: linhuang Userspace tunnel doesn't have a valid device in the kernel. So get_ifindex() function (ioctl) always get error during adding a port, deleting a port or updating a port status. The info log is "2021-08-29T09:17:39.830Z|00059|netdev_linux|INFO|ioctl(SIOCGIFINDEX) on vxlan_sys_4789 device failed: No such device" If there are a lot of userspace tunnel ports on a bridge, the iface_refresh_netdev_status() function will spend a lot of time. So ignore userspace tunnel port ioctl(SIOCGIFINDEX) operation, just return ifindex=0. Signed-off-by: linhuang --- lib/netdev-vport.c | 3 ++- vswitchd/bridge.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.12.2 diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 499c0291c..90e21f213 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -1151,8 +1151,9 @@ netdev_vport_get_ifindex(const struct netdev *netdev_) { char buf[NETDEV_VPORT_NAME_BUFSIZE]; const char *name = netdev_vport_get_dpif_port(netdev_, buf, sizeof(buf)); + const char *type = netdev_get_dpif_type(netdev_); - return linux_get_ifindex(name); + return (strncmp(type, "netdev", 6)) ? linux_get_ifindex(name) : 0; } #define NETDEV_VPORT_GET_IFINDEX netdev_vport_get_ifindex diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index cb7c5cb76..1325f80c0 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2052,6 +2052,8 @@ iface_do_create(const struct bridge *br, goto error; } + netdev_set_dpif_type(netdev, br->type); + error = iface_set_netdev_config(iface_cfg, netdev, errp); if (error) { goto error;