From patchwork Tue Sep 12 19:49:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 813034 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 3xsFnw435cz9s7M for ; Wed, 13 Sep 2017 05:52:52 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 27631AD2; Tue, 12 Sep 2017 19:50:07 +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 81573A86 for ; Tue, 12 Sep 2017 19:50:03 +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 3DCAC159 for ; Tue, 12 Sep 2017 19:50:03 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id e69so4820705pfg.4 for ; Tue, 12 Sep 2017 12:50:03 -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=GvBrcK5q5TDVueqKlxng51raGAlBCRhJsiTkwcEzsAw=; b=MQ9SYkT2U1q93HD/7Ak++eqsOK0FpbjXPKWFmH+tjXd++ea5BSN6ZOxvbgxISvXV5k YLgDp3snfj7cknb5oFlYb0a/ahveJ7UHafiy0RukhpdYDdFpyJkYEMO9wL6iVkbE5JhO WiMpDNyDo1o6hdoyJe/E9Ufzn2H1iHVbscBiEDPyQ8qsNEXxDvXkd1B2TKvBoDJMMVWz kfQYN9csSXv0sdO4SrrNrg4sr747vRpq76zGXB8YL5kNWbmEtW9xwwVRQMaenJ70DPq7 WJHMj4kwE6aMTYU4cmKK1Cjp/koaaPU/vC/XEYA1k6gyZE5eGtkhkAT7gJxcR/hlEr0W 8Zaw== X-Gm-Message-State: AHPjjUiIz1AdB8cIwFkY9u94+UdsFxbrpemGv+EJj3HylMvhP6QhsvrF 8WJhmbYTu/QT02V+ X-Google-Smtp-Source: ADKCNb64AjH4I5KOOUJH7kmrN6R3ukK4dnW3DMO09juMrnB0vlvjxpCUUOEK00/qPZTgODU6PnhFxQ== X-Received: by 10.84.128.78 with SMTP id 72mr18708951pla.376.1505245802716; Tue, 12 Sep 2017 12:50:02 -0700 (PDT) Received: from centos.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id j13sm23739951pfk.107.2017.09.12.12.50.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 12:50:02 -0700 (PDT) From: Andy Zhou To: dev@openvswitch.org Date: Tue, 12 Sep 2017 12:49:08 -0700 Message-Id: <1505245749-3402-6-git-send-email-azhou@ovn.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1505245749-3402-1-git-send-email-azhou@ovn.org> References: <1505245749-3402-1-git-send-email-azhou@ovn.org> X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [merge native tunneling and patch port 6/7] ofproto-dpif-xlate: Rename apply_nested_clone_actions() 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 To patch_port_output(). The original function name does not make much sense. Signed-off-by: Andy Zhou Tested-by: Greg Rose Reviewed-by: Greg Rose --- ofproto/ofproto-dpif-xlate.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 81853c29afbf..94aa071a37cd 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -432,8 +432,8 @@ static void xlate_action_set(struct xlate_ctx *ctx); static void xlate_commit_actions(struct xlate_ctx *ctx); static void -apply_nested_clone_actions(struct xlate_ctx *ctx, const struct xport *in_dev, - struct xport *out_dev); +patch_port_output(struct xlate_ctx *ctx, const struct xport *in_dev, + struct xport *out_dev); static void ctx_trigger_freeze(struct xlate_ctx *ctx) @@ -3317,7 +3317,7 @@ validate_and_combine_post_tnl_actions(struct xlate_ctx *ctx, entry->tunnel_hdr.hdr_size = tnl_push_data.header_len; entry->tunnel_hdr.operation = ADD; - apply_nested_clone_actions(ctx, xport, out_dev); + patch_port_output(ctx, xport, out_dev); nested_act_flag = is_tunnel_actions_clone_ready(ctx); if (nested_act_flag) { @@ -3509,21 +3509,22 @@ xlate_flow_is_protected(const struct xlate_ctx *ctx, const struct flow *flow, co xport_in->xbundle->protected && xport_out->xbundle->protected); } -/* Function to combine actions from following device/port with the current - * device actions in openflow pipeline. Mainly used for the translation of - * patch/tunnel port output actions. It pushes the openflow state into a stack - * first, clear out to execute the packet through the device and finally pop - * the openflow state back from the stack. This is equivalent to cloning - * a packet in translation for the duration of execution. +/* Function handles when a packet is sent from one bridge to another bridge. * - * On output to a patch port, the output action will be replaced with set of - * nested actions on the peer patch port. - * Similarly on output to a tunnel port, the post nested actions on - * tunnel are chained up with the tunnel-push action. + * The bridges are internally connected, either with patch ports or with + * tunnel ports. + * + * The output action to another bridge causes translation to continue within + * the next bridge. This process can be recursive; the next bridge can + * output yet to another bridge. + * + * The translated actions from the second bridge onwards are enclosed within + * the clone action, so that any modification to the packet will not be visible + * to the remaining actions of the originating bridge. */ static void -apply_nested_clone_actions(struct xlate_ctx *ctx, const struct xport *in_dev, - struct xport *out_dev) +patch_port_output(struct xlate_ctx *ctx, const struct xport *in_dev, + struct xport *out_dev) { struct flow *flow = &ctx->xin->flow; struct flow old_flow = ctx->xin->flow; @@ -3760,7 +3761,7 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port, } if (xport->peer) { - apply_nested_clone_actions(ctx, xport, xport->peer); + patch_port_output(ctx, xport, xport->peer); return; }