From patchwork Wed May 31 01:22:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fukaige X-Patchwork-Id: 768846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wct6t1s7Cz9s7q for ; Wed, 31 May 2017 11:24:21 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 132F295E; Wed, 31 May 2017 01:24:07 +0000 (UTC) X-Original-To: ovs-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 4F39894B for ; Wed, 31 May 2017 01:24:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C311A15F for ; Wed, 31 May 2017 01:24:04 +0000 (UTC) Received: from 172.30.72.54 (EHLO DGGEML401-HUB.china.huawei.com) ([172.30.72.54]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AOO05965; Wed, 31 May 2017 09:23:45 +0800 (CST) Received: from localhost (10.177.245.74) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server id 14.3.301.0; Wed, 31 May 2017 09:23:41 +0800 From: fukaige To: Date: Wed, 31 May 2017 09:22:22 +0800 Message-ID: <1496193742-15968-1-git-send-email-fukaige@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.245.74] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.592E1B24.00DD, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2aea4d54c26e2c39a402c66d1c4cfc9b X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD 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] [PATCH v1] netdev-linux: Remove device in netdev_shash when deleted 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 Start a virtual machine with its backend tap device attached to a brought up linux bridge. If we delete the linux bridge when vm is still running, we'll get the following error when trying to create a ovs bridge with the same name. The reason is that ovs-router subsystem add the linux bridge into netdev_shash, but does not remove it when the bridge is deleted in the situation. When the bridge is deleted, ovs will receive a RTM_DELLINK msg, take this chance to remove the bridge in netdev_shash. ovs-vsctl: Error detected while setting up 'br-eth'. See ovs-vswitchd log for details. ovs-vswitchd log: 2017-05-11T03:45:25.293Z|00026|ofproto_dpif|INFO|system@ovs-system: Datapath supports recirculation 2017-05-11T03:45:25.293Z|00027|ofproto_dpif|INFO|system@ovs-system: MPLS label stack length probed as 1 2017-05-11T03:45:25.293Z|00028|ofproto_dpif|INFO|system@ovs-system: Datapath supports unique flow ids 2017-05-11T03:45:25.293Z|00029|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_state 2017-05-11T03:45:25.293Z|00030|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_zone 2017-05-11T03:45:25.293Z|00031|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_mark 2017-05-11T03:45:25.293Z|00032|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_label 2017-05-11T03:45:25.364Z|00001|ofproto_dpif_upcall(handler226)|INFO|received packet on unassociated datapath port 0 2017-05-11T03:45:25.368Z|00033|netdev_linux|WARN|ethtool command ETHTOOL_GFLAGS on network device br-eth failed: No such device 2017-05-11T03:45:25.368Z|00034|dpif|WARN|system@ovs-system: failed to add br-eth as port: No such device 2017-05-11T03:45:25.368Z|00035|bridge|INFO|bridge br-eth: using datapath ID 00002a51cf9f2841 2017-05-11T03:45:25.368Z|00036|connmgr|INFO|br-eth: added service controller "punix:/var/run/openvswitch/br-eth.mgmt" Change-Id: Ib5ead59bc91453f83549da89937c0d3607e0385e Signed-off-by: fukaige --- lib/netdev-linux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 1e03c75..fae78e5 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -73,6 +73,7 @@ #include "timer.h" #include "unaligned.h" #include "openvswitch/vlog.h" +#include "tnl-ports.h" VLOG_DEFINE_THIS_MODULE(netdev_linux); @@ -749,6 +750,7 @@ netdev_linux_update(struct netdev_linux *dev, dev->get_ifindex_error = 0; } else { netdev_linux_changed(dev, change->ifi_flags, 0); + tnl_port_map_delete_ipdev(dev->up.name); } } else if (rtnetlink_type_is_rtnlgrp_addr(change->nlmsg_type)) { /* Invalidates in4, in6. */