From patchwork Fri Aug 25 22:51:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi-Hung Wei X-Patchwork-Id: 806053 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dQZPhb8Z"; dkim-atps=neutral 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 3xfGdm5LkPz9t43 for ; Sat, 26 Aug 2017 08:52:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BD774B1B; Fri, 25 Aug 2017 22:51:38 +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 C0948A81 for ; Fri, 25 Aug 2017 22:51:33 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D102A87 for ; Fri, 25 Aug 2017 22:51:32 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id 83so1524540pgb.3 for ; Fri, 25 Aug 2017 15:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=88ilFLwdg3T3VwiFmhSWjYsfB2x1wrE9yqhqQEVpzqw=; b=dQZPhb8ZBfgkS5tHvztQKQiE3jLgLbYs9nCuc1vR59zBhyWS8TZ+Vfy+9F4AVcpYnM khBP9LF1vFx8BWQ1WmChb5xq4KBWSdzo9/JdNMaiPjGQQRtIKcsc3N5wwMVcrTgwOzle zPPqVDcylG2pO48XJ/14fuYALbrd5FdViPiEb7l5cjWxX5e5uV21KBHqJQBuMqlWrlCe kJZRkCYjJqRmbO/qzJm8VSfs/PN2E8n/eNJX7zfsNqqNOCSzO/tqCSePt5x3anNiyGoQ SqtfDK/W9P+Cv+LmyfHp8tUXQFx71P6fj9+WV4ftf8OBjJkwwuLbNBPUjqz05Ik/BEBw Gwww== 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; bh=88ilFLwdg3T3VwiFmhSWjYsfB2x1wrE9yqhqQEVpzqw=; b=bt0/Dpjx2icskC7cU/idH5yv7IBUGENhwC23E2lPut0BNx3cKHDNTjoQt7cKNQvoXE P3PyFZW5niTqfZhFLlanezd89eMrpMBd4Hmft5XleVJdCSPyy+QJQOW5lRG3IWOuLeFq Y1Pm+NKNr0CSIeKhZ7gRbBBY7NpGXDyjydgmW4JZQZHeFimMsllnPKwe/boZf1ma00az JidlybW7BKiMmBMJcSLewqAzDLSymXty2OSAgwKVwsExViXDB9wCh0hS1COoI7g380wQ 24W4z9rOikKPshHic1Aj1PpCWkDqE2RINQKM57XvAiUUn9YI63DJqIoeo6d0vycIo38l 24Gw== X-Gm-Message-State: AHYfb5j/Dm0mqKhTmLHxVLF1I+u5kgz8JQFZViCn4AfnQr4IHbBLb7Zv 5OMcufojjOaR+KdOpj0= X-Received: by 10.84.143.129 with SMTP id 1mr49117plz.88.1503701492197; Fri, 25 Aug 2017 15:51:32 -0700 (PDT) Received: from vm-01.vmware.com ([208.91.2.1]) by smtp.gmail.com with ESMTPSA id b68sm12678154pfd.33.2017.08.25.15.51.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Aug 2017 15:51:31 -0700 (PDT) From: Yi-Hung Wei To: dev@openvswitch.org Date: Fri, 25 Aug 2017 15:51:12 -0700 Message-Id: <1503701479-43894-3-git-send-email-yihung.wei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503701479-43894-1-git-send-email-yihung.wei@gmail.com> References: <1503701479-43894-1-git-send-email-yihung.wei@gmail.com> X-Spam-Status: No, score=0.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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] [PATCH 2/9] ofproto/trace: Propagate ct_zone in recirculation 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 This patch propagates ct_zone when ofproto/trace automatically runs through the recirculation process. Fixes: e6bc8e749381 ("ofproto/trace: Add support for tracing conntrack recirculation") Signed-off-by: Yi-Hung Wei Reviewed-by: Greg Rose --- ofproto/ofproto-dpif-trace.c | 4 +++- ofproto/ofproto-dpif-trace.h | 3 ++- ofproto/ofproto-dpif-xlate.c | 7 ++++--- tests/ofproto-dpif.at | 14 +++++++------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ofproto/ofproto-dpif-trace.c b/ofproto/ofproto-dpif-trace.c index a45c9cfd9619..c3c929520a2d 100644 --- a/ofproto/ofproto-dpif-trace.c +++ b/ofproto/ofproto-dpif-trace.c @@ -91,7 +91,8 @@ oftrace_node_destroy(struct oftrace_node *node) bool oftrace_add_recirc_node(struct ovs_list *recirc_queue, enum oftrace_recirc_type type, const struct flow *flow, - const struct dp_packet *packet, uint32_t recirc_id) + const struct dp_packet *packet, uint32_t recirc_id, + const uint16_t zone) { if (!recirc_id_node_find_and_ref(recirc_id)) { return false; @@ -104,6 +105,7 @@ oftrace_add_recirc_node(struct ovs_list *recirc_queue, node->recirc_id = recirc_id; node->flow = *flow; node->flow.recirc_id = recirc_id; + node->flow.ct_zone = zone; node->packet = packet ? dp_packet_clone(packet) : NULL; return true; diff --git a/ofproto/ofproto-dpif-trace.h b/ofproto/ofproto-dpif-trace.h index 5178d227ed07..5e51771b19b0 100644 --- a/ofproto/ofproto-dpif-trace.h +++ b/ofproto/ofproto-dpif-trace.h @@ -84,6 +84,7 @@ struct oftrace_node *oftrace_report(struct ovs_list *, enum oftrace_node_type, const char *text); bool oftrace_add_recirc_node(struct ovs_list *recirc_queue, enum oftrace_recirc_type, const struct flow *, - const struct dp_packet *, uint32_t recirc_id); + const struct dp_packet *, uint32_t recirc_id, + const uint16_t zone); #endif /* ofproto-dpif-trace.h */ diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 9e1f837cb23e..95c4fef0d9b0 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4685,7 +4685,8 @@ finish_freezing(struct xlate_ctx *ctx) * the remainder of the current action list and asynchronously resume pipeline * processing in 'table' with the current metadata and action set. */ static void -compose_recirculate_and_fork(struct xlate_ctx *ctx, uint8_t table) +compose_recirculate_and_fork(struct xlate_ctx *ctx, uint8_t table, + const uint16_t zone) { uint32_t recirc_id; ctx->freezing = true; @@ -4694,7 +4695,7 @@ compose_recirculate_and_fork(struct xlate_ctx *ctx, uint8_t table) if (OVS_UNLIKELY(ctx->xin->trace) && recirc_id) { if (oftrace_add_recirc_node(ctx->xin->recirc_queue, OFT_RECIRC_CONNTRACK, &ctx->xin->flow, - ctx->xin->packet, recirc_id)) { + ctx->xin->packet, recirc_id, zone)) { xlate_report(ctx, OFT_DETAIL, "A clone of the packet is forked to " "recirculate. The forked pipeline will be resumed at " "table %u.", table); @@ -5764,7 +5765,7 @@ compose_conntrack_action(struct xlate_ctx *ctx, struct ofpact_conntrack *ofc) if (ofc->recirc_table != NX_CT_RECIRC_NONE) { ctx->conntracked = true; - compose_recirculate_and_fork(ctx, ofc->recirc_table); + compose_recirculate_and_fork(ctx, ofc->recirc_table, zone); } /* The ct_* fields are only available in the scope of the 'recirc_table' diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 28a7e827cac2..c76ea4eee1cc 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -9827,21 +9827,21 @@ table=0,priority=1,action=drop dnl dnl Table 1 dnl -table=1,priority=10,in_port=1,ct_state=+trk+new,udp,action=ct(commit,zone=0),2 -table=1,priority=10,in_port=1,ct_state=+trk+est,udp,action=2 -table=1,priority=10,in_port=2,ct_state=+trk+est,udp,action=1 +table=1,priority=10,in_port=1,ct_zone=0,ct_state=+trk+new,udp,action=ct(commit,zone=0),2 +table=1,priority=10,in_port=1,ct_zone=0,ct_state=+trk+est,udp,action=2 +table=1,priority=10,in_port=2,ct_zone=0,ct_state=+trk+est,udp,action=1 table=1,priority=1,action=drop dnl dnl Table 2 dnl -table=2,priority=10,in_port=1,tcp,ct_state=+trk+new,tcp,action=ct(commit,zone=1),ct(table=3,zone=2) -table=2,priority=10,in_port=1,tcp,ct_state=+trk+est,tcp,action=ct(table=3,zone=2) +table=2,priority=10,in_port=1,tcp,ct_zone=1,ct_state=+trk+new,tcp,action=ct(commit,zone=1),ct(table=3,zone=2) +table=2,priority=10,in_port=1,tcp,ct_zone=1,ct_state=+trk+est,tcp,action=ct(table=3,zone=2) table=2,priority=1,action=drop dnl dnl Table 3 dnl -table=3,priority=10,in_port=1,tcp,ct_state=+trk+new,tcp,action=ct(commit,zone=2),4 -table=3,priority=10,in_port=1,tcp,ct_state=+trk+est,tcp,action=3 +table=3,priority=10,in_port=1,tcp,ct_zone=2,ct_state=+trk+new,tcp,action=ct(commit,zone=2),4 +table=3,priority=10,in_port=1,tcp,ct_zone=2,ct_state=+trk+est,tcp,action=3 table=2,priority=1,action=drop ])