From patchwork Thu Apr 26 07:12:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linhaifeng X-Patchwork-Id: 904890 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=none (p=none dis=none) header.from=huawei.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 40WpFb1J8kz9s0W for ; Thu, 26 Apr 2018 17:13:38 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D95C9407; Thu, 26 Apr 2018 07:13:34 +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 79458253 for ; Thu, 26 Apr 2018 07:13:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from huawei.com (unknown [45.249.212.35]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C80FF6CD for ; Thu, 26 Apr 2018 07:13:32 +0000 (UTC) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D68D7238F8AFE for ; Thu, 26 Apr 2018 15:13:28 +0800 (CST) Received: from localhost (10.177.20.223) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 26 Apr 2018 15:13:21 +0800 From: Haifeng Lin To: Date: Thu, 26 Apr 2018 15:12:51 +0800 Message-ID: <1524726771-17384-1-git-send-email-haifeng.lin@huawei.com> X-Mailer: git-send-email 1.8.5.2.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.20.223] X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 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] dpif-netdev:Delete port check in do_add_port 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 It is not need check port exist in do_add_port because it had check in port_add. Change-Id: Ie66206b40e305cef5f5b20af765c3128ccec6782 Signed-off-by: Haifeng Lin --- lib/dpif-netdev.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index be31fd0..f7976b1 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1568,11 +1568,6 @@ do_add_port(struct dp_netdev *dp, const char *devname, const char *type, struct dp_netdev_port *port; int error; - /* Reject devices already in 'dp'. */ - if (!get_port_by_name(dp, devname, &port)) { - return EEXIST; - } - error = port_create(devname, type, port_no, &port); if (error) { return error;