From patchwork Wed Aug 16 22:13:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 802262 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=) 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 3xXkBn5TTTz9t3C for ; Thu, 17 Aug 2017 08:13:36 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CABD3A49; Wed, 16 Aug 2017 22:13:32 +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 DB0519EE for ; Wed, 16 Aug 2017 22:13:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B2D76189 for ; Wed, 16 Aug 2017 22:13:30 +0000 (UTC) X-Originating-IP: 209.85.215.48 Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (Authenticated sender: joe@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6053341C086 for ; Thu, 17 Aug 2017 00:13:29 +0200 (CEST) Received: by mail-lf0-f48.google.com with SMTP id f7so2608311lfg.4 for ; Wed, 16 Aug 2017 15:13:29 -0700 (PDT) X-Gm-Message-State: AHYfb5hM2Om3kCG/BfB87aAVHIjSAz2GexgpGCQQwjz5YJ0+PW2PvgTB N7xvJubEmwzUvJkiucqf/+ECPD2Kng== X-Received: by 10.46.9.16 with SMTP id 16mr1302851ljj.155.1502921608637; Wed, 16 Aug 2017 15:13:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.83.25 with HTTP; Wed, 16 Aug 2017 15:13:08 -0700 (PDT) In-Reply-To: <1502885528-4453-3-git-send-email-roid@mellanox.com> References: <1502885528-4453-3-git-send-email-roid@mellanox.com> From: Joe Stringer Date: Wed, 16 Aug 2017 15:13:08 -0700 X-Gmail-Original-Message-ID: Message-ID: To: Roi Dayan Cc: ovs dev , Simon Horman Subject: Re: [ovs-dev] [PATCH V3 2/2] dpif: Fix cleanup of netdev_ports map 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 On 16 August 2017 at 05:12, Roi Dayan wrote: > Executing dpctl commands from userspace also calls to > dpif_open()/dpif_close() but not really creating another dpif > but using a clone. > As for netdev_ports map is global we avoid adding duplicate entries > but also need to make sure we are not removing needed entries. > With this commit we make sure only the last dpif close should clean > the netdev_ports map. > > Fixes: 6595cb95a4a9 ("dpif: Clean up netdev_ports map on dpif_close().") > Signed-off-by: Roi Dayan > Reviewed-by: Paul Blakey > --- Thanks Roi. Usually we apply the test that shows the failure after we apply the fix, so that the breakage isn't introduced anywhere on the tree - so the patches would be rearranged. Can we also roll in the following style incremental? diff --git a/lib/dpif.c b/lib/dpif.c index 121a26db0c37..0c8b91b68b24 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -428,8 +428,8 @@ dpif_create_and_open(const char *name, const char *type, struct dpif **dpifp) return error; } -static -void dpif_remove_netdev_ports(struct dpif *dpif) { +static void +dpif_remove_netdev_ports(struct dpif *dpif) { struct dpif_port_dump port_dump; struct dpif_port dpif_port;