DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hyong Youb Kim <hyonkim@cisco.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>,
	John Daley <johndale@cisco.com>
Subject: [dpdk-dev] [PATCH 6/6] net/enic: support VXLAN decap action combined with VLAN pop
Date: Wed,  9 Sep 2020 07:00:06 -0700	[thread overview]
Message-ID: <20200909140006.23788-7-hyonkim@cisco.com> (raw)
In-Reply-To: <20200909140006.23788-1-hyonkim@cisco.com>

Flow Manager (flowman) provides DECAP_STRIP operation which
decapsulates VXLAN header and then removes VLAN header from the inner
packet. Use this operation to support vxlan_decap followed by
of_pop_vlan.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 doc/guides/rel_notes/release_20_11.rst |  1 +
 drivers/net/enic/enic_fm_flow.c        | 30 +++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 6a7e7d666..4767348d3 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -140,3 +140,4 @@ Tested Platforms
   * Added support for VF representors with single-queue Tx/Rx and flow API
   * Added support for egress PORT_ID action
   * Added support for non-zero priorities for group 0 flows
+  * Added support for VXLAN decap combined with VLAN pop
diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index 7eec8e6eb..ef4705d47 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -923,6 +923,20 @@ enic_fm_append_action_op(struct enic_flowman *fm,
 	return 0;
 }
 
+static struct fm_action_op *
+find_prev_action_op(struct enic_flowman *fm, uint32_t opcode)
+{
+	struct fm_action_op *op;
+	int i;
+
+	for (i = 0; i < fm->action_op_count; i++) {
+		op = &fm->action.fma_action_ops[i];
+		if (op->fa_op == opcode)
+			return op;
+	}
+	return NULL;
+}
+
 /* NIC requires that 1st steer appear before decap.
  * Correct example: steer, decap, steer, steer, ...
  */
@@ -938,7 +952,8 @@ enic_fm_reorder_action_op(struct enic_flowman *fm)
 	steer = NULL;
 	decap = NULL;
 	while (op->fa_op != FMOP_END) {
-		if (!decap && op->fa_op == FMOP_DECAP_NOSTRIP)
+		if (!decap && (op->fa_op == FMOP_DECAP_NOSTRIP ||
+			       op->fa_op == FMOP_DECAP_STRIP))
 			decap = op;
 		else if (!steer && op->fa_op == FMOP_RQ_STEER)
 			steer = op;
@@ -1471,6 +1486,19 @@ enic_fm_copy_action(struct enic_flowman *fm,
 			break;
 		}
 		case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN: {
+			struct fm_action_op *decap;
+
+			/*
+			 * If decap-nostrip appears before pop vlan, this pop
+			 * applies to the inner packet vlan. Turn it into
+			 * decap-strip.
+			 */
+			decap = find_prev_action_op(fm, FMOP_DECAP_NOSTRIP);
+			if (decap) {
+				ENICPMD_LOG(DEBUG, "pop-vlan inner: decap-nostrip => decap-strip");
+				decap->fa_op = FMOP_DECAP_STRIP;
+				break;
+			}
 			memset(&fm_op, 0, sizeof(fm_op));
 			fm_op.fa_op = FMOP_POP_VLAN;
 			ret = enic_fm_append_action_op(fm, &fm_op, error);
-- 
2.26.2


  parent reply	other threads:[~2020-09-09 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 14:00 [dpdk-dev] [PATCH 0/6] net/enic: minor updates to flow implementation Hyong Youb Kim
2020-09-09 14:00 ` [dpdk-dev] [PATCH 1/6] net/enic: remove obsolete code Hyong Youb Kim
2020-09-09 14:00 ` [dpdk-dev] [PATCH 2/6] net/enic: support egress PORT_ID action Hyong Youb Kim
2020-09-09 14:00 ` [dpdk-dev] [PATCH 3/6] net/enic: support priorities for TCAM flows Hyong Youb Kim
2020-09-09 14:00 ` [dpdk-dev] [PATCH 4/6] net/enic: ignore vlan inner type when it is zero Hyong Youb Kim
2020-09-09 14:00 ` [dpdk-dev] [PATCH 5/6] net/enic: generate VXLAN source port if it is zero in template Hyong Youb Kim
2020-09-09 14:00 ` Hyong Youb Kim [this message]
2020-09-21 16:12 ` [dpdk-dev] [PATCH 0/6] net/enic: minor updates to flow implementation Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909140006.23788-7-hyonkim@cisco.com \
    --to=hyonkim@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=johndale@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).