summaryrefslogtreecommitdiff
path: root/drivers/net/softnic
diff options
context:
space:
mode:
authorCristian Dumitrescu <cristian.dumitrescu@intel.com>2018-10-09 16:41:52 +0100
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>2018-10-12 19:33:33 +0200
commit974a48d42b430db0873616aca8ca495acca3b5ee (patch)
tree955c26af8fccc9df6650a445b63da2c408d8118f /drivers/net/softnic
parent16d2d653253728edf40061abb2dcaeb68068db52 (diff)
downloaddpdk-974a48d42b430db0873616aca8ca495acca3b5ee.zip
dpdk-974a48d42b430db0873616aca8ca495acca3b5ee.tar.gz
dpdk-974a48d42b430db0873616aca8ca495acca3b5ee.tar.xz
net/softnic: support flow mark action
Add support for ethdev flow API mark action. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Diffstat (limited to 'drivers/net/softnic')
-rw-r--r--drivers/net/softnic/rte_eth_softnic_flow.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c
index 30aa6af..9bb0d56 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_TAG */
+ 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;