From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 274751B5A9 for ; Tue, 9 Oct 2018 17:48:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2018 08:48:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,360,1534834800"; d="scan'208";a="79776745" Received: from silpixa00382658.ir.intel.com ([10.237.223.29]) by orsmga007.jf.intel.com with ESMTP; 09 Oct 2018 08:47:43 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Date: Tue, 9 Oct 2018 16:47:24 +0100 Message-Id: <1539100044-224533-4-git-send-email-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539100044-224533-1-git-send-email-cristian.dumitrescu@intel.com> References: <1539100044-224533-1-git-send-email-cristian.dumitrescu@intel.com> Subject: [dpdk-dev] [PATCH 4/4] net/softnic: add support for flow api mark 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: , X-List-Received-Date: Tue, 09 Oct 2018 15:48:55 -0000 Add support for ethdev flow API mark action. Signed-off-by: Cristian Dumitrescu --- drivers/net/softnic/rte_eth_softnic_flow.c | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c index 30aa6af..b7b0b6d 100644 --- a/drivers/net/softnic/rte_eth_softnic_flow.c +++ b/drivers/net/softnic/rte_eth_softnic_flow.c @@ -1168,6 +1168,7 @@ flow_rule_action_get(struct pmd_internals *softnic, struct softnic_table_action_profile_params *params; int n_jump_queue_rss_drop = 0; int n_count = 0; + int n_mark = 0; profile = softnic_table_action_profile_find(softnic, table->params.action_profile_name); @@ -1475,6 +1476,40 @@ flow_rule_action_get(struct pmd_internals *softnic, break; } /* RTE_FLOW_ACTION_TYPE_COUNT */ + case RTE_FLOW_ACTION_TYPE_MARK: + { + const struct rte_flow_action_mark *conf = action->conf; + + if (conf == NULL) + return rte_flow_error_set(error, + EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + action, + "MARK: Null configuration"); + + if (n_mark) + return rte_flow_error_set(error, + ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + action, + "Only one MARK action per flow"); + + if ((params->action_mask & + (1LLU << RTE_TABLE_ACTION_TAG)) == 0) + return rte_flow_error_set(error, + ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, + "MARK action not supported by this table"); + + n_mark = 1; + + /* RTE_TABLE_ACTION_STATS */ + rule_action->tag.tag = conf->id; + rule_action->action_mask |= 1 << RTE_TABLE_ACTION_TAG; + break; + } /* RTE_FLOW_ACTION_TYPE_MARK */ + case RTE_FLOW_ACTION_TYPE_METER: { const struct rte_flow_action_meter *conf = action->conf; -- 2.7.4