From patchwork Tue Mar 19 09:23:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 1058313 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NnjB5cjzz9s5c for ; Tue, 19 Mar 2019 20:25:49 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5A82A3709; Tue, 19 Mar 2019 09:25:46 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 4CB7336A9 for ; Tue, 19 Mar 2019 09:23:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C826C855 for ; Tue, 19 Mar 2019 09:23:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 262F73168900 for ; Tue, 19 Mar 2019 09:23:35 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-79.ams2.redhat.com [10.36.116.79]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4F3F1A7D8 for ; Tue, 19 Mar 2019 09:23:34 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Tue, 19 Mar 2019 09:23:30 +0000 Message-Id: <155298740972.37904.5761805205559576350.stgit@dbuild> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 19 Mar 2019 09:23:35 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [RFC PATCH] vswitchd: warn about misconfigured interface type on netdev bridge X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org When debugging an issue we noticed that by accident someone has changes the bridge datapath_type to netdev, where it's clearly a kernel (system bridge) with physical and tap devices. Unfortunately, this is not something you will easily spot, as the bridge datapath type value is not shown by default. In addition, OVS is not warning you about this potential mismatch in interface and bridge datapath. I'm sending out this patch as an RFC as I could not find a clear demarcation between bridge datapath types and interface datapath types. The patch below will at least warn for netdev bridges with system interfaces. But no warning will be given for some unsupported virtual interfaces. For system bridges, the dpdk types will no be recognized as system/virtual interfaces (unless the name exists) which will result in an error. Signed-off-by: Eelco Chaudron --- vswitchd/bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index a427b0122..42c33d1d9 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1808,6 +1808,12 @@ iface_do_create(const struct bridge *br, goto error; } + if (!iface_is_internal(iface_cfg, br->cfg) + && !strcmp(br->type, "netdev") + && !strcmp(netdev_get_type(netdev), "system")) { + VLOG_WARN("bridge %s: interface %s is a system type where the bridge " + "is a netdev one", br->name, iface_cfg->name); + } VLOG_INFO("bridge %s: added interface %s on port %d", br->name, iface_cfg->name, *ofp_portp);