* [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action
@ 2019-08-15 9:26 Dekel Peled
2019-09-04 14:10 ` Slava Ovsiienko
2019-09-05 10:28 ` Raslan Darawsheh
0 siblings, 2 replies; 3+ messages in thread
From: Dekel Peled @ 2019-08-15 9:26 UTC (permalink / raw)
To: yskoh, viacheslavo, shahafs; +Cc: orika, dev, stable
This patch updates the validation function of jump action.
It adds check of conflicting fate actions in flow rule.
It also removes check of action->type which is not needed.
Fixes: 684b9a1b1f5c ("net/mlx5: support jump action")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 21faa98..374dbae 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1951,7 +1951,9 @@ struct field_modify_info modify_tcp[] = {
* Validate jump action.
*
* @param[in] action
- * Pointer to the modify action.
+ * Pointer to the jump action.
+ * @param[in] action_flags
+ * Holds the actions detected until now.
* @param[in] group
* The group of the current flow.
* @param[out] error
@@ -1962,10 +1964,17 @@ struct field_modify_info modify_tcp[] = {
*/
static int
flow_dv_validate_action_jump(const struct rte_flow_action *action,
+ uint64_t action_flags,
uint32_t group,
struct rte_flow_error *error)
{
- if (action->type != RTE_FLOW_ACTION_TYPE_JUMP && !action->conf)
+ if (action_flags & (MLX5_FLOW_FATE_ACTIONS |
+ MLX5_FLOW_FATE_ESWITCH_ACTIONS))
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+ "can't have 2 fate actions in"
+ " same flow");
+ if (!action->conf)
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF,
NULL, "action configuration not set");
@@ -3220,6 +3229,7 @@ struct field_modify_info modify_tcp[] = {
break;
case RTE_FLOW_ACTION_TYPE_JUMP:
ret = flow_dv_validate_action_jump(actions,
+ action_flags,
attr->group, error);
if (ret)
return ret;
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action
2019-08-15 9:26 [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action Dekel Peled
@ 2019-09-04 14:10 ` Slava Ovsiienko
2019-09-05 10:28 ` Raslan Darawsheh
1 sibling, 0 replies; 3+ messages in thread
From: Slava Ovsiienko @ 2019-09-04 14:10 UTC (permalink / raw)
To: Dekel Peled, Raslan Darawsheh; +Cc: Ori Kam, dev, stable
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Thursday, August 15, 2019 12:27
> To: Yongseok Koh <yskoh@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix validation of jump action
>
> This patch updates the validation function of jump action.
> It adds check of conflicting fate actions in flow rule.
> It also removes check of action->type which is not needed.
>
> Fixes: 684b9a1b1f5c ("net/mlx5: support jump action")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
> drivers/net/mlx5/mlx5_flow_dv.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 21faa98..374dbae 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1951,7 +1951,9 @@ struct field_modify_info modify_tcp[] = {
> * Validate jump action.
> *
> * @param[in] action
> - * Pointer to the modify action.
> + * Pointer to the jump action.
> + * @param[in] action_flags
> + * Holds the actions detected until now.
> * @param[in] group
> * The group of the current flow.
> * @param[out] error
> @@ -1962,10 +1964,17 @@ struct field_modify_info modify_tcp[] = {
> */
> static int
> flow_dv_validate_action_jump(const struct rte_flow_action *action,
> + uint64_t action_flags,
> uint32_t group,
> struct rte_flow_error *error)
> {
> - if (action->type != RTE_FLOW_ACTION_TYPE_JUMP && !action-
> >conf)
> + if (action_flags & (MLX5_FLOW_FATE_ACTIONS |
> + MLX5_FLOW_FATE_ESWITCH_ACTIONS))
> + return rte_flow_error_set(error, EINVAL,
> + RTE_FLOW_ERROR_TYPE_ACTION,
> NULL,
> + "can't have 2 fate actions in"
> + " same flow");
> + if (!action->conf)
> return rte_flow_error_set(error, EINVAL,
>
> RTE_FLOW_ERROR_TYPE_ACTION_CONF,
> NULL, "action configuration not
> set"); @@ -3220,6 +3229,7 @@ struct field_modify_info modify_tcp[] = {
> break;
> case RTE_FLOW_ACTION_TYPE_JUMP:
> ret = flow_dv_validate_action_jump(actions,
> + action_flags,
> attr->group, error);
> if (ret)
> return ret;
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action
2019-08-15 9:26 [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action Dekel Peled
2019-09-04 14:10 ` Slava Ovsiienko
@ 2019-09-05 10:28 ` Raslan Darawsheh
1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2019-09-05 10:28 UTC (permalink / raw)
To: Dekel Peled, Yongseok Koh, Slava Ovsiienko, Shahaf Shuler
Cc: Ori Kam, dev, stable
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Thursday, August 15, 2019 12:27 PM
> To: Yongseok Koh <yskoh@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action
>
> This patch updates the validation function of jump action.
> It adds check of conflicting fate actions in flow rule.
> It also removes check of action->type which is not needed.
>
> Fixes: 684b9a1b1f5c ("net/mlx5: support jump action")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-05 10:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 9:26 [dpdk-dev] [PATCH] net/mlx5: fix validation of jump action Dekel Peled
2019-09-04 14:10 ` Slava Ovsiienko
2019-09-05 10:28 ` Raslan Darawsheh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).