Right now, rte_flow_shared_action_* APIs are used for some shared
actions, like RSS, count. The shared action should be created before
using it inside a flow. These shared actions sometimes are not
really shared but just some indirect actions decoupled from a flow.
The new functions rte_flow_action_handle_* are added to replace
the current shared functions rte_flow_shared_action_*.
There are two types of flow actions:
1. the direct (normal) actions that could be created and stored
within a flow rule. Such action is tied to its flow rule and
cannot be reused.
2. the indirect action, in the past, named shared_action. It is
created from a direct actioni, like count or rss, and then used
in the flow rules with an object handle. The PMD will take care
of the retrieve from indirect action to the direct action
when it is referenced.
The indirect action is accessed (update / query) w/o any flow rule,
just via the action object handle. For example, when querying or
resetting a counter, it could be done out of any flow using this
counter, but only the handle of the counter action object is
required.
The indirect action object could be shared by different flows or
used by a single flow, depending on the direct action type and
the real-life requirements.
The handle of an indirect action object is opaque and defined in
each driver and possibly different per direct action type.
The old name "shared" is improper in a sense and should be replaced.
Since the APIs are changed from "rte_flow_shared_action*" to the new
"rte_flow_action_handle*", the testpmd application code and command
line interfaces also need to be updated to do the adaption.
The testpmd application user guide is also updated. All the "shared
action" related parts are replaced with "indirect action" to have a
correct explanation.
The parameter of "update" interface is also changed. A general
pointer will replace the rte_flow_action struct pointer due to the
facts:
1. Some action may not support fields updating. In the example of a
counter, the only "update" supported should be the reset. So
passing a rte_flow_action struct pointer is meaningless and
there is even no such corresponding action struct. What's more,
if more than one operations should be supported, for some other
action, such pointer parameter may not meet the need.
2. Some action may need conditional or partial update, the current
parameter will not provide the ability to indicate which part(s)
to update.
For different types of indirect action objects, the pointer could
either be the same of rte_flow_action* struct - in order not to
break the current driver implementation, or some wrapper
structures with bits as masks to indicate which part to be
updated, depending on real needs of the corresponding direct
action. For different direct actions, the structures of indirect
action objects updating will be different.
All the underlayer PMD callbacks will be moved to these new APIs.
The RTE_FLOW_ACTION_TYPE_SHARED is kept for now in order not to
break the ABI. All the implementations are changed by using
RTE_FLOW_ACTION_TYPE_INDIRECT.
Since the APIs are changed from "rte_flow_shared_action*" to the new
"rte_flow_action_handle*" and the "update" interface's 3rd input
parameter is changed to generic pointer, the mlx5 PMD that uses these
APIs needs to do the adaption to the new APIs as well.
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Andrey Vesnovaty <andreyv@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
16 files changed:
" List and destroy aged flows"
" flow rules\n\n"
" List and destroy aged flows"
" flow rules\n\n"
- "flow shared_action {port_id} create"
- " [action_id {shared_action_id}]"
+ "flow indirect_action {port_id} create"
+ " [action_id {indirect_action_id}]"
" [ingress] [egress]"
" action {action} / end\n"
" [ingress] [egress]"
" action {action} / end\n"
- " Create shared action.\n\n"
+ " Create indirect action.\n\n"
- "flow shared_action {port_id} update"
- " {shared_action_id} action {action} / end\n"
- " Update shared action.\n\n"
+ "flow indirect_action {port_id} update"
+ " {indirect_action_id} action {action} / end\n"
+ " Update indirect action.\n\n"
- "flow shared_action {port_id} destroy"
- " action_id {shared_action_id} [...]\n"
- " Destroy specific shared actions.\n\n"
+ "flow indirect_action {port_id} destroy"
+ " action_id {indirect_action_id} [...]\n"
+ " Destroy specific indirect actions.\n\n"
- "flow shared_action {port_id} query"
- " {shared_action_id}\n"
- " Query an existing shared action.\n\n"
+ "flow indirect_action {port_id} query"
+ " {indirect_action_id}\n"
+ " Query an existing indirect action.\n\n"
"set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src"
" (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst"
"set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src"
" (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst"
PORT_ID,
GROUP_ID,
PRIORITY_LEVEL,
PORT_ID,
GROUP_ID,
PRIORITY_LEVEL,
/* Top-level command. */
SET,
/* Top-level command. */
SET,
/* Top-level command. */
FLOW,
/* Sub-level commands. */
/* Top-level command. */
FLOW,
/* Sub-level commands. */
VALIDATE,
CREATE,
DESTROY,
VALIDATE,
CREATE,
DESTROY,
- /* Shared action arguments */
- SHARED_ACTION_CREATE,
- SHARED_ACTION_UPDATE,
- SHARED_ACTION_DESTROY,
- SHARED_ACTION_QUERY,
+ /* Indirect action arguments */
+ INDIRECT_ACTION_CREATE,
+ INDIRECT_ACTION_UPDATE,
+ INDIRECT_ACTION_DESTROY,
+ INDIRECT_ACTION_QUERY,
- /* Shared action create arguments */
- SHARED_ACTION_CREATE_ID,
- SHARED_ACTION_INGRESS,
- SHARED_ACTION_EGRESS,
- SHARED_ACTION_TRANSFER,
- SHARED_ACTION_SPEC,
+ /* Indirect action create arguments */
+ INDIRECT_ACTION_CREATE_ID,
+ INDIRECT_ACTION_INGRESS,
+ INDIRECT_ACTION_EGRESS,
+ INDIRECT_ACTION_TRANSFER,
+ INDIRECT_ACTION_SPEC,
- /* Shared action destroy arguments */
- SHARED_ACTION_DESTROY_ID,
+ /* Indirect action destroy arguments */
+ INDIRECT_ACTION_DESTROY_ID,
/* Validate/create pattern. */
PATTERN,
/* Validate/create pattern. */
PATTERN,
ACTION_SAMPLE_RATIO,
ACTION_SAMPLE_INDEX,
ACTION_SAMPLE_INDEX_VALUE,
ACTION_SAMPLE_RATIO,
ACTION_SAMPLE_INDEX,
ACTION_SAMPLE_INDEX_VALUE,
- ACTION_SHARED,
- SHARED_ACTION_ID2PTR,
+ ACTION_INDIRECT,
+ INDIRECT_ACTION_ID2PTR,
ACTION_MODIFY_FIELD,
ACTION_MODIFY_FIELD_OP,
ACTION_MODIFY_FIELD_OP_VALUE,
ACTION_MODIFY_FIELD,
ACTION_MODIFY_FIELD_OP,
ACTION_MODIFY_FIELD_OP_VALUE,
struct {
uint32_t *action_id;
uint32_t action_id_n;
struct {
uint32_t *action_id;
uint32_t action_id_n;
- } sa_destroy; /**< Shared action destroy arguments. */
+ } ia_destroy; /**< Indirect action destroy arguments. */
struct {
uint32_t action_id;
struct {
uint32_t action_id;
- } sa; /* Shared action query arguments */
+ } ia; /* Indirect action query arguments */
struct {
struct rte_flow_attr attr;
struct tunnel_ops tunnel_ops;
struct {
struct rte_flow_attr attr;
struct tunnel_ops tunnel_ops;
-static const enum index next_sa_create_attr[] = {
- SHARED_ACTION_CREATE_ID,
- SHARED_ACTION_INGRESS,
- SHARED_ACTION_EGRESS,
- SHARED_ACTION_TRANSFER,
- SHARED_ACTION_SPEC,
+static const enum index next_ia_create_attr[] = {
+ INDIRECT_ACTION_CREATE_ID,
+ INDIRECT_ACTION_INGRESS,
+ INDIRECT_ACTION_EGRESS,
+ INDIRECT_ACTION_TRANSFER,
+ INDIRECT_ACTION_SPEC,
-static const enum index next_sa_subcmd[] = {
- SHARED_ACTION_CREATE,
- SHARED_ACTION_UPDATE,
- SHARED_ACTION_DESTROY,
- SHARED_ACTION_QUERY,
+static const enum index next_ia_subcmd[] = {
+ INDIRECT_ACTION_CREATE,
+ INDIRECT_ACTION_UPDATE,
+ INDIRECT_ACTION_DESTROY,
+ INDIRECT_ACTION_QUERY,
-static const enum index next_sa_destroy_attr[] = {
- SHARED_ACTION_DESTROY_ID,
+static const enum index next_ia_destroy_attr[] = {
+ INDIRECT_ACTION_DESTROY_ID,
ACTION_SET_IPV6_DSCP,
ACTION_AGE,
ACTION_SAMPLE,
ACTION_SET_IPV6_DSCP,
ACTION_AGE,
ACTION_SAMPLE,
ACTION_MODIFY_FIELD,
ZERO,
};
ACTION_MODIFY_FIELD,
ZERO,
};
static int parse_port(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
static int parse_port(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
-static int parse_sa(struct context *, const struct token *,
+static int parse_ia(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
const char *, unsigned int,
void *, unsigned int);
-static int parse_sa_destroy(struct context *ctx, const struct token *token,
+static int parse_ia_destroy(struct context *ctx, const struct token *token,
const char *str, unsigned int len,
void *buf, unsigned int size);
const char *str, unsigned int len,
void *buf, unsigned int size);
-static int parse_sa_id2ptr(struct context *ctx, const struct token *token,
+static int parse_ia_id2ptr(struct context *ctx, const struct token *token,
const char *str, unsigned int len, void *buf,
unsigned int size);
static int comp_none(struct context *, const struct token *,
const char *str, unsigned int len, void *buf,
unsigned int size);
static int comp_none(struct context *, const struct token *,
.call = parse_int,
.comp = comp_none,
},
.call = parse_int,
.comp = comp_none,
},
- [SHARED_ACTION_ID] = {
- .name = "{shared_action_id}",
- .type = "SHARED_ACTION_ID",
- .help = "shared action id",
+ [INDIRECT_ACTION_ID] = {
+ .name = "{indirect_action_id}",
+ .type = "INDIRECT_ACTION_ID",
+ .help = "indirect action id",
.call = parse_int,
.comp = comp_none,
},
.call = parse_int,
.comp = comp_none,
},
.type = "{command} {port_id} [{arg} [...]]",
.help = "manage ingress/egress flow rules",
.next = NEXT(NEXT_ENTRY
.type = "{command} {port_id} [{arg} [...]]",
.help = "manage ingress/egress flow rules",
.next = NEXT(NEXT_ENTRY
VALIDATE,
CREATE,
DESTROY,
VALIDATE,
CREATE,
DESTROY,
.call = parse_init,
},
/* Top-level command. */
.call = parse_init,
},
/* Top-level command. */
- [SHARED_ACTION] = {
- .name = "shared_action",
+ [INDIRECT_ACTION] = {
+ .name = "indirect_action",
.type = "{command} {port_id} [{arg} [...]]",
.type = "{command} {port_id} [{arg} [...]]",
- .help = "manage shared actions",
- .next = NEXT(next_sa_subcmd, NEXT_ENTRY(PORT_ID)),
+ .help = "manage indirect actions",
+ .next = NEXT(next_ia_subcmd, NEXT_ENTRY(PORT_ID)),
.args = ARGS(ARGS_ENTRY(struct buffer, port)),
.args = ARGS(ARGS_ENTRY(struct buffer, port)),
},
/* Sub-level commands. */
},
/* Sub-level commands. */
- [SHARED_ACTION_CREATE] = {
+ [INDIRECT_ACTION_CREATE] = {
- .help = "create shared action",
- .next = NEXT(next_sa_create_attr),
- .call = parse_sa,
+ .help = "create indirect action",
+ .next = NEXT(next_ia_create_attr),
+ .call = parse_ia,
- [SHARED_ACTION_UPDATE] = {
+ [INDIRECT_ACTION_UPDATE] = {
- .help = "update shared action",
- .next = NEXT(NEXT_ENTRY(SHARED_ACTION_SPEC),
- NEXT_ENTRY(SHARED_ACTION_ID)),
+ .help = "update indirect action",
+ .next = NEXT(NEXT_ENTRY(INDIRECT_ACTION_SPEC),
+ NEXT_ENTRY(INDIRECT_ACTION_ID)),
.args = ARGS(ARGS_ENTRY(struct buffer, args.vc.attr.group)),
.args = ARGS(ARGS_ENTRY(struct buffer, args.vc.attr.group)),
- [SHARED_ACTION_DESTROY] = {
+ [INDIRECT_ACTION_DESTROY] = {
- .help = "destroy shared action",
- .next = NEXT(NEXT_ENTRY(SHARED_ACTION_DESTROY_ID)),
+ .help = "destroy indirect action",
+ .next = NEXT(NEXT_ENTRY(INDIRECT_ACTION_DESTROY_ID)),
.args = ARGS(ARGS_ENTRY(struct buffer, port)),
.args = ARGS(ARGS_ENTRY(struct buffer, port)),
- .call = parse_sa_destroy,
+ .call = parse_ia_destroy,
- [SHARED_ACTION_QUERY] = {
+ [INDIRECT_ACTION_QUERY] = {
- .help = "query shared action",
- .next = NEXT(NEXT_ENTRY(END), NEXT_ENTRY(SHARED_ACTION_ID)),
- .args = ARGS(ARGS_ENTRY(struct buffer, args.sa.action_id)),
- .call = parse_sa,
+ .help = "query indirect action",
+ .next = NEXT(NEXT_ENTRY(END), NEXT_ENTRY(INDIRECT_ACTION_ID)),
+ .args = ARGS(ARGS_ENTRY(struct buffer, args.ia.action_id)),
+ .call = parse_ia,
},
[VALIDATE] = {
.name = "validate",
},
[VALIDATE] = {
.name = "validate",
.call = parse_vc_action_sample_index,
.comp = comp_set_sample_index,
},
.call = parse_vc_action_sample_index,
.comp = comp_set_sample_index,
},
- /* Shared action destroy arguments. */
- [SHARED_ACTION_DESTROY_ID] = {
+ /* Indirect action destroy arguments. */
+ [INDIRECT_ACTION_DESTROY_ID] = {
- .help = "specify a shared action id to destroy",
- .next = NEXT(next_sa_destroy_attr,
- NEXT_ENTRY(SHARED_ACTION_ID)),
+ .help = "specify a indirect action id to destroy",
+ .next = NEXT(next_ia_destroy_attr,
+ NEXT_ENTRY(INDIRECT_ACTION_ID)),
.args = ARGS(ARGS_ENTRY_PTR(struct buffer,
.args = ARGS(ARGS_ENTRY_PTR(struct buffer,
- args.sa_destroy.action_id)),
- .call = parse_sa_destroy,
+ args.ia_destroy.action_id)),
+ .call = parse_ia_destroy,
- /* Shared action create arguments. */
- [SHARED_ACTION_CREATE_ID] = {
+ /* Indirect action create arguments. */
+ [INDIRECT_ACTION_CREATE_ID] = {
- .help = "specify a shared action id to create",
- .next = NEXT(next_sa_create_attr,
- NEXT_ENTRY(SHARED_ACTION_ID)),
+ .help = "specify a indirect action id to create",
+ .next = NEXT(next_ia_create_attr,
+ NEXT_ENTRY(INDIRECT_ACTION_ID)),
.args = ARGS(ARGS_ENTRY(struct buffer, args.vc.attr.group)),
},
.args = ARGS(ARGS_ENTRY(struct buffer, args.vc.attr.group)),
},
- [ACTION_SHARED] = {
- .name = "shared",
- .help = "apply shared action by id",
- .priv = PRIV_ACTION(SHARED, 0),
- .next = NEXT(NEXT_ENTRY(SHARED_ACTION_ID2PTR)),
+ [ACTION_INDIRECT] = {
+ .name = "indirect",
+ .help = "apply indirect action by id",
+ .priv = PRIV_ACTION(INDIRECT, 0),
+ .next = NEXT(NEXT_ENTRY(INDIRECT_ACTION_ID2PTR)),
.args = ARGS(ARGS_ENTRY_ARB(0, sizeof(uint32_t))),
.call = parse_vc,
},
.args = ARGS(ARGS_ENTRY_ARB(0, sizeof(uint32_t))),
.call = parse_vc,
},
- [SHARED_ACTION_ID2PTR] = {
+ [INDIRECT_ACTION_ID2PTR] = {
- .type = "SHARED_ACTION_ID",
- .help = "shared action id",
+ .type = "INDIRECT_ACTION_ID",
+ .help = "indirect action id",
.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
- .call = parse_sa_id2ptr,
+ .call = parse_ia_id2ptr,
- [SHARED_ACTION_INGRESS] = {
+ [INDIRECT_ACTION_INGRESS] = {
.name = "ingress",
.help = "affect rule to ingress",
.name = "ingress",
.help = "affect rule to ingress",
- .next = NEXT(next_sa_create_attr),
- .call = parse_sa,
+ .next = NEXT(next_ia_create_attr),
+ .call = parse_ia,
- [SHARED_ACTION_EGRESS] = {
+ [INDIRECT_ACTION_EGRESS] = {
.name = "egress",
.help = "affect rule to egress",
.name = "egress",
.help = "affect rule to egress",
- .next = NEXT(next_sa_create_attr),
- .call = parse_sa,
+ .next = NEXT(next_ia_create_attr),
+ .call = parse_ia,
- [SHARED_ACTION_TRANSFER] = {
+ [INDIRECT_ACTION_TRANSFER] = {
.name = "transfer",
.help = "affect rule to transfer",
.name = "transfer",
.help = "affect rule to transfer",
- .next = NEXT(next_sa_create_attr),
- .call = parse_sa,
+ .next = NEXT(next_ia_create_attr),
+ .call = parse_ia,
- [SHARED_ACTION_SPEC] = {
+ [INDIRECT_ACTION_SPEC] = {
- .help = "specify action to share",
+ .help = "specify action to create indirect handle",
.next = NEXT(next_action),
},
};
.next = NEXT(next_action),
},
};
-/** Parse tokens for shared action commands. */
+/** Parse tokens for indirect action commands. */
-parse_sa(struct context *ctx, const struct token *token,
+parse_ia(struct context *ctx, const struct token *token,
const char *str, unsigned int len,
void *buf, unsigned int size)
{
const char *str, unsigned int len,
void *buf, unsigned int size)
{
if (!out)
return len;
if (!out->command) {
if (!out)
return len;
if (!out->command) {
- if (ctx->curr != SHARED_ACTION)
+ if (ctx->curr != INDIRECT_ACTION)
return -1;
if (sizeof(*out) > size)
return -1;
return -1;
if (sizeof(*out) > size)
return -1;
return len;
}
switch (ctx->curr) {
return len;
}
switch (ctx->curr) {
- case SHARED_ACTION_CREATE:
- case SHARED_ACTION_UPDATE:
+ case INDIRECT_ACTION_CREATE:
+ case INDIRECT_ACTION_UPDATE:
out->args.vc.actions =
(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),
sizeof(double));
out->args.vc.attr.group = UINT32_MAX;
/* fallthrough */
out->args.vc.actions =
(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),
sizeof(double));
out->args.vc.attr.group = UINT32_MAX;
/* fallthrough */
- case SHARED_ACTION_QUERY:
+ case INDIRECT_ACTION_QUERY:
out->command = ctx->curr;
ctx->objdata = 0;
ctx->object = out;
ctx->objmask = NULL;
return len;
out->command = ctx->curr;
ctx->objdata = 0;
ctx->object = out;
ctx->objmask = NULL;
return len;
- case SHARED_ACTION_EGRESS:
+ case INDIRECT_ACTION_EGRESS:
out->args.vc.attr.egress = 1;
return len;
out->args.vc.attr.egress = 1;
return len;
- case SHARED_ACTION_INGRESS:
+ case INDIRECT_ACTION_INGRESS:
out->args.vc.attr.ingress = 1;
return len;
out->args.vc.attr.ingress = 1;
return len;
- case SHARED_ACTION_TRANSFER:
+ case INDIRECT_ACTION_TRANSFER:
out->args.vc.attr.transfer = 1;
return len;
default:
out->args.vc.attr.transfer = 1;
return len;
default:
-/** Parse tokens for shared action destroy command. */
+/** Parse tokens for indirect action destroy command. */
-parse_sa_destroy(struct context *ctx, const struct token *token,
+parse_ia_destroy(struct context *ctx, const struct token *token,
const char *str, unsigned int len,
void *buf, unsigned int size)
{
const char *str, unsigned int len,
void *buf, unsigned int size)
{
/* Nothing else to do if there is no buffer. */
if (!out)
return len;
/* Nothing else to do if there is no buffer. */
if (!out)
return len;
- if (!out->command || out->command == SHARED_ACTION) {
- if (ctx->curr != SHARED_ACTION_DESTROY)
+ if (!out->command || out->command == INDIRECT_ACTION) {
+ if (ctx->curr != INDIRECT_ACTION_DESTROY)
return -1;
if (sizeof(*out) > size)
return -1;
return -1;
if (sizeof(*out) > size)
return -1;
ctx->objdata = 0;
ctx->object = out;
ctx->objmask = NULL;
ctx->objdata = 0;
ctx->object = out;
ctx->objmask = NULL;
- out->args.sa_destroy.action_id =
+ out->args.ia_destroy.action_id =
(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),
sizeof(double));
return len;
}
(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),
sizeof(double));
return len;
}
- action_id = out->args.sa_destroy.action_id
- + out->args.sa_destroy.action_id_n++;
+ action_id = out->args.ia_destroy.action_id
+ + out->args.ia_destroy.action_id_n++;
if ((uint8_t *)action_id > (uint8_t *)out + size)
return -1;
ctx->objdata = 0;
if ((uint8_t *)action_id > (uint8_t *)out + size)
return -1;
ctx->objdata = 0;
-parse_sa_id2ptr(struct context *ctx, const struct token *token,
+parse_ia_id2ptr(struct context *ctx, const struct token *token,
const char *str, unsigned int len,
void *buf, unsigned int size)
{
const char *str, unsigned int len,
void *buf, unsigned int size)
{
ctx->object = action;
if (ret != (int)len)
return ret;
ctx->object = action;
if (ret != (int)len)
return ret;
- /* set shared action */
+ /* set indirect action */
- action->conf = port_shared_action_get_by_id(ctx->port, id);
+ action->conf = port_action_handle_get_by_id(ctx->port, id);
ret = (action->conf) ? ret : -1;
}
return ret;
ret = (action->conf) ? ret : -1;
}
return ret;
cmd_flow_parsed(const struct buffer *in)
{
switch (in->command) {
cmd_flow_parsed(const struct buffer *in)
{
switch (in->command) {
- case SHARED_ACTION_CREATE:
- port_shared_action_create(
+ case INDIRECT_ACTION_CREATE:
+ port_action_handle_create(
in->port, in->args.vc.attr.group,
in->port, in->args.vc.attr.group,
- &((const struct rte_flow_shared_action_conf) {
+ &((const struct rte_flow_indir_action_conf) {
.ingress = in->args.vc.attr.ingress,
.egress = in->args.vc.attr.egress,
.transfer = in->args.vc.attr.transfer,
}),
in->args.vc.actions);
break;
.ingress = in->args.vc.attr.ingress,
.egress = in->args.vc.attr.egress,
.transfer = in->args.vc.attr.transfer,
}),
in->args.vc.actions);
break;
- case SHARED_ACTION_DESTROY:
- port_shared_action_destroy(in->port,
- in->args.sa_destroy.action_id_n,
- in->args.sa_destroy.action_id);
+ case INDIRECT_ACTION_DESTROY:
+ port_action_handle_destroy(in->port,
+ in->args.ia_destroy.action_id_n,
+ in->args.ia_destroy.action_id);
- case SHARED_ACTION_UPDATE:
- port_shared_action_update(in->port, in->args.vc.attr.group,
+ case INDIRECT_ACTION_UPDATE:
+ port_action_handle_update(in->port, in->args.vc.attr.group,
in->args.vc.actions);
break;
in->args.vc.actions);
break;
- case SHARED_ACTION_QUERY:
- port_shared_action_query(in->port, in->args.sa.action_id);
+ case INDIRECT_ACTION_QUERY:
+ port_action_handle_query(in->port, in->args.ia.action_id);
break;
case VALIDATE:
port_flow_validate(in->port, &in->args.vc.attr,
break;
case VALIDATE:
port_flow_validate(in->port, &in->args.vc.attr,
-static struct port_shared_action *
+static struct port_indirect_action *
action_get_by_id(portid_t port_id, uint32_t id)
{
struct rte_port *port;
action_get_by_id(portid_t port_id, uint32_t id)
{
struct rte_port *port;
- struct port_shared_action **ppsa;
- struct port_shared_action *psa = NULL;
+ struct port_indirect_action **ppia;
+ struct port_indirect_action *pia = NULL;
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
port_id == (portid_t)RTE_PORT_ALL)
return NULL;
port = &ports[port_id];
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
port_id == (portid_t)RTE_PORT_ALL)
return NULL;
port = &ports[port_id];
- ppsa = &port->actions_list;
- while (*ppsa) {
- if ((*ppsa)->id == id) {
- psa = *ppsa;
+ ppia = &port->actions_list;
+ while (*ppia) {
+ if ((*ppia)->id == id) {
+ pia = *ppia;
- if (!psa)
- printf("Failed to find shared action #%u on port %u\n",
+ if (!pia)
+ printf("Failed to find indirect action #%u on port %u\n",
}
static int
action_alloc(portid_t port_id, uint32_t id,
}
static int
action_alloc(portid_t port_id, uint32_t id,
- struct port_shared_action **action)
+ struct port_indirect_action **action)
- struct port_shared_action **ppsa;
- struct port_shared_action *psa = NULL;
+ struct port_indirect_action **ppia;
+ struct port_indirect_action *pia = NULL;
*action = NULL;
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
*action = NULL;
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
/* taking first available ID */
if (port->actions_list) {
if (port->actions_list->id == UINT32_MAX - 1) {
/* taking first available ID */
if (port->actions_list) {
if (port->actions_list->id == UINT32_MAX - 1) {
- printf("Highest shared action ID is already"
+ printf("Highest indirect action ID is already"
" assigned, delete it first\n");
return -ENOMEM;
}
" assigned, delete it first\n");
return -ENOMEM;
}
- psa = calloc(1, sizeof(*psa));
- if (!psa) {
- printf("Allocation of port %u shared action failed\n",
+ pia = calloc(1, sizeof(*pia));
+ if (!pia) {
+ printf("Allocation of port %u indirect action failed\n",
port_id);
return -ENOMEM;
}
port_id);
return -ENOMEM;
}
- ppsa = &port->actions_list;
- while (*ppsa && (*ppsa)->id > id)
- ppsa = &(*ppsa)->next;
- if (*ppsa && (*ppsa)->id == id) {
- printf("Shared action #%u is already assigned,"
+ ppia = &port->actions_list;
+ while (*ppia && (*ppia)->id > id)
+ ppia = &(*ppia)->next;
+ if (*ppia && (*ppia)->id == id) {
+ printf("Indirect action #%u is already assigned,"
" delete it first\n", id);
" delete it first\n", id);
- psa->next = *ppsa;
- psa->id = id;
- *ppsa = psa;
- *action = psa;
+ pia->next = *ppia;
+ pia->id = id;
+ *ppia = pia;
+ *action = pia;
-/** Create shared action */
+/** Create indirect action */
-port_shared_action_create(portid_t port_id, uint32_t id,
- const struct rte_flow_shared_action_conf *conf,
+port_action_handle_create(portid_t port_id, uint32_t id,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action)
{
const struct rte_flow_action *action)
{
- struct port_shared_action *psa;
+ struct port_indirect_action *pia;
int ret;
struct rte_flow_error error;
int ret;
struct rte_flow_error error;
- ret = action_alloc(port_id, id, &psa);
+ ret = action_alloc(port_id, id, &pia);
if (ret)
return ret;
if (action->type == RTE_FLOW_ACTION_TYPE_AGE) {
struct rte_flow_action_age *age =
(struct rte_flow_action_age *)(uintptr_t)(action->conf);
if (ret)
return ret;
if (action->type == RTE_FLOW_ACTION_TYPE_AGE) {
struct rte_flow_action_age *age =
(struct rte_flow_action_age *)(uintptr_t)(action->conf);
- psa->age_type = ACTION_AGE_CONTEXT_TYPE_SHARED_ACTION;
- age->context = &psa->age_type;
+ pia->age_type = ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION;
+ age->context = &pia->age_type;
}
/* Poisoning to make sure PMDs update it in case of error. */
memset(&error, 0x22, sizeof(error));
}
/* Poisoning to make sure PMDs update it in case of error. */
memset(&error, 0x22, sizeof(error));
- psa->action = rte_flow_shared_action_create(port_id, conf, action,
+ pia->handle = rte_flow_action_handle_create(port_id, conf, action,
- if (!psa->action) {
- uint32_t destroy_id = psa->id;
- port_shared_action_destroy(port_id, 1, &destroy_id);
+ if (!pia->handle) {
+ uint32_t destroy_id = pia->id;
+ port_action_handle_destroy(port_id, 1, &destroy_id);
return port_flow_complain(&error);
}
return port_flow_complain(&error);
}
- psa->type = action->type;
- printf("Shared action #%u created\n", psa->id);
+ pia->type = action->type;
+ printf("Indirect action #%u created\n", pia->id);
-/** Destroy shared action */
+/** Destroy indirect action */
-port_shared_action_destroy(portid_t port_id,
+port_action_handle_destroy(portid_t port_id,
uint32_t n,
const uint32_t *actions)
{
struct rte_port *port;
uint32_t n,
const uint32_t *actions)
{
struct rte_port *port;
- struct port_shared_action **tmp;
+ struct port_indirect_action **tmp;
uint32_t c = 0;
int ret = 0;
uint32_t c = 0;
int ret = 0;
for (i = 0; i != n; ++i) {
struct rte_flow_error error;
for (i = 0; i != n; ++i) {
struct rte_flow_error error;
- struct port_shared_action *psa = *tmp;
+ struct port_indirect_action *pia = *tmp;
- if (actions[i] != psa->id)
+ if (actions[i] != pia->id)
continue;
/*
* Poisoning to make sure PMDs update it in case
continue;
/*
* Poisoning to make sure PMDs update it in case
*/
memset(&error, 0x33, sizeof(error));
*/
memset(&error, 0x33, sizeof(error));
- if (psa->action && rte_flow_shared_action_destroy(
- port_id, psa->action, &error)) {
+ if (pia->handle && rte_flow_action_handle_destroy(
+ port_id, pia->handle, &error)) {
ret = port_flow_complain(&error);
continue;
}
ret = port_flow_complain(&error);
continue;
}
- *tmp = psa->next;
- printf("Shared action #%u destroyed\n", psa->id);
- free(psa);
+ *tmp = pia->next;
+ printf("Indirect action #%u destroyed\n", pia->id);
+ free(pia);
-/** Get shared action by port + id */
-struct rte_flow_shared_action *
-port_shared_action_get_by_id(portid_t port_id, uint32_t id)
+/** Get indirect action by port + id */
+struct rte_flow_action_handle *
+port_action_handle_get_by_id(portid_t port_id, uint32_t id)
- struct port_shared_action *psa = action_get_by_id(port_id, id);
+ struct port_indirect_action *pia = action_get_by_id(port_id, id);
- return (psa) ? psa->action : NULL;
+ return (pia) ? pia->handle : NULL;
-/** Update shared action */
+/** Update indirect action */
-port_shared_action_update(portid_t port_id, uint32_t id,
+port_action_handle_update(portid_t port_id, uint32_t id,
const struct rte_flow_action *action)
{
struct rte_flow_error error;
const struct rte_flow_action *action)
{
struct rte_flow_error error;
- struct rte_flow_shared_action *shared_action;
+ struct rte_flow_action_handle *action_handle;
- shared_action = port_shared_action_get_by_id(port_id, id);
- if (!shared_action)
+ action_handle = port_action_handle_get_by_id(port_id, id);
+ if (!action_handle)
- if (rte_flow_shared_action_update(port_id, shared_action, action,
+ if (rte_flow_action_handle_update(port_id, action_handle, action,
&error)) {
return port_flow_complain(&error);
}
&error)) {
return port_flow_complain(&error);
}
- printf("Shared action #%u updated\n", id);
+ printf("Indirect action #%u updated\n", id);
-port_shared_action_query(portid_t port_id, uint32_t id)
+port_action_handle_query(portid_t port_id, uint32_t id)
{
struct rte_flow_error error;
{
struct rte_flow_error error;
- struct port_shared_action *psa;
+ struct port_indirect_action *pia;
uint64_t default_data;
void *data = NULL;
int ret = 0;
uint64_t default_data;
void *data = NULL;
int ret = 0;
- psa = action_get_by_id(port_id, id);
- if (!psa)
+ pia = action_get_by_id(port_id, id);
+ if (!pia)
case RTE_FLOW_ACTION_TYPE_RSS:
case RTE_FLOW_ACTION_TYPE_AGE:
data = &default_data;
break;
default:
case RTE_FLOW_ACTION_TYPE_RSS:
case RTE_FLOW_ACTION_TYPE_AGE:
data = &default_data;
break;
default:
- printf("Shared action %u (type: %d) on port %u doesn't support"
- " query\n", id, psa->type, port_id);
+ printf("Indirect action %u (type: %d) on port %u doesn't"
+ " support query\n", id, pia->type, port_id);
- if (rte_flow_shared_action_query(port_id, psa->action, data, &error))
+ if (rte_flow_action_handle_query(port_id, pia->handle, data, &error))
ret = port_flow_complain(&error);
ret = port_flow_complain(&error);
case RTE_FLOW_ACTION_TYPE_RSS:
if (!ret)
printf("Shared RSS action:\n\trefs:%u\n",
case RTE_FLOW_ACTION_TYPE_RSS:
if (!ret)
printf("Shared RSS action:\n\trefs:%u\n",
data = NULL;
break;
default:
data = NULL;
break;
default:
- printf("Shared action %u (type: %d) on port %u doesn't support"
- " query\n", id, psa->type, port_id);
+ printf("Indirect action %u (type: %d) on port %u doesn't"
+ " support query\n", id, pia->type, port_id);
enum age_action_context_type *type;
union {
struct port_flow *pf;
enum age_action_context_type *type;
union {
struct port_flow *pf;
- struct port_shared_action *psa;
+ struct port_indirect_action *pia;
} ctx;
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
} ctx;
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
&ctx.pf->id))
total++;
break;
&ctx.pf->id))
total++;
break;
- case ACTION_AGE_CONTEXT_TYPE_SHARED_ACTION:
- ctx.psa = container_of(type, struct port_shared_action,
- age_type);
- printf("%-20s\t%" PRIu32 "\n", "Shared action",
- ctx.psa->id);
+ case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION:
+ ctx.pia = container_of(type,
+ struct port_indirect_action, age_type);
+ printf("%-20s\t%" PRIu32 "\n", "Indirect action",
+ ctx.pia->id);
break;
default:
printf("Error: invalid context type %u\n", port_id);
break;
default:
printf("Error: invalid context type %u\n", port_id);
*/
enum age_action_context_type {
ACTION_AGE_CONTEXT_TYPE_FLOW,
*/
enum age_action_context_type {
ACTION_AGE_CONTEXT_TYPE_FLOW,
- ACTION_AGE_CONTEXT_TYPE_SHARED_ACTION,
+ ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION,
};
/** Descriptor for a single flow. */
};
/** Descriptor for a single flow. */
uint8_t data[]; /**< Storage for flow rule description */
};
uint8_t data[]; /**< Storage for flow rule description */
};
-/* Descriptor for shared action */
-struct port_shared_action {
- struct port_shared_action *next; /**< Next flow in list. */
- uint32_t id; /**< Shared action ID. */
+/* Descriptor for indirect action */
+struct port_indirect_action {
+ struct port_indirect_action *next; /**< Next flow in list. */
+ uint32_t id; /**< Indirect action ID. */
enum rte_flow_action_type type; /**< Action type. */
enum rte_flow_action_type type; /**< Action type. */
- struct rte_flow_shared_action *action; /**< Shared action handle. */
+ struct rte_flow_action_handle *handle; /**< Indirect action handle. */
enum age_action_context_type age_type; /**< Age action context type. */
};
enum age_action_context_type age_type; /**< Age action context type. */
};
uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */
uint8_t slave_flag; /**< bonding slave port */
struct port_flow *flow_list; /**< Associated flows. */
uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */
uint8_t slave_flag; /**< bonding slave port */
struct port_flow *flow_list; /**< Associated flows. */
- struct port_shared_action *actions_list;
- /**< Associated shared actions. */
+ struct port_indirect_action *actions_list;
+ /**< Associated indirect actions. */
LIST_HEAD(, port_flow_tunnel) flow_tunnel_list;
const struct rte_eth_rxtx_callback *rx_dump_cb[RTE_MAX_QUEUES_PER_PORT+1];
const struct rte_eth_rxtx_callback *tx_dump_cb[RTE_MAX_QUEUES_PER_PORT+1];
LIST_HEAD(, port_flow_tunnel) flow_tunnel_list;
const struct rte_eth_rxtx_callback *rx_dump_cb[RTE_MAX_QUEUES_PER_PORT+1];
const struct rte_eth_rxtx_callback *tx_dump_cb[RTE_MAX_QUEUES_PER_PORT+1];
uint8_t bit1_pos, uint8_t bit2_pos, uint32_t value);
void port_reg_display(portid_t port_id, uint32_t reg_off);
void port_reg_set(portid_t port_id, uint32_t reg_off, uint32_t value);
uint8_t bit1_pos, uint8_t bit2_pos, uint32_t value);
void port_reg_display(portid_t port_id, uint32_t reg_off);
void port_reg_set(portid_t port_id, uint32_t reg_off, uint32_t value);
-int port_shared_action_create(portid_t port_id, uint32_t id,
- const struct rte_flow_shared_action_conf *conf,
+int port_action_handle_create(portid_t port_id, uint32_t id,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action);
const struct rte_flow_action *action);
-int port_shared_action_destroy(portid_t port_id,
+int port_action_handle_destroy(portid_t port_id,
uint32_t n, const uint32_t *action);
uint32_t n, const uint32_t *action);
-struct rte_flow_shared_action *port_shared_action_get_by_id(portid_t port_id,
+struct rte_flow_action_handle *port_action_handle_get_by_id(portid_t port_id,
-int port_shared_action_update(portid_t port_id, uint32_t id,
+int port_action_handle_update(portid_t port_id, uint32_t id,
const struct rte_flow_action *action);
int port_flow_validate(portid_t port_id,
const struct rte_flow_attr *attr,
const struct rte_flow_action *action);
int port_flow_validate(portid_t port_id,
const struct rte_flow_attr *attr,
const struct rte_flow_item *pattern,
const struct rte_flow_action *actions,
const struct tunnel_ops *tunnel_ops);
const struct rte_flow_item *pattern,
const struct rte_flow_action *actions,
const struct tunnel_ops *tunnel_ops);
-int port_shared_action_query(portid_t port_id, uint32_t id);
+int port_action_handle_query(portid_t port_id, uint32_t id);
void update_age_action_context(const struct rte_flow_action *actions,
struct port_flow *pf);
int port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule);
void update_age_action_context(const struct rte_flow_action *actions,
struct port_flow *pf);
int port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule);
For ports within the same switch domain then the counter id namespace extends
to all ports within that switch domain.
For ports within the same switch domain then the counter id namespace extends
to all ports within that switch domain.
-The shared flag is DEPRECATED and ``SHARED`` ``COUNT`` action should be used
+The shared flag is DEPRECATED and ``INDIRECT`` ``COUNT`` action should be used
to make shared counters.
.. _table_rte_flow_action_count:
to make shared counters.
.. _table_rte_flow_action_count:
| ``actions`` | sub-action list for sampling |
+--------------+---------------------------------+
| ``actions`` | sub-action list for sampling |
+--------------+---------------------------------+
-Action: ``SHARED``
-^^^^^^^^^^^^^^^^^^
+Action: ``INDIRECT``
+^^^^^^^^^^^^^^^^^^^^
-Flow utilize shared action by handle as returned from
-``rte_flow_shared_action_create()``.
+Flow utilize indirect action by handle as returned from
+``rte_flow_action_handle_create()``.
-The behaviour of the shared action defined by ``action`` argument of type
-``struct rte_flow_action`` passed to ``rte_flow_shared_action_create()``.
+The behaviour of the indirect action defined by ``action`` argument of type
+``struct rte_flow_action`` passed to ``rte_flow_action_handle_create()``.
-Multiple flows can use the same shared action.
-The shared action can be in-place updated by ``rte_flow_shared_action_update()``
-without destroying flow and creating flow again.
+The indirect action can be used by a single flow or shared among multiple flows.
+The indirect action can be in-place updated by ``rte_flow_action_handle_update()``
+without destroying flow and creating flow again. The fields that could be
+updated depend on the type of the ``action`` and different for every type.
-The shared action specified data (e.g. counter) can be queried by
-``rte_flow_shared_action_query()``.
+The indirect action specified data (e.g. counter) can be queried by
+``rte_flow_action_handle_query()``.
-.. _table_rte_flow_shared_action:
+.. _table_rte_flow_action_handle:
+---------------+
| Field |
+---------------+
| Field |
``rte_cryptodev_raw_dequeue_burst`` got a new parameter
``max_nb_to_dequeue`` to provide flexible control on dequeue.
``rte_cryptodev_raw_dequeue_burst`` got a new parameter
``max_nb_to_dequeue`` to provide flexible control on dequeue.
+* ethdev: The experimental flow API for shared action has been generalized
+ as a flow action handle used in rules through an indirect action.
+ The functions ``rte_flow_shared_action_*`` manipulating the action object
+ are replaced with ``rte_flow_action_handle_*``.
+ The action ``RTE_FLOW_ACTION_TYPE_SHARED`` is deprecated and can be
+ replaced with ``RTE_FLOW_ACTION_TYPE_INDIRECT``.
+
- ``dscp_value {unsigned}``: The new DSCP value to be set
- ``dscp_value {unsigned}``: The new DSCP value to be set
-- ``shared``: Use shared action created via
- ``flow shared_action {port_id} create``
+- ``indirect``: Use indirect action created via
+ ``flow indirect_action {port_id} create``
- - ``shared_action_id {unsigned}``: Shared action ID to use
+ - ``indirect_action_id {unsigned}``: Indirect action ID to use
Destroying flow rules
~~~~~~~~~~~~~~~~~~~~~
Destroying flow rules
~~~~~~~~~~~~~~~~~~~~~
testpmd> flow aged 0
Port 0 total aged flows: 0
testpmd> flow aged 0
Port 0 total aged flows: 0
-Creating shared actions
-~~~~~~~~~~~~~~~~~~~~~~~
-``flow shared_action {port_id} create`` creates shared action with optional
-shared action ID. It is bound to ``rte_flow_shared_action_create()``::
+Creating indirect actions
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``flow indirect_action {port_id} create`` creates indirect action with optional
+indirect action ID. It is bound to ``rte_flow_action_handle_create()``::
- flow shared_action {port_id} create [action_id {shared_action_id}]
+ flow indirect_action {port_id} create [action_id {indirect_action_id}]
[ingress] [egress] [transfer] action {action} / end
If successful, it will show::
[ingress] [egress] [transfer] action {action} / end
If successful, it will show::
- Shared action #[...] created
+ Indirect action #[...] created
-Otherwise, it will complain either that shared action already exists or that
+Otherwise, it will complain either that indirect action already exists or that
- Shared action #[...] is already assigned, delete it first
+ Indirect action #[...] is already assigned, delete it first
::
Caught error type [...] ([...]): [...]
::
Caught error type [...] ([...]): [...]
-Create shared rss action with id 100 to queues 1 and 2 on port 0::
+Create indirect rss action with id 100 to queues 1 and 2 on port 0::
- testpmd> flow shared_action 0 create action_id 100 \
+ testpmd> flow indirect_action 0 create action_id 100 \
ingress action rss queues 1 2 end / end
ingress action rss queues 1 2 end / end
-Create shared rss action with id assigned by testpmd to queues 1 and 2 on
+Create indirect rss action with id assigned by testpmd to queues 1 and 2 on
- testpmd> flow shared_action 0 create action_id \
+ testpmd> flow indirect_action 0 create action_id \
ingress action rss queues 0 1 end / end
ingress action rss queues 0 1 end / end
-Updating shared actions
-~~~~~~~~~~~~~~~~~~~~~~~
-``flow shared_action {port_id} update`` updates configuration of the shared
-action from its shared action ID (as returned by
-``flow shared_action {port_id} create``). It is bound to
-``rte_flow_shared_action_update()``::
+Updating indirect actions
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``flow indirect_action {port_id} update`` updates configuration of the indirect
+action from its indirect action ID (as returned by
+``flow indirect_action {port_id} create``). It is bound to
+``rte_flow_action_handle_update()``::
- flow shared_action {port_id} update {shared_action_id}
+ flow indirect_action {port_id} update {indirect_action_id}
action {action} / end
If successful, it will show::
action {action} / end
If successful, it will show::
- Shared action #[...] updated
+ Indirect action #[...] updated
-Otherwise, it will complain either that shared action not found or that some
+Otherwise, it will complain either that indirect action not found or that some
- Failed to find shared action #[...] on port [...]
+ Failed to find indirect action #[...] on port [...]
::
Caught error type [...] ([...]): [...]
::
Caught error type [...] ([...]): [...]
-Update shared rss action having id 100 on port 0 with rss to queues 0 and 3
+Update indirect rss action having id 100 on port 0 with rss to queues 0 and 3
(in create example above rss queues were 1 and 2)::
(in create example above rss queues were 1 and 2)::
- testpmd> flow shared_action 0 update 100 action rss queues 0 3 end / end
+ testpmd> flow indirect_action 0 update 100 action rss queues 0 3 end / end
-Destroying shared actions
-~~~~~~~~~~~~~~~~~~~~~~~~~
-``flow shared_action {port_id} update`` destroys one or more shared actions
-from their shared action IDs (as returned by
-``flow shared_action {port_id} create``). It is bound to
-``rte_flow_shared_action_destroy()``::
+Destroying indirect actions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``flow indirect_action {port_id} destroy`` destroys one or more indirect actions
+from their indirect action IDs (as returned by
+``flow indirect_action {port_id} create``). It is bound to
+``rte_flow_action_handle_destroy()``::
- flow shared_action {port_id} destroy action_id {shared_action_id} [...]
+ flow indirect_action {port_id} destroy action_id {indirect_action_id} [...]
If successful, it will show::
If successful, it will show::
- Shared action #[...] destroyed
+ Indirect action #[...] destroyed
-It does not report anything for shared action IDs that do not exist.
-The usual error message is shown when a shared action cannot be destroyed::
+It does not report anything for indirect action IDs that do not exist.
+The usual error message is shown when a indirect action cannot be destroyed::
Caught error type [...] ([...]): [...]
Caught error type [...] ([...]): [...]
-Destroy shared actions having id 100 & 101::
+Destroy indirect actions having id 100 & 101::
- testpmd> flow shared_action 0 destroy action_id 100 action_id 101
+ testpmd> flow indirect_action 0 destroy action_id 100 action_id 101
-Query shared actions
-~~~~~~~~~~~~~~~~~~~~
-``flow shared_action {port_id} query`` queries the shared action from its
-shared action ID (as returned by ``flow shared_action {port_id} create``).
-It is bound to ``rte_flow_shared_action_query()``::
+Query indirect actions
+~~~~~~~~~~~~~~~~~~~~~~
+
+``flow indirect_action {port_id} query`` queries the indirect action from its
+indirect action ID (as returned by ``flow indirect_action {port_id} create``).
+It is bound to ``rte_flow_action_handle_query()``::
- flow shared_action {port_id} query {shared_action_id}
+ flow indirect_action {port_id} query {indirect_action_id}
-Currently only rss shared action supported. If successful, it will show::
+Currently only rss indirect action supported. If successful, it will show::
-Otherwise, it will complain either that shared action not found or that some
+Otherwise, it will complain either that indirect action not found or that some
- Failed to find shared action #[...] on port [...]
+ Failed to find indirect action #[...] on port [...]
::
Caught error type [...] ([...]): [...]
::
Caught error type [...] ([...]): [...]
-Query shared action having id 100::
+Query indirect action having id 100::
- testpmd> flow shared_action 0 query 100
+ testpmd> flow indirect_action 0 query 100
Sample QinQ flow rules
~~~~~~~~~~~~~~~~~~~~~~
Sample QinQ flow rules
~~~~~~~~~~~~~~~~~~~~~~
* then this will return directly without any action.
*/
mlx5_flow_list_flush(dev, &priv->flows, true);
* then this will return directly without any action.
*/
mlx5_flow_list_flush(dev, &priv->flows, true);
- mlx5_shared_action_flush(dev);
+ mlx5_action_handle_flush(dev);
mlx5_flow_meter_flush(dev, NULL);
/* Prevent crashes when queues are still in use. */
dev->rx_pkt_burst = removed_rx_burst;
mlx5_flow_meter_flush(dev, NULL);
/* Prevent crashes when queues are still in use. */
dev->rx_pkt_burst = removed_rx_burst;
#define MLX5_HAIRPIN_QUEUE_STRIDE 6
#define MLX5_HAIRPIN_JUMBO_LOG_SIZE (14 + 2)
#define MLX5_HAIRPIN_QUEUE_STRIDE 6
#define MLX5_HAIRPIN_JUMBO_LOG_SIZE (14 + 2)
-/* Maximum number of shared actions supported by rte_flow */
-#define MLX5_MAX_SHARED_ACTIONS 2
+/* Maximum number of indirect actions supported by rte_flow */
+#define MLX5_MAX_INDIRECT_ACTIONS 2
/*
* Linux definition of static_assert is found in /usr/include/assert.h.
/*
* Linux definition of static_assert is found in /usr/include/assert.h.
-static struct rte_flow_shared_action *
-mlx5_shared_action_create(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+static struct rte_flow_action_handle *
+mlx5_action_handle_create(struct rte_eth_dev *dev,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error);
const struct rte_flow_action *action,
struct rte_flow_error *error);
-static int mlx5_shared_action_destroy
+static int mlx5_action_handle_destroy
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *shared_action,
+ struct rte_flow_action_handle *handle,
struct rte_flow_error *error);
struct rte_flow_error *error);
-static int mlx5_shared_action_update
+static int mlx5_action_handle_update
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *shared_action,
- const struct rte_flow_action *action,
+ struct rte_flow_action_handle *handle,
+ const void *update,
struct rte_flow_error *error);
struct rte_flow_error *error);
-static int mlx5_shared_action_query
+static int mlx5_action_handle_query
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action *action,
+ const struct rte_flow_action_handle *handle,
void *data,
struct rte_flow_error *error);
static int
void *data,
struct rte_flow_error *error);
static int
.query = mlx5_flow_query,
.dev_dump = mlx5_flow_dev_dump,
.get_aged_flows = mlx5_flow_get_aged_flows,
.query = mlx5_flow_query,
.dev_dump = mlx5_flow_dev_dump,
.get_aged_flows = mlx5_flow_get_aged_flows,
- .shared_action_create = mlx5_shared_action_create,
- .shared_action_destroy = mlx5_shared_action_destroy,
- .shared_action_update = mlx5_shared_action_update,
- .shared_action_query = mlx5_shared_action_query,
+ .action_handle_create = mlx5_action_handle_create,
+ .action_handle_destroy = mlx5_action_handle_destroy,
+ .action_handle_update = mlx5_action_handle_update,
+ .action_handle_query = mlx5_action_handle_query,
.tunnel_decap_set = mlx5_flow_tunnel_decap_set,
.tunnel_match = mlx5_flow_tunnel_match,
.tunnel_action_decap_release = mlx5_flow_tunnel_action_release,
.tunnel_decap_set = mlx5_flow_tunnel_decap_set,
.tunnel_match = mlx5_flow_tunnel_match,
.tunnel_action_decap_release = mlx5_flow_tunnel_action_release,
return &pool->actions[offset - 1];
}
return &pool->actions[offset - 1];
}
-/* maps shared action to translated non shared in some actions array */
-struct mlx5_translated_shared_action {
- struct rte_flow_shared_action *action; /**< Shared action */
- int index; /**< Index in related array of rte_flow_action */
+/* maps indirect action to translated direct in some actions array */
+struct mlx5_translated_action_handle {
+ struct rte_flow_action_handle *action; /**< Indirect action handle. */
+ int index; /**< Index in related array of rte_flow_action. */
- * Translates actions of type RTE_FLOW_ACTION_TYPE_SHARED to related
- * non shared action if translation possible.
- * This functionality used to run same execution path for both shared & non
- * shared actions on flow create. All necessary preparations for shared
- * action handling should be preformed on *shared* actions list returned
+ * Translates actions of type RTE_FLOW_ACTION_TYPE_INDIRECT to related
+ * direct action if translation possible.
+ * This functionality used to run same execution path for both direct and
+ * indirect actions on flow create. All necessary preparations for indirect
+ * action handling should be performed on *handle* actions list returned
* from this call.
*
* @param[in] dev
* Pointer to Ethernet device.
* @param[in] actions
* List of actions to translate.
* from this call.
*
* @param[in] dev
* Pointer to Ethernet device.
* @param[in] actions
* List of actions to translate.
- * @param[out] shared
- * List to store translated shared actions.
- * @param[in, out] shared_n
- * Size of *shared* array. On return should be updated with number of shared
- * actions retrieved from the *actions* list.
+ * @param[out] handle
+ * List to store translated indirect action object handles.
+ * @param[in, out] indir_n
+ * Size of *handle* array. On return should be updated with number of
+ * indirect actions retrieved from the *actions* list.
* @param[out] translated_actions
* @param[out] translated_actions
- * List of actions where all shared actions were translated to non shared
+ * List of actions where all indirect actions were translated to direct
* if possible. NULL if no translation took place.
* @param[out] error
* Pointer to the error structure.
* if possible. NULL if no translation took place.
* @param[out] error
* Pointer to the error structure.
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int
-flow_shared_actions_translate(struct rte_eth_dev *dev,
+flow_action_handles_translate(struct rte_eth_dev *dev,
const struct rte_flow_action actions[],
const struct rte_flow_action actions[],
- struct mlx5_translated_shared_action *shared,
- int *shared_n,
+ struct mlx5_translated_action_handle *handle,
+ int *indir_n,
struct rte_flow_action **translated_actions,
struct rte_flow_error *error)
{
struct rte_flow_action **translated_actions,
struct rte_flow_error *error)
{
size_t actions_size;
int n;
int copied_n = 0;
size_t actions_size;
int n;
int copied_n = 0;
- struct mlx5_translated_shared_action *shared_end = NULL;
+ struct mlx5_translated_action_handle *handle_end = NULL;
for (n = 0; actions[n].type != RTE_FLOW_ACTION_TYPE_END; n++) {
for (n = 0; actions[n].type != RTE_FLOW_ACTION_TYPE_END; n++) {
- if (actions[n].type != RTE_FLOW_ACTION_TYPE_SHARED)
+ if (actions[n].type != RTE_FLOW_ACTION_TYPE_INDIRECT)
- if (copied_n == *shared_n) {
+ if (copied_n == *indir_n) {
return rte_flow_error_set
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM,
NULL, "too many shared actions");
}
return rte_flow_error_set
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM,
NULL, "too many shared actions");
}
- rte_memcpy(&shared[copied_n].action, &actions[n].conf,
+ rte_memcpy(&handle[copied_n].action, &actions[n].conf,
sizeof(actions[n].conf));
sizeof(actions[n].conf));
- shared[copied_n].index = n;
+ handle[copied_n].index = n;
if (!copied_n)
return 0;
actions_size = sizeof(struct rte_flow_action) * n;
if (!copied_n)
return 0;
actions_size = sizeof(struct rte_flow_action) * n;
return -ENOMEM;
}
memcpy(translated, actions, actions_size);
return -ENOMEM;
}
memcpy(translated, actions, actions_size);
- for (shared_end = shared + copied_n; shared < shared_end; shared++) {
+ for (handle_end = handle + copied_n; handle < handle_end; handle++) {
struct mlx5_shared_action_rss *shared_rss;
struct mlx5_shared_action_rss *shared_rss;
- uint32_t act_idx = (uint32_t)(uintptr_t)shared->action;
- uint32_t type = act_idx >> MLX5_SHARED_ACTION_TYPE_OFFSET;
- uint32_t idx = act_idx & ((1u << MLX5_SHARED_ACTION_TYPE_OFFSET)
- - 1);
+ uint32_t act_idx = (uint32_t)(uintptr_t)handle->action;
+ uint32_t type = act_idx >> MLX5_INDIRECT_ACTION_TYPE_OFFSET;
+ uint32_t idx = act_idx &
+ ((1u << MLX5_INDIRECT_ACTION_TYPE_OFFSET) - 1);
- case MLX5_SHARED_ACTION_TYPE_RSS:
+ case MLX5_INDIRECT_ACTION_TYPE_RSS:
shared_rss = mlx5_ipool_get
(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS], idx);
shared_rss = mlx5_ipool_get
(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS], idx);
- translated[shared->index].type =
+ translated[handle->index].type =
RTE_FLOW_ACTION_TYPE_RSS;
RTE_FLOW_ACTION_TYPE_RSS;
- translated[shared->index].conf =
+ translated[handle->index].conf =
&shared_rss->origin;
break;
&shared_rss->origin;
break;
- case MLX5_SHARED_ACTION_TYPE_AGE:
+ case MLX5_INDIRECT_ACTION_TYPE_AGE:
if (priv->sh->flow_hit_aso_en) {
if (priv->sh->flow_hit_aso_en) {
- translated[shared->index].type =
+ translated[handle->index].type =
(enum rte_flow_action_type)
MLX5_RTE_FLOW_ACTION_TYPE_AGE;
(enum rte_flow_action_type)
MLX5_RTE_FLOW_ACTION_TYPE_AGE;
- translated[shared->index].conf =
+ translated[handle->index].conf =
(void *)(uintptr_t)idx;
break;
}
(void *)(uintptr_t)idx;
break;
}
mlx5_free(translated);
return rte_flow_error_set
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
mlx5_free(translated);
return rte_flow_error_set
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
- NULL, "invalid shared action type");
+ NULL, "invalid indirect action type");
}
}
*translated_actions = translated;
}
}
*translated_actions = translated;
*/
static uint32_t
flow_get_shared_rss_action(struct rte_eth_dev *dev,
*/
static uint32_t
flow_get_shared_rss_action(struct rte_eth_dev *dev,
- struct mlx5_translated_shared_action *shared,
+ struct mlx5_translated_action_handle *handle,
- struct mlx5_translated_shared_action *shared_end;
+ struct mlx5_translated_action_handle *handle_end;
struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_shared_action_rss *shared_rss;
struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_shared_action_rss *shared_rss;
- for (shared_end = shared + shared_n; shared < shared_end; shared++) {
- uint32_t act_idx = (uint32_t)(uintptr_t)shared->action;
- uint32_t type = act_idx >> MLX5_SHARED_ACTION_TYPE_OFFSET;
+ for (handle_end = handle + shared_n; handle < handle_end; handle++) {
+ uint32_t act_idx = (uint32_t)(uintptr_t)handle->action;
+ uint32_t type = act_idx >> MLX5_INDIRECT_ACTION_TYPE_OFFSET;
- ((1u << MLX5_SHARED_ACTION_TYPE_OFFSET) - 1);
+ ((1u << MLX5_INDIRECT_ACTION_TYPE_OFFSET) - 1);
- case MLX5_SHARED_ACTION_TYPE_RSS:
+ case MLX5_INDIRECT_ACTION_TYPE_RSS:
shared_rss = mlx5_ipool_get
(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
idx);
shared_rss = mlx5_ipool_get
(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
idx);
struct rte_flow *flow = NULL;
struct mlx5_flow *dev_flow;
const struct rte_flow_action_rss *rss = NULL;
struct rte_flow *flow = NULL;
struct mlx5_flow *dev_flow;
const struct rte_flow_action_rss *rss = NULL;
- struct mlx5_translated_shared_action
- shared_actions[MLX5_MAX_SHARED_ACTIONS];
- int shared_actions_n = MLX5_MAX_SHARED_ACTIONS;
+ struct mlx5_translated_action_handle
+ indir_actions[MLX5_MAX_INDIRECT_ACTIONS];
+ int indir_actions_n = MLX5_MAX_INDIRECT_ACTIONS;
union {
struct mlx5_flow_expand_rss buf;
uint8_t buffer[2048];
union {
struct mlx5_flow_expand_rss buf;
uint8_t buffer[2048];
MLX5_ASSERT(wks);
rss_desc = &wks->rss_desc;
MLX5_ASSERT(wks);
rss_desc = &wks->rss_desc;
- ret = flow_shared_actions_translate(dev, original_actions,
- shared_actions,
- &shared_actions_n,
+ ret = flow_action_handles_translate(dev, original_actions,
+ indir_actions,
+ &indir_actions_n,
&translated_actions, error);
if (ret < 0) {
MLX5_ASSERT(translated_actions == NULL);
&translated_actions, error);
if (ret < 0) {
MLX5_ASSERT(translated_actions == NULL);
buf->entries = 1;
buf->entry[0].pattern = (void *)(uintptr_t)items;
}
buf->entries = 1;
buf->entry[0].pattern = (void *)(uintptr_t)items;
}
- rss_desc->shared_rss = flow_get_shared_rss_action(dev, shared_actions,
- shared_actions_n);
+ rss_desc->shared_rss = flow_get_shared_rss_action(dev, indir_actions,
+ indir_actions_n);
for (i = 0; i < buf->entries; ++i) {
/* Initialize flow split data. */
flow_split_info.prefix_layers = 0;
for (i = 0; i < buf->entries; ++i) {
/* Initialize flow split data. */
flow_split_info.prefix_layers = 0;
struct rte_flow_error *error)
{
int hairpin_flow;
struct rte_flow_error *error)
{
int hairpin_flow;
- struct mlx5_translated_shared_action
- shared_actions[MLX5_MAX_SHARED_ACTIONS];
- int shared_actions_n = MLX5_MAX_SHARED_ACTIONS;
+ struct mlx5_translated_action_handle
+ indir_actions[MLX5_MAX_INDIRECT_ACTIONS];
+ int indir_actions_n = MLX5_MAX_INDIRECT_ACTIONS;
const struct rte_flow_action *actions;
struct rte_flow_action *translated_actions = NULL;
const struct rte_flow_action *actions;
struct rte_flow_action *translated_actions = NULL;
- int ret = flow_shared_actions_translate(dev, original_actions,
- shared_actions,
- &shared_actions_n,
+ int ret = flow_action_handles_translate(dev, original_actions,
+ indir_actions,
+ &indir_actions_n,
&translated_actions, error);
if (ret)
&translated_actions, error);
if (ret)
/* Wrapper for driver action_validate op callback */
static int
flow_drv_action_validate(struct rte_eth_dev *dev,
/* Wrapper for driver action_validate op callback */
static int
flow_drv_action_validate(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
const struct mlx5_flow_driver_ops *fops,
struct rte_flow_error *error)
{
const struct rte_flow_action *action,
const struct mlx5_flow_driver_ops *fops,
struct rte_flow_error *error)
{
- static const char err_msg[] = "shared action validation unsupported";
+ static const char err_msg[] = "indirect action validation unsupported";
if (!fops->action_validate) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
if (!fops->action_validate) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
- * @param[in] action
- * Handle for the shared action to be destroyed.
+ * @param[in] handle
+ * Handle for the indirect action object to be destroyed.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @note: wrapper for driver action_create op callback.
*/
static int
* @note: wrapper for driver action_create op callback.
*/
static int
-mlx5_shared_action_destroy(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *action,
+mlx5_action_handle_destroy(struct rte_eth_dev *dev,
+ struct rte_flow_action_handle *handle,
struct rte_flow_error *error)
{
struct rte_flow_error *error)
{
- static const char err_msg[] = "shared action destruction unsupported";
+ static const char err_msg[] = "indirect action destruction unsupported";
struct rte_flow_attr attr = { .transfer = 0 };
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
struct rte_flow_attr attr = { .transfer = 0 };
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
NULL, err_msg);
return -rte_errno;
}
NULL, err_msg);
return -rte_errno;
}
- return fops->action_destroy(dev, action, error);
+ return fops->action_destroy(dev, handle, error);
}
/* Wrapper for driver action_destroy op callback */
static int
flow_drv_action_update(struct rte_eth_dev *dev,
}
/* Wrapper for driver action_destroy op callback */
static int
flow_drv_action_update(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *action,
- const void *action_conf,
+ struct rte_flow_action_handle *handle,
+ const void *update,
const struct mlx5_flow_driver_ops *fops,
struct rte_flow_error *error)
{
const struct mlx5_flow_driver_ops *fops,
struct rte_flow_error *error)
{
- static const char err_msg[] = "shared action update unsupported";
+ static const char err_msg[] = "indirect action update unsupported";
if (!fops->action_update) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
if (!fops->action_update) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
NULL, err_msg);
return -rte_errno;
}
NULL, err_msg);
return -rte_errno;
}
- return fops->action_update(dev, action, action_conf, error);
+ return fops->action_update(dev, handle, update, error);
}
/* Wrapper for driver action_destroy op callback */
static int
flow_drv_action_query(struct rte_eth_dev *dev,
}
/* Wrapper for driver action_destroy op callback */
static int
flow_drv_action_query(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action *action,
+ const struct rte_flow_action_handle *handle,
void *data,
const struct mlx5_flow_driver_ops *fops,
struct rte_flow_error *error)
{
void *data,
const struct mlx5_flow_driver_ops *fops,
struct rte_flow_error *error)
{
- static const char err_msg[] = "shared action query unsupported";
+ static const char err_msg[] = "indirect action query unsupported";
if (!fops->action_query) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
if (!fops->action_query) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
NULL, err_msg);
return -rte_errno;
}
NULL, err_msg);
return -rte_errno;
}
- return fops->action_query(dev, action, data, error);
+ return fops->action_query(dev, handle, data, error);
- * Create shared action for reuse in multiple flow rules.
+ * Create indirect action for reuse in multiple flow rules.
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
+ * @param conf
+ * Pointer to indirect action object configuration.
- * Action configuration for shared action creation.
+ * Action configuration for indirect action object creation.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @return
* A valid handle in case of success, NULL otherwise and rte_errno is set.
*/
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @return
* A valid handle in case of success, NULL otherwise and rte_errno is set.
*/
-static struct rte_flow_shared_action *
-mlx5_shared_action_create(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+static struct rte_flow_action_handle *
+mlx5_action_handle_create(struct rte_eth_dev *dev,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error)
{
const struct rte_flow_action *action,
struct rte_flow_error *error)
{
- static const char err_msg[] = "shared action creation unsupported";
+ static const char err_msg[] = "indirect action creation unsupported";
struct rte_flow_attr attr = { .transfer = 0 };
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
struct rte_flow_attr attr = { .transfer = 0 };
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
- * Updates inplace the shared action configuration pointed by *action* handle
- * with the configuration provided as *action* argument.
- * The update of the shared action configuration effects all flow rules reusing
- * the action via handle.
+ * Updates inplace the indirect action configuration pointed by *handle*
+ * with the configuration provided as *update* argument.
+ * The update of the indirect action configuration effects all flow rules
+ * reusing the action via handle.
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
- * @param[in] shared_action
- * Handle for the shared action to be updated.
- * @param[in] action
+ * @param[in] handle
+ * Handle for the indirect action to be updated.
+ * @param[in] update
* Action specification used to modify the action pointed by handle.
* Action specification used to modify the action pointed by handle.
- * *action* should be of same type with the action pointed by the *action*
- * handle argument, otherwise considered as invalid.
+ * *update* could be of same type with the action pointed by the *handle*
+ * handle argument, or some other structures like a wrapper, depending on
+ * the indirect action type.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int
-mlx5_shared_action_update(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *shared_action,
- const struct rte_flow_action *action,
+mlx5_action_handle_update(struct rte_eth_dev *dev,
+ struct rte_flow_action_handle *handle,
+ const void *update,
struct rte_flow_error *error)
{
struct rte_flow_attr attr = { .transfer = 0 };
struct rte_flow_error *error)
{
struct rte_flow_attr attr = { .transfer = 0 };
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
int ret;
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
int ret;
- ret = flow_drv_action_validate(dev, NULL, action, fops, error);
+ ret = flow_drv_action_validate(dev, NULL,
+ (const struct rte_flow_action *)update, fops, error);
- return flow_drv_action_update(dev, shared_action, action->conf, fops,
+ return flow_drv_action_update(dev, handle, update, fops,
- * Query the shared action by handle.
+ * Query the indirect action by handle.
*
* This function allows retrieving action-specific data such as counters.
* Data is gathered by special action which may be present/referenced in
* more than one flow rule definition.
*
*
* This function allows retrieving action-specific data such as counters.
* Data is gathered by special action which may be present/referenced in
* more than one flow rule definition.
*
- * \see RTE_FLOW_ACTION_TYPE_COUNT
+ * see @RTE_FLOW_ACTION_TYPE_COUNT
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
- * @param[in] action
- * Handle for the shared action to query.
+ * @param[in] handle
+ * Handle for the indirect action to query.
* @param[in, out] data
* Pointer to storage for the associated query data type.
* @param[out] error
* @param[in, out] data
* Pointer to storage for the associated query data type.
* @param[out] error
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int
-mlx5_shared_action_query(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action *action,
+mlx5_action_handle_query(struct rte_eth_dev *dev,
+ const struct rte_flow_action_handle *handle,
void *data,
struct rte_flow_error *error)
{
void *data,
struct rte_flow_error *error)
{
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
- return flow_drv_action_query(dev, action, data, fops, error);
+ return flow_drv_action_query(dev, handle, data, fops, error);
- * Destroy all shared actions.
+ * Destroy all indirect actions (shared RSS).
*
* @param dev
* Pointer to Ethernet device.
*
* @param dev
* Pointer to Ethernet device.
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
int
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
int
-mlx5_shared_action_flush(struct rte_eth_dev *dev)
+mlx5_action_handle_flush(struct rte_eth_dev *dev)
{
struct rte_flow_error error;
struct mlx5_priv *priv = dev->data->dev_private;
{
struct rte_flow_error error;
struct mlx5_priv *priv = dev->data->dev_private;
ILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
priv->rss_shared_actions, idx, shared_rss, next) {
ILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
priv->rss_shared_actions, idx, shared_rss, next) {
- ret |= mlx5_shared_action_destroy(dev,
- (struct rte_flow_shared_action *)(uintptr_t)idx, &error);
+ ret |= mlx5_action_handle_destroy(dev,
+ (struct rte_flow_action_handle *)(uintptr_t)idx, &error);
MLX5_RTE_FLOW_ACTION_TYPE_AGE,
};
MLX5_RTE_FLOW_ACTION_TYPE_AGE,
};
-#define MLX5_SHARED_ACTION_TYPE_OFFSET 30
+#define MLX5_INDIRECT_ACTION_TYPE_OFFSET 30
- MLX5_SHARED_ACTION_TYPE_RSS,
- MLX5_SHARED_ACTION_TYPE_AGE,
+ MLX5_INDIRECT_ACTION_TYPE_RSS,
+ MLX5_INDIRECT_ACTION_TYPE_AGE,
};
/* Matches on selected register. */
};
/* Matches on selected register. */
rte_spinlock_t action_rss_sl; /**< Shared RSS action spinlock. */
};
rte_spinlock_t action_rss_sl; /**< Shared RSS action spinlock. */
};
-struct rte_flow_shared_action {
+struct rte_flow_action_handle {
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_validate_t)
(struct rte_eth_dev *dev,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_validate_t)
(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error);
const struct rte_flow_action *action,
struct rte_flow_error *error);
-typedef struct rte_flow_shared_action *(*mlx5_flow_action_create_t)
+typedef struct rte_flow_action_handle *(*mlx5_flow_action_create_t)
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_destroy_t)
(struct rte_eth_dev *dev,
const struct rte_flow_action *action,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_destroy_t)
(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *action,
+ struct rte_flow_action_handle *action,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_update_t)
(struct rte_eth_dev *dev,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_update_t)
(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *action,
- const void *action_conf,
+ struct rte_flow_action_handle *action,
+ const void *update,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_query_t)
(struct rte_eth_dev *dev,
struct rte_flow_error *error);
typedef int (*mlx5_flow_action_query_t)
(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action *action,
+ const struct rte_flow_action_handle *action,
void *data,
struct rte_flow_error *error);
typedef int (*mlx5_flow_sync_domain_t)
void *data,
struct rte_flow_error *error);
typedef int (*mlx5_flow_sync_domain_t)
int mlx5_flow_meter_flush(struct rte_eth_dev *dev,
struct rte_mtr_error *error);
int mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev);
int mlx5_flow_meter_flush(struct rte_eth_dev *dev,
struct rte_mtr_error *error);
int mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev);
-int mlx5_shared_action_flush(struct rte_eth_dev *dev);
+int mlx5_action_handle_flush(struct rte_eth_dev *dev);
void mlx5_release_tunnel_hub(struct mlx5_dev_ctx_shared *sh, uint16_t port_id);
int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh);
void mlx5_release_tunnel_hub(struct mlx5_dev_ctx_shared *sh, uint16_t port_id);
int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh);
*/
static uint32_t
__flow_dv_action_rss_create(struct rte_eth_dev *dev,
*/
static uint32_t
__flow_dv_action_rss_create(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action_rss *rss,
struct rte_flow_error *error)
{
const struct rte_flow_action_rss *rss,
struct rte_flow_error *error)
{
"cannot allocate resource memory");
goto error_rss_init;
}
"cannot allocate resource memory");
goto error_rss_init;
}
- if (idx > (1u << MLX5_SHARED_ACTION_TYPE_OFFSET)) {
+ if (idx > (1u << MLX5_INDIRECT_ACTION_TYPE_OFFSET)) {
rte_flow_error_set(error, E2BIG,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"rss action number out of range");
rte_flow_error_set(error, E2BIG,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"rss action number out of range");
- * Create shared action, lock free,
+ * Create indirect action, lock free,
* (mutex should be acquired by caller).
* Dispatcher for action type specific call.
*
* (mutex should be acquired by caller).
* Dispatcher for action type specific call.
*
* @param[in] conf
* Shared action configuration.
* @param[in] action
* @param[in] conf
* Shared action configuration.
* @param[in] action
- * Action specification used to create shared action.
+ * Action specification used to create indirect action.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
* A valid shared action handle in case of success, NULL otherwise and
* rte_errno is set.
*/
* A valid shared action handle in case of success, NULL otherwise and
* rte_errno is set.
*/
-static struct rte_flow_shared_action *
+static struct rte_flow_action_handle *
flow_dv_action_create(struct rte_eth_dev *dev,
flow_dv_action_create(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *err)
{
const struct rte_flow_action *action,
struct rte_flow_error *err)
{
switch (action->type) {
case RTE_FLOW_ACTION_TYPE_RSS:
ret = __flow_dv_action_rss_create(dev, conf, action->conf, err);
switch (action->type) {
case RTE_FLOW_ACTION_TYPE_RSS:
ret = __flow_dv_action_rss_create(dev, conf, action->conf, err);
- idx = (MLX5_SHARED_ACTION_TYPE_RSS <<
- MLX5_SHARED_ACTION_TYPE_OFFSET) | ret;
+ idx = (MLX5_INDIRECT_ACTION_TYPE_RSS <<
+ MLX5_INDIRECT_ACTION_TYPE_OFFSET) | ret;
break;
case RTE_FLOW_ACTION_TYPE_AGE:
ret = flow_dv_translate_create_aso_age(dev, action->conf, err);
break;
case RTE_FLOW_ACTION_TYPE_AGE:
ret = flow_dv_translate_create_aso_age(dev, action->conf, err);
- idx = (MLX5_SHARED_ACTION_TYPE_AGE <<
- MLX5_SHARED_ACTION_TYPE_OFFSET) | ret;
+ idx = (MLX5_INDIRECT_ACTION_TYPE_AGE <<
+ MLX5_INDIRECT_ACTION_TYPE_OFFSET) | ret;
if (ret) {
struct mlx5_aso_age_action *aso_age =
flow_aso_age_get_by_idx(dev, ret);
if (ret) {
struct mlx5_aso_age_action *aso_age =
flow_aso_age_get_by_idx(dev, ret);
NULL, "action type not supported");
break;
}
NULL, "action type not supported");
break;
}
- return ret ? (struct rte_flow_shared_action *)(uintptr_t)idx : NULL;
+ return ret ? (struct rte_flow_action_handle *)(uintptr_t)idx : NULL;
- * Destroy the shared action.
+ * Destroy the indirect action.
* Release action related resources on the NIC and the memory.
* Lock free, (mutex should be acquired by caller).
* Dispatcher for action type specific call.
*
* @param[in] dev
* Pointer to the Ethernet device structure.
* Release action related resources on the NIC and the memory.
* Lock free, (mutex should be acquired by caller).
* Dispatcher for action type specific call.
*
* @param[in] dev
* Pointer to the Ethernet device structure.
- * @param[in] action
- * The shared action object to be removed.
+ * @param[in] handle
+ * The indirect action object handle to be removed.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
*/
static int
flow_dv_action_destroy(struct rte_eth_dev *dev,
*/
static int
flow_dv_action_destroy(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *action,
+ struct rte_flow_action_handle *handle,
struct rte_flow_error *error)
{
struct rte_flow_error *error)
{
- uint32_t act_idx = (uint32_t)(uintptr_t)action;
- uint32_t type = act_idx >> MLX5_SHARED_ACTION_TYPE_OFFSET;
- uint32_t idx = act_idx & ((1u << MLX5_SHARED_ACTION_TYPE_OFFSET) - 1);
+ uint32_t act_idx = (uint32_t)(uintptr_t)handle;
+ uint32_t type = act_idx >> MLX5_INDIRECT_ACTION_TYPE_OFFSET;
+ uint32_t idx = act_idx & ((1u << MLX5_INDIRECT_ACTION_TYPE_OFFSET) - 1);
- case MLX5_SHARED_ACTION_TYPE_RSS:
+ case MLX5_INDIRECT_ACTION_TYPE_RSS:
return __flow_dv_action_rss_release(dev, idx, error);
return __flow_dv_action_rss_release(dev, idx, error);
- case MLX5_SHARED_ACTION_TYPE_AGE:
+ case MLX5_INDIRECT_ACTION_TYPE_AGE:
ret = flow_dv_aso_age_release(dev, idx);
if (ret)
/*
* In this case, the last flow has a reference will
* actually release the age action.
*/
ret = flow_dv_aso_age_release(dev, idx);
if (ret)
/*
* In this case, the last flow has a reference will
* actually release the age action.
*/
- DRV_LOG(DEBUG, "Shared age action %" PRIu32 " was"
+ DRV_LOG(DEBUG, "Indirect age action %" PRIu32 " was"
" released with references %d.", idx, ret);
return 0;
default:
" released with references %d.", idx, ret);
return 0;
default:
*
* @param[in] dev
* Pointer to the Ethernet device structure.
*
* @param[in] dev
* Pointer to the Ethernet device structure.
- * @param[in] action
- * The shared action object to be updated.
- * @param[in] action_conf
- * Action specification used to modify *action*.
- * *action_conf* should be of type correlating with type of the *action*,
- * otherwise considered as invalid.
+ * @param[in] handle
+ * The indirect action object handle to be updated.
+ * @param[in] update
+ * Action specification used to modify the action pointed by *handle*.
+ * *update* could be of same type with the action pointed by the *handle*
+ * handle argument, or some other structures like a wrapper, depending on
+ * the indirect action type.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
*/
static int
flow_dv_action_update(struct rte_eth_dev *dev,
*/
static int
flow_dv_action_update(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *action,
- const void *action_conf,
+ struct rte_flow_action_handle *handle,
+ const void *update,
struct rte_flow_error *err)
{
struct rte_flow_error *err)
{
- uint32_t act_idx = (uint32_t)(uintptr_t)action;
- uint32_t type = act_idx >> MLX5_SHARED_ACTION_TYPE_OFFSET;
- uint32_t idx = act_idx & ((1u << MLX5_SHARED_ACTION_TYPE_OFFSET) - 1);
+ uint32_t act_idx = (uint32_t)(uintptr_t)handle;
+ uint32_t type = act_idx >> MLX5_INDIRECT_ACTION_TYPE_OFFSET;
+ uint32_t idx = act_idx & ((1u << MLX5_INDIRECT_ACTION_TYPE_OFFSET) - 1);
+ const void *action_conf;
- case MLX5_SHARED_ACTION_TYPE_RSS:
+ case MLX5_INDIRECT_ACTION_TYPE_RSS:
+ action_conf = ((const struct rte_flow_action *)update)->conf;
return __flow_dv_action_rss_update(dev, idx, action_conf, err);
default:
return rte_flow_error_set(err, ENOTSUP,
return __flow_dv_action_rss_update(dev, idx, action_conf, err);
default:
return rte_flow_error_set(err, ENOTSUP,
static int
flow_dv_action_query(struct rte_eth_dev *dev,
static int
flow_dv_action_query(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action *action, void *data,
+ const struct rte_flow_action_handle *handle, void *data,
struct rte_flow_error *error)
{
struct mlx5_age_param *age_param;
struct rte_flow_query_age *resp;
struct rte_flow_error *error)
{
struct mlx5_age_param *age_param;
struct rte_flow_query_age *resp;
- uint32_t act_idx = (uint32_t)(uintptr_t)action;
- uint32_t type = act_idx >> MLX5_SHARED_ACTION_TYPE_OFFSET;
- uint32_t idx = act_idx & ((1u << MLX5_SHARED_ACTION_TYPE_OFFSET) - 1);
+ uint32_t act_idx = (uint32_t)(uintptr_t)handle;
+ uint32_t type = act_idx >> MLX5_INDIRECT_ACTION_TYPE_OFFSET;
+ uint32_t idx = act_idx & ((1u << MLX5_INDIRECT_ACTION_TYPE_OFFSET) - 1);
- case MLX5_SHARED_ACTION_TYPE_AGE:
+ case MLX5_INDIRECT_ACTION_TYPE_AGE:
age_param = &flow_aso_age_get_by_idx(dev, idx)->age_params;
resp = data;
resp->aged = __atomic_load_n(&age_param->state,
age_param = &flow_aso_age_get_by_idx(dev, idx)->age_params;
resp = data;
resp->aged = __atomic_load_n(&age_param->state,
- * Validate shared action.
+ * Validate indirect action.
* Dispatcher for action type specific validation.
*
* @param[in] dev
* Dispatcher for action type specific validation.
*
* @param[in] dev
* @param[in] conf
* Shared action configuration.
* @param[in] action
* @param[in] conf
* Shared action configuration.
* @param[in] action
- * The shared action object to validate.
+ * The indirect action object to validate.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
* @param[out] error
* Perform verbose error reporting if not NULL. Initialized in case of
* error only.
*/
static int
flow_dv_action_validate(struct rte_eth_dev *dev,
*/
static int
flow_dv_action_validate(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *err)
{
const struct rte_flow_action *action,
struct rte_flow_error *err)
{
MK_FLOW_ACTION(MODIFY_FIELD,
sizeof(struct rte_flow_action_modify_field)),
/**
MK_FLOW_ACTION(MODIFY_FIELD,
sizeof(struct rte_flow_action_modify_field)),
/**
- * Shared action represented as handle of type
- * (struct rte_flow_shared action *) stored in conf field (see
+ * Indirect action represented as handle of type
+ * (struct rte_flow_action_handle *) stored in conf field (see
* struct rte_flow_action); no need for additional structure to * store
* struct rte_flow_action); no need for additional structure to * store
- * shared action handle.
+ * indirect action handle.
- MK_FLOW_ACTION(SHARED, 0),
+ MK_FLOW_ACTION(INDIRECT, 0),
NULL, rte_strerror(ENOTSUP));
}
NULL, rte_strerror(ENOTSUP));
}
-struct rte_flow_shared_action *
-rte_flow_shared_action_create(uint16_t port_id,
- const struct rte_flow_shared_action_conf *conf,
+struct rte_flow_action_handle *
+rte_flow_action_handle_create(uint16_t port_id,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error)
{
const struct rte_flow_action *action,
struct rte_flow_error *error)
{
- struct rte_flow_shared_action *shared_action;
+ struct rte_flow_action_handle *handle;
const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
if (unlikely(!ops))
return NULL;
const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
if (unlikely(!ops))
return NULL;
- if (unlikely(!ops->shared_action_create)) {
+ if (unlikely(!ops->action_handle_create)) {
rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
rte_strerror(ENOSYS));
return NULL;
}
rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
rte_strerror(ENOSYS));
return NULL;
}
- shared_action = ops->shared_action_create(&rte_eth_devices[port_id],
- conf, action, error);
- if (shared_action == NULL)
+ handle = ops->action_handle_create(&rte_eth_devices[port_id],
+ conf, action, error);
+ if (handle == NULL)
flow_err(port_id, -rte_errno, error);
flow_err(port_id, -rte_errno, error);
-rte_flow_shared_action_destroy(uint16_t port_id,
- struct rte_flow_shared_action *action,
- struct rte_flow_error *error)
+rte_flow_action_handle_destroy(uint16_t port_id,
+ struct rte_flow_action_handle *handle,
+ struct rte_flow_error *error)
{
int ret;
const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
if (unlikely(!ops))
return -rte_errno;
{
int ret;
const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
if (unlikely(!ops))
return -rte_errno;
- if (unlikely(!ops->shared_action_destroy))
+ if (unlikely(!ops->action_handle_destroy))
return rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, rte_strerror(ENOSYS));
return rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, rte_strerror(ENOSYS));
- ret = ops->shared_action_destroy(&rte_eth_devices[port_id], action,
- error);
+ ret = ops->action_handle_destroy(&rte_eth_devices[port_id],
+ handle, error);
return flow_err(port_id, ret, error);
}
int
return flow_err(port_id, ret, error);
}
int
-rte_flow_shared_action_update(uint16_t port_id,
- struct rte_flow_shared_action *action,
- const struct rte_flow_action *update,
+rte_flow_action_handle_update(uint16_t port_id,
+ struct rte_flow_action_handle *handle,
+ const void *update,
struct rte_flow_error *error)
{
int ret;
struct rte_flow_error *error)
{
int ret;
if (unlikely(!ops))
return -rte_errno;
if (unlikely(!ops))
return -rte_errno;
- if (unlikely(!ops->shared_action_update))
+ if (unlikely(!ops->action_handle_update))
return rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, rte_strerror(ENOSYS));
return rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, rte_strerror(ENOSYS));
- ret = ops->shared_action_update(&rte_eth_devices[port_id], action,
+ ret = ops->action_handle_update(&rte_eth_devices[port_id], handle,
update, error);
return flow_err(port_id, ret, error);
}
int
update, error);
return flow_err(port_id, ret, error);
}
int
-rte_flow_shared_action_query(uint16_t port_id,
- const struct rte_flow_shared_action *action,
+rte_flow_action_handle_query(uint16_t port_id,
+ const struct rte_flow_action_handle *handle,
void *data,
struct rte_flow_error *error)
{
void *data,
struct rte_flow_error *error)
{
if (unlikely(!ops))
return -rte_errno;
if (unlikely(!ops))
return -rte_errno;
- if (unlikely(!ops->shared_action_query))
+ if (unlikely(!ops->action_handle_query))
return rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, rte_strerror(ENOSYS));
return rte_flow_error_set(error, ENOSYS,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, rte_strerror(ENOSYS));
- ret = ops->shared_action_query(&rte_eth_devices[port_id], action,
+ ret = ops->action_handle_query(&rte_eth_devices[port_id], handle,
data, error);
return flow_err(port_id, ret, error);
}
data, error);
return flow_err(port_id, ret, error);
}
* Enables counters for this flow rule.
*
* These counters can be retrieved and reset through rte_flow_query() or
* Enables counters for this flow rule.
*
* These counters can be retrieved and reset through rte_flow_query() or
- * rte_flow_shared_action_query() if the action provided via handle,
+ * rte_flow_action_handle_query() if the action provided via handle,
* see struct rte_flow_query_count.
*
* See struct rte_flow_action_count.
* see struct rte_flow_query_count.
*
* See struct rte_flow_action_count.
RTE_FLOW_ACTION_TYPE_SAMPLE,
/**
RTE_FLOW_ACTION_TYPE_SAMPLE,
/**
+ * @deprecated
+ * @see RTE_FLOW_ACTION_TYPE_INDIRECT
+ *
* Describe action shared across multiple flow rules.
*
* Allow multiple rules reference the same action by handle (see
* Describe action shared across multiple flow rules.
*
* Allow multiple rules reference the same action by handle (see
* See struct rte_flow_action_modify_field.
*/
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
* See struct rte_flow_action_modify_field.
*/
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
+
+ /**
+ * An action handle is referenced in a rule through an indirect action.
+ *
+ * The same action handle may be used in multiple rules for the same
+ * or different ethdev ports.
+ */
+ RTE_FLOW_ACTION_TYPE_INDIRECT,
* ``struct rte_flow_query_count``.
*
* @deprecated Shared attribute is deprecated, use generic
* ``struct rte_flow_query_count``.
*
* @deprecated Shared attribute is deprecated, use generic
- * RTE_FLOW_ACTION_TYPE_SHARED action.
+ * RTE_FLOW_ACTION_TYPE_INDIRECT action.
*
* The shared flag indicates whether the counter is unique to the flow rule the
* action is specified with, or whether it is a shared counter.
*
* The shared flag indicates whether the counter is unique to the flow rule the
* action is specified with, or whether it is a shared counter.
- * RTE_FLOW_ACTION_TYPE_SHARED
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_INDIRECT
- * Opaque type returned after successfully creating a shared action.
+ * Opaque type returned after successfully creating an indirect action object.
+ * The definition of the object handle is different per driver or
+ * per direct action type.
- * This handle can be used to manage and query the related action:
- * - share it across multiple flow rules
- * - update action configuration
- * - query action data
- * - destroy action
+ * This handle can be used to manage and query the related direct action:
+ * - referenced in single flow rule or across multiple flow rules
+ * over multiple ports
+ * - update action object configuration
+ * - query action object data
+ * - destroy action object
-struct rte_flow_shared_action;
+struct rte_flow_action_handle;
/**
* Field IDs for MODIFY_FIELD action.
/**
* Field IDs for MODIFY_FIELD action.
uint32_t nb_contexts, struct rte_flow_error *error);
/**
uint32_t nb_contexts, struct rte_flow_error *error);
/**
- * Specify shared action configuration
+ * Specify indirect action object configuration
-struct rte_flow_shared_action_conf {
+struct rte_flow_indir_action_conf {
- * Flow direction for shared action configuration.
+ * Flow direction for the indirect action configuration.
- * Shared action should be valid at least for one flow direction,
+ * Action should be valid at least for one flow direction,
* otherwise it is invalid for both ingress and egress rules.
*/
uint32_t ingress:1;
/**< Action valid for rules applied to ingress traffic. */
uint32_t egress:1;
/**< Action valid for rules applied to egress traffic. */
* otherwise it is invalid for both ingress and egress rules.
*/
uint32_t ingress:1;
/**< Action valid for rules applied to ingress traffic. */
uint32_t egress:1;
/**< Action valid for rules applied to egress traffic. */
/**
* When set to 1, indicates that the action is valid for
* transfer traffic; otherwise, for non-transfer traffic.
/**
* When set to 1, indicates that the action is valid for
* transfer traffic; otherwise, for non-transfer traffic.
- *
- * See struct rte_flow_attr.
*/
uint32_t transfer:1;
};
*/
uint32_t transfer:1;
};
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
- * Create shared action for reuse in multiple flow rules.
- * The created shared action has single state and configuration
- * across all flow rules using it.
+ * Create an indirect action object that can be used in flow rules
+ * via its handle.
+ * The created object handle has single state and configuration
+ * across all the flow rules using it.
*
* @param[in] port_id
* The port identifier of the Ethernet device.
* @param[in] conf
*
* @param[in] port_id
* The port identifier of the Ethernet device.
* @param[in] conf
- * Shared action configuration.
+ * Action configuration for the indirect action object creation.
- * Action configuration for shared action creation.
+ * Specific configuration of the indirect action object.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* - (ENOTSUP) if *action* valid but unsupported.
*/
__rte_experimental
* - (ENOTSUP) if *action* valid but unsupported.
*/
__rte_experimental
-struct rte_flow_shared_action *
-rte_flow_shared_action_create(uint16_t port_id,
- const struct rte_flow_shared_action_conf *conf,
+struct rte_flow_action_handle *
+rte_flow_action_handle_create(uint16_t port_id,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error);
const struct rte_flow_action *action,
struct rte_flow_error *error);
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
- * Destroy the shared action by handle.
+ * Destroy indirect action by handle.
*
* @param[in] port_id
* The port identifier of the Ethernet device.
*
* @param[in] port_id
* The port identifier of the Ethernet device.
- * @param[in] action
- * Handle for the shared action to be destroyed.
+ * @param[in] handle
+ * Handle for the indirect action object to be destroyed.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
*/
__rte_experimental
int
*/
__rte_experimental
int
-rte_flow_shared_action_destroy(uint16_t port_id,
- struct rte_flow_shared_action *action,
+rte_flow_action_handle_destroy(uint16_t port_id,
+ struct rte_flow_action_handle *handle,
struct rte_flow_error *error);
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
struct rte_flow_error *error);
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
- * Update in-place the shared action configuration pointed by *action* handle
- * with the configuration provided as *update* argument.
- * The update of the shared action configuration effects all flow rules reusing
- * the action via handle.
+ * Update in-place the action configuration and / or state pointed
+ * by action *handle* with the configuration provided as *update* argument.
+ * The update of the action configuration effects all flow rules reusing
+ * the action via *handle*.
+ * The update general pointer provides the ability of partial updating.
*
* @param[in] port_id
* The port identifier of the Ethernet device.
*
* @param[in] port_id
* The port identifier of the Ethernet device.
- * @param[in] action
- * Handle for the shared action to be updated.
+ * @param[in] handle
+ * Handle for the indirect action object to be updated.
- * Action specification used to modify the action pointed by handle.
- * *update* should be of same type with the action pointed by the *action*
- * handle argument, otherwise considered as invalid.
+ * Update profile specification used to modify the action pointed by handle.
+ * *update* could be with the same type of the immediate action corresponding
+ * to the *handle* argument when creating, or a wrapper structure includes
+ * action configuration to be updated and bit fields to indicate the member
+ * of fields inside the action to update.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* @param[out] error
* Perform verbose error reporting if not NULL. PMDs initialize this
* structure in case of error only.
* - (-EIO) if underlying device is removed.
* - (-EINVAL) if *update* invalid.
* - (-ENOTSUP) if *update* valid but unsupported.
* - (-EIO) if underlying device is removed.
* - (-EINVAL) if *update* invalid.
* - (-ENOTSUP) if *update* valid but unsupported.
- * - (-ENOENT) if action pointed by *ctx* was not found.
+ * - (-ENOENT) if indirect action object pointed by *handle* was not found.
* rte_errno is also set.
*/
__rte_experimental
int
* rte_errno is also set.
*/
__rte_experimental
int
-rte_flow_shared_action_update(uint16_t port_id,
- struct rte_flow_shared_action *action,
- const struct rte_flow_action *update,
+rte_flow_action_handle_update(uint16_t port_id,
+ struct rte_flow_action_handle *handle,
+ const void *update,
struct rte_flow_error *error);
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
struct rte_flow_error *error);
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
- * Query the shared action by handle.
+ * Query the direct action by corresponding indirect action object handle.
*
* Retrieve action-specific data such as counters.
* Data is gathered by special action which may be present/referenced in
* more than one flow rule definition.
*
*
* Retrieve action-specific data such as counters.
* Data is gathered by special action which may be present/referenced in
* more than one flow rule definition.
*
- * \see RTE_FLOW_ACTION_TYPE_COUNT
+ * @see RTE_FLOW_ACTION_TYPE_COUNT
*
* @param port_id
* Port identifier of Ethernet device.
*
* @param port_id
* Port identifier of Ethernet device.
- * @param[in] action
- * Handle for the shared action to query.
+ * @param[in] handle
+ * Handle for the action object to query.
* @param[in, out] data
* Pointer to storage for the associated query data type.
* @param[out] error
* @param[in, out] data
* Pointer to storage for the associated query data type.
* @param[out] error
*/
__rte_experimental
int
*/
__rte_experimental
int
-rte_flow_shared_action_query(uint16_t port_id,
- const struct rte_flow_shared_action *action,
- void *data,
- struct rte_flow_error *error);
+rte_flow_action_handle_query(uint16_t port_id,
+ const struct rte_flow_action_handle *handle,
+ void *data, struct rte_flow_error *error);
/* Tunnel has a type and the key information. */
struct rte_flow_tunnel {
/* Tunnel has a type and the key information. */
struct rte_flow_tunnel {
void **context,
uint32_t nb_contexts,
struct rte_flow_error *err);
void **context,
uint32_t nb_contexts,
struct rte_flow_error *err);
- /** See rte_flow_shared_action_create() */
- struct rte_flow_shared_action *(*shared_action_create)
+ /** See rte_flow_action_handle_create() */
+ struct rte_flow_action_handle *(*action_handle_create)
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action_conf *conf,
+ const struct rte_flow_indir_action_conf *conf,
const struct rte_flow_action *action,
struct rte_flow_error *error);
const struct rte_flow_action *action,
struct rte_flow_error *error);
- /** See rte_flow_shared_action_destroy() */
- int (*shared_action_destroy)
+ /** See rte_flow_action_handle_destroy() */
+ int (*action_handle_destroy)
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *shared_action,
+ struct rte_flow_action_handle *handle,
struct rte_flow_error *error);
struct rte_flow_error *error);
- /** See rte_flow_shared_action_update() */
- int (*shared_action_update)
+ /** See rte_flow_action_handle_update() */
+ int (*action_handle_update)
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- struct rte_flow_shared_action *shared_action,
- const struct rte_flow_action *update,
+ struct rte_flow_action_handle *handle,
+ const void *update,
struct rte_flow_error *error);
struct rte_flow_error *error);
- /** See rte_flow_shared_action_query() */
- int (*shared_action_query)
+ /** See rte_flow_action_handle_query() */
+ int (*action_handle_query)
(struct rte_eth_dev *dev,
(struct rte_eth_dev *dev,
- const struct rte_flow_shared_action *shared_action,
+ const struct rte_flow_action_handle *handle,
void *data,
struct rte_flow_error *error);
/** See rte_flow_tunnel_decap_set() */
void *data,
struct rte_flow_error *error);
/** See rte_flow_tunnel_decap_set() */
rte_eth_fec_get_capability;
rte_eth_fec_get;
rte_eth_fec_set;
rte_eth_fec_get_capability;
rte_eth_fec_get;
rte_eth_fec_set;
- rte_flow_shared_action_create;
- rte_flow_shared_action_destroy;
- rte_flow_shared_action_query;
- rte_flow_shared_action_update;
rte_flow_tunnel_decap_set;
rte_flow_tunnel_match;
rte_flow_get_restore_info;
rte_flow_tunnel_decap_set;
rte_flow_tunnel_match;
rte_flow_get_restore_info;
# added in 21.05
rte_eth_representor_info_get;
# added in 21.05
rte_eth_representor_info_get;
+ rte_flow_action_handle_create;
+ rte_flow_action_handle_destroy;
+ rte_flow_action_handle_update;
+ rte_flow_action_handle_query;