From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 63F63A04A4; Wed, 3 Jun 2020 16:20:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA09F1D55B; Wed, 3 Jun 2020 16:20:28 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 7177E1D537 for ; Wed, 3 Jun 2020 16:20:27 +0200 (CEST) IronPort-SDR: QrszjF2Q2ZNopOhXL4uZ1Ec01I96J3HmFkFpB5WRMMUPHA6brHGPj99SDMBlh4WjatSzae8Olg b9QHVhvctAcA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 07:20:26 -0700 IronPort-SDR: 77AczkssOLwhISaR+GnvjxR3N/tP0v7wqV7nNnk08ii8dky6oXO7Ooggxn4kOMfD3g7lq4epAW OhR3udu5Lc8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="416572746" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by orsmga004.jf.intel.com with ESMTP; 03 Jun 2020 07:20:25 -0700 From: Bernard Iremonger To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com, declan.doherty@intel.com, orika@mellanox.com Cc: Bernard Iremonger Date: Wed, 3 Jun 2020 15:20:04 +0100 Message-Id: <1591194009-4086-4-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1591194009-4086-1-git-send-email-bernard.iremonger@intel.com> References: <1591194009-4086-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" add MK_FLOW_ACTION(MAP, sizeof(struct rte_flow_action_map)) add case RTE_FLOW_ACTION_TYPE_MAP Signed-off-by: Bernard Iremonger --- 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