summaryrefslogtreecommitdiff
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorDeclan Doherty <declan.doherty@intel.com>2018-04-26 18:29:19 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-04-27 18:00:57 +0100
commitfb8fd96d4251f615a0e7acdb3af8b4546f900b4d (patch)
treef9764acf19098793af46a165528254375000cec5 /drivers/net/bonding
parente05419b3f05615c2b48169bc27049cda3ae584c6 (diff)
downloaddpdk-next-eventdev-fb8fd96d4251f615a0e7acdb3af8b4546f900b4d.zip
dpdk-next-eventdev-fb8fd96d4251f615a0e7acdb3af8b4546f900b4d.tar.gz
dpdk-next-eventdev-fb8fd96d4251f615a0e7acdb3af8b4546f900b4d.tar.xz
ethdev: add shared counter to flow API
Add rte_flow_action_count action data structure to enable shared counters across multiple flows on a single port or across multiple flows on multiple ports within the same switch domain. Also this enables multiple count actions to be specified in a single flow action. This patch also modifies the existing rte_flow_query API to take the rte_flow_action structure as an input parameter instead of the rte_flow_action_type enumeration to allow querying a specific action from a flow rule when multiple actions of the same type are specified. This patch also contains updates for the bonding, failsafe and mlx5 PMDs and testpmd application which are affected by this API change. Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/rte_eth_bond_flow.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 8093c04..31e4bca 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -152,6 +152,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *err)
static int
bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
+ const struct rte_flow_action *action,
struct rte_flow_query_count *count,
struct rte_flow_error *err)
{
@@ -165,7 +166,7 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
rte_memcpy(&slave_count, count, sizeof(slave_count));
for (i = 0; i < internals->slave_count; i++) {
ret = rte_flow_query(internals->slaves[i].port_id,
- flow->flows[i], RTE_FLOW_ACTION_TYPE_COUNT,
+ flow->flows[i], action,
&slave_count, err);
if (unlikely(ret != 0)) {
RTE_BOND_LOG(ERR, "Failed to query flow on"
@@ -182,12 +183,12 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
static int
bond_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow,
- enum rte_flow_action_type type, void *arg,
+ const struct rte_flow_action *action, void *arg,
struct rte_flow_error *err)
{
- switch (type) {
+ switch (action->type) {
case RTE_FLOW_ACTION_TYPE_COUNT:
- return bond_flow_query_count(dev, flow, arg, err);
+ return bond_flow_query_count(dev, flow, action, arg, err);
default:
return rte_flow_error_set(err, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION, arg,