From patchwork Thu Jul 20 22:40:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 791785 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 3xD87f6xwHz9s83 for ; Fri, 21 Jul 2017 08:43:26 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D7C7CB2A; Thu, 20 Jul 2017 22:41:45 +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 564DFAEF for ; Thu, 20 Jul 2017 22:41:42 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0801D16A for ; Thu, 20 Jul 2017 22:41:41 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id q85so3364405pfq.2 for ; Thu, 20 Jul 2017 15:41:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:content-transfer-encoding; bh=hZgmqmA5WutK4QZmJT04vhJ/Vtj/+v71ExOOScbgB84=; b=QmO4DLaRJMJLSwMOk1wKKyHfOxoKgmtU7S5I3+9UIZGOdi+k5YzxoqeTaAjLdmumhe ts9T7+he/uFY4/XzjtP+/ldzeddqj0z14EK0aY1JzDo4baBv4sM9D7D3u2LIcTty+80w y9PX5Ent5pabT2pS7F9x0M0z9mDPwifr1zhOkLwq74yVo6tQMhdUmS6nmfnzcI4e4Osb 3UXt1s7nPfunvRTSe4ZekNYc44TneWozDddkiZerEwdwY0QTsd/NUv8QdGfP96I/4REU pDzGS2Y6z+8goIvCIGEGPhK/o/0EW8Kif72sa4KDUZExtkd7BdoFxDXTBfkaYnHplht1 imPw== X-Gm-Message-State: AIVw110GdzbOJex+Du2PZIy3FmK6TbB4eNUGsGJMm3rkuRCdij4sKpmw nQM2Wr95W95qGk89 X-Received: by 10.84.241.13 with SMTP id a13mr5754785pll.307.1500590501588; Thu, 20 Jul 2017 15:41:41 -0700 (PDT) Received: from centos.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id b4sm5231029pgc.9.2017.07.20.15.41.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 15:41:40 -0700 (PDT) From: Andy Zhou To: dev@openvswitch.org Date: Thu, 20 Jul 2017 15:40:39 -0700 Message-Id: <1500590443-11562-4-git-send-email-azhou@ovn.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1500590443-11562-1-git-send-email-azhou@ovn.org> References: <1500590443-11562-1-git-send-email-azhou@ovn.org> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [clone optmization 3/7] ofproto-dpif: Remove dpif/disable-dp-clone command. 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Use 'dpif/set-dp-features' command instead. Signed-off-by: Andy Zhou --- ofproto/ofproto-dpif-xlate.c | 11 ----------- ofproto/ofproto-dpif-xlate.h | 1 - ofproto/ofproto-dpif.c | 24 ------------------------ tests/ofproto-dpif.at | 4 +--- 4 files changed, 1 insertion(+), 39 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 44074b37320c..a03c27e5b860 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -6993,17 +6993,6 @@ xlate_mac_learning_update(const struct ofproto_dpif *ofproto, } void -xlate_disable_dp_clone(const struct ofproto_dpif *ofproto) -{ - struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp); - struct xbridge *xbridge = xbridge_lookup(xcfg, ofproto); - - if (xbridge) { - xbridge->support.clone = false; - } -} - -void xlate_set_support(const struct ofproto_dpif *ofproto, const struct dpif_backer_support *support) { diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h index 916a15c67b5b..a299d109f368 100644 --- a/ofproto/ofproto-dpif-xlate.h +++ b/ofproto/ofproto-dpif-xlate.h @@ -233,7 +233,6 @@ void xlate_mac_learning_update(const struct ofproto_dpif *ofproto, ofp_port_t in_port, struct eth_addr dl_src, int vlan, bool is_grat_arp); -void xlate_disable_dp_clone(const struct ofproto_dpif *); void xlate_set_support(const struct ofproto_dpif *, const struct dpif_backer_support *); diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 3836b21b7aa4..ff67f18710b7 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5526,27 +5526,6 @@ disable_datapath_truncate(struct unixctl_conn *conn OVS_UNUSED, } static void -disable_datapath_clone(struct unixctl_conn *conn OVS_UNUSED, - int argc, const char *argv[], - void *aux OVS_UNUSED) -{ - struct ds ds = DS_EMPTY_INITIALIZER; - const char *br = argv[argc -1]; - struct ofproto_dpif *ofproto; - - ofproto = ofproto_dpif_lookup(br); - if (!ofproto) { - unixctl_command_reply_error(conn, "no such bridge"); - return; - } - xlate_disable_dp_clone(ofproto); - udpif_flush(ofproto->backer->udpif); - ds_put_format(&ds, "Datapath clone action disabled for bridge %s", br); - unixctl_command_reply(conn, ds_cstr(&ds)); - ds_destroy(&ds); -} - -static void ofproto_unixctl_dpif_show_dp_features(struct unixctl_conn *conn, int argc, const char *argv[], void *aux OVS_UNUSED) @@ -5626,9 +5605,6 @@ ofproto_unixctl_init(void) unixctl_command_register("dpif/disable-truncate", "", 0, 0, disable_datapath_truncate, NULL); - - unixctl_command_register("dpif/disable-dp-clone", "bridge", 1, 1, - disable_datapath_clone, NULL); } static odp_port_t diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 9941e3578f46..1a68c3c7ef68 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -6784,9 +6784,7 @@ Datapath actions: clone(set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2),clone(set(e ]) dnl Test flow xlate openflow clone action without using datapath clone action. -AT_CHECK([ovs-appctl dpif/disable-dp-clone br0], [0], -[Datapath clone action disabled for bridge br0 -]) +AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone false], [0], [ignore]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])