From patchwork Thu Mar 1 22:59:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Garver X-Patchwork-Id: 880161 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=erig.me 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 3zsnvm68l8z9s75 for ; Fri, 2 Mar 2018 10:00:20 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 546C8103C; Thu, 1 Mar 2018 22:59:47 +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 B59EE103A for ; Thu, 1 Mar 2018 22:59:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 129F21CE for ; Thu, 1 Mar 2018 22:59:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 475A54040852 for ; Thu, 1 Mar 2018 22:59:43 +0000 (UTC) Received: from egarver.redhat.com (ovpn-125-17.rdu2.redhat.com [10.10.125.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1840A2144B24 for ; Thu, 1 Mar 2018 22:59:43 +0000 (UTC) From: Eric Garver To: dev@openvswitch.org Date: Thu, 1 Mar 2018 17:59:41 -0500 Message-Id: <20180301225942.13348-2-e@erig.me> In-Reply-To: <20180301225942.13348-1-e@erig.me> References: <20180301225942.13348-1-e@erig.me> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 22:59:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 22:59:43 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'e@erig.me' RCPT:'' X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 1/2] ofproto-dpif-xlate: translate action_set in clone action 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 A clone action saves the action_set prior to performing the clone, then restores it afterwards. However when xlating the actions it neglects to consider the action_set so any write_action() inside a clone() are ignored. Unfortunately patch ports are internally implemented via clone(). So a frame traversing to a second bridge via patch port will never be affected by write_action() in the second bridge's flow table. Lets make clone() aware of the action_set. Signed-off-by: Eric Garver --- ofproto/ofproto-dpif-xlate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index cc450a896948..bc6429c25346 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -5303,6 +5303,9 @@ clone_xlate_actions(const struct ofpact *actions, size_t actions_len, if (reversible_actions(actions, actions_len) || is_last_action) { old_flow = ctx->xin->flow; do_xlate_actions(actions, actions_len, ctx, is_last_action); + if (!ctx->freezing) { + xlate_action_set(ctx); + } if (ctx->freezing) { finish_freezing(ctx); } @@ -5324,6 +5327,9 @@ clone_xlate_actions(const struct ofpact *actions, size_t actions_len, /* Use clone action as datapath clone. */ offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_CLONE); do_xlate_actions(actions, actions_len, ctx, true); + if (!ctx->freezing) { + xlate_action_set(ctx); + } if (ctx->freezing) { finish_freezing(ctx); } @@ -5337,6 +5343,9 @@ clone_xlate_actions(const struct ofpact *actions, size_t actions_len, ac_offset = nl_msg_start_nested(ctx->odp_actions, OVS_SAMPLE_ATTR_ACTIONS); do_xlate_actions(actions, actions_len, ctx, true); + if (!ctx->freezing) { + xlate_action_set(ctx); + } if (ctx->freezing) { finish_freezing(ctx); } From patchwork Thu Mar 1 22:59:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Garver X-Patchwork-Id: 880162 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=erig.me 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 3zsnwG6XWTz9s7P for ; Fri, 2 Mar 2018 10:00:46 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 33C371059; Thu, 1 Mar 2018 22:59:49 +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 020A21034 for ; Thu, 1 Mar 2018 22:59:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 54E5420C for ; Thu, 1 Mar 2018 22:59:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F00C4040856 for ; Thu, 1 Mar 2018 22:59:43 +0000 (UTC) Received: from egarver.redhat.com (ovpn-125-17.rdu2.redhat.com [10.10.125.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EADE2144B24 for ; Thu, 1 Mar 2018 22:59:43 +0000 (UTC) From: Eric Garver To: dev@openvswitch.org Date: Thu, 1 Mar 2018 17:59:42 -0500 Message-Id: <20180301225942.13348-3-e@erig.me> In-Reply-To: <20180301225942.13348-1-e@erig.me> References: <20180301225942.13348-1-e@erig.me> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 22:59:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 22:59:43 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'e@erig.me' RCPT:'' X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 2/2] tests/ofproto-dpif: New test for action_set after traversing patch 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Eric Garver --- tests/ofproto-dpif.at | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 600afdda8528..73ad50b6f3d4 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -371,6 +371,31 @@ AT_CHECK([tail -1 stdout], [0], OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - patch port with action set]) +OVS_VSWITCHD_START([ \ + add-br br1 -- \ + set bridge br1 datapath-type=dummy fail-mode=secure -- \ + add-port br0 patch10 -- \ + set interface patch10 type=patch options:peer=patch20 ofport_request=10 -- \ + add-port br1 patch20 -- \ + set interface patch20 type=patch options:peer=patch10 ofport_request=20 + ]) +add_of_ports br0 1 +add_of_ports br1 2 +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br1 'ip actions=write_actions(pop_vlan,output:2)']) +AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=output:10']) +AT_CHECK([ovs-appctl ofproto/trace br1 'in_port=20,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_vlan=100,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: pop_vlan,2 +]) +AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_vlan=100,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) +AT_CHECK([tail -1 stdout], [0], + [Datapath actions: pop_vlan,2 +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + + AT_SETUP([ofproto-dpif - select group]) OVS_VSWITCHD_START add_of_ports br0 1 10 11