DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com,
	declan.doherty@intel.com, orika@mellanox.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>
Subject: [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action
Date: Wed,  3 Jun 2020 15:20:04 +0100	[thread overview]
Message-ID: <1591194009-4086-4-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1591194009-4086-1-git-send-email-bernard.iremonger@intel.com>

add MK_FLOW_ACTION(MAP, sizeof(struct rte_flow_action_map))
add case RTE_FLOW_ACTION_TYPE_MAP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_flow.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index 1685be5..b963d9f 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -173,6 +173,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
 	MK_FLOW_ACTION(SET_IPV4_DSCP, sizeof(struct rte_flow_action_set_dscp)),
 	MK_FLOW_ACTION(SET_IPV6_DSCP, sizeof(struct rte_flow_action_set_dscp)),
 	MK_FLOW_ACTION(AGE, sizeof(struct rte_flow_action_age)),
+	MK_FLOW_ACTION(MAP, sizeof(struct rte_flow_action_map)),
 };
 
 int
@@ -596,11 +597,13 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
 			const struct rte_flow_action_rss *rss;
 			const struct rte_flow_action_vxlan_encap *vxlan_encap;
 			const struct rte_flow_action_nvgre_encap *nvgre_encap;
+			const struct rte_flow_action_map *map;
 		} src;
 		union {
 			struct rte_flow_action_rss *rss;
 			struct rte_flow_action_vxlan_encap *vxlan_encap;
 			struct rte_flow_action_nvgre_encap *nvgre_encap;
+			struct rte_flow_action_map *map;
 		} dst;
 		size_t tmp;
 		int ret;
@@ -665,6 +668,17 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
 			off += ret;
 		}
 		break;
+	case RTE_FLOW_ACTION_TYPE_MAP:
+		src.map = action->conf;
+		dst.map = buf;
+		rte_memcpy(dst.map,
+			   (&(struct rte_flow_action_map){
+				.pctype = src.map->pctype,
+				.flowtype = src.map->flowtype,
+			   }),
+			   size > sizeof(*dst.map) ? sizeof(*dst.map) : size);
+		off = sizeof(*dst.map);
+		break;
 	default:
 		off = rte_flow_desc_action[action->type].size;
 		rte_memcpy(buf, action->conf, (size > off ? off : size));
-- 
2.7.4


  parent reply	other threads:[~2020-06-03 14:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 2/8] librte_ethdev: add map filter type Bernard Iremonger
2020-06-03 14:20 ` Bernard Iremonger [this message]
2020-06-03 14:20 ` [dpdk-dev] [PATCH 4/8] app/testpmd: parse map actions Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 5/8] net/i40e: add map filter Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 6/8] net/i40e: add map functions Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 7/8] net/i40e: parse map pattern and action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 8/8] doc: release note Bernard Iremonger
2020-06-04  6:05 ` [dpdk-dev] [PATCH 0/8] add flow action map Ori Kam
2020-06-04 11:21   ` Iremonger, Bernard
2020-06-04 13:12     ` Thomas Monjalon

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=1591194009-4086-4-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=qi.z.zhang@intel.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).