* [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags
@ 2019-04-22 12:21 Ori Kam
2019-04-22 12:21 ` Ori Kam
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 12:21 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the encapsulation action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..ffc6ab7 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags = dev_flow->flow->group ? 0 : 1;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags
2019-04-22 12:21 [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags Ori Kam
@ 2019-04-22 12:21 ` Ori Kam
2019-04-22 12:34 ` [dpdk-dev] [PATCH v2] net/mlx5: fix modification " Ori Kam
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 12:21 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the encapsulation action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..ffc6ab7 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags = dev_flow->flow->group ? 0 : 1;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
2019-04-22 12:21 [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags Ori Kam
2019-04-22 12:21 ` Ori Kam
@ 2019-04-22 12:34 ` Ori Kam
2019-04-22 12:34 ` Ori Kam
2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 18:01 ` [dpdk-dev] [PATCH v3] " Ori Kam
2019-04-22 18:06 ` Ori Kam
3 siblings, 2 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 12:34 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
v2:
* Change title of commit.
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..ffc6ab7 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags = dev_flow->flow->group ? 0 : 1;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
2019-04-22 12:34 ` [dpdk-dev] [PATCH v2] net/mlx5: fix modification " Ori Kam
@ 2019-04-22 12:34 ` Ori Kam
2019-04-22 13:18 ` Shahaf Shuler
1 sibling, 0 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 12:34 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
v2:
* Change title of commit.
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..ffc6ab7 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags = dev_flow->flow->group ? 0 : 1;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
2019-04-22 12:34 ` [dpdk-dev] [PATCH v2] net/mlx5: fix modification " Ori Kam
2019-04-22 12:34 ` Ori Kam
@ 2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 13:46 ` Ori Kam
1 sibling, 2 replies; 12+ messages in thread
From: Shahaf Shuler @ 2019-04-22 13:18 UTC (permalink / raw)
To: Ori Kam, Yongseok Koh; +Cc: dev, Ori Kam
Monday, April 22, 2019 3:34 PM, Ori Kam:
> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
>
> When creating the modify action using Direct Rules, we need to add flags to
> mark, if the action will be done on root table or on private table.
>
> Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
>
> Signed-off-by: Ori Kam <orika@mellanox.com>
> ---
> v2:
> * Change title of commit.
> ---
> drivers/net/mlx5/mlx5_flow.h | 1 +
> drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
> index c419e6b..b665420 100644
> --- a/drivers/net/mlx5/mlx5_flow.h
> +++ b/drivers/net/mlx5/mlx5_flow.h
> @@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
> uint32_t actions_num; /**< Number of modification actions. */
> struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
> /**< Modification actions. */
> + uint64_t flags; /**< Flags for RDMA API. */
Flags are for RDMA API or Direct rule API?
> };
>
> /* Jump action resource structure. */
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 2f777ec..ffc6ab7 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
> ns = sh->tx_ns;
> else
> ns = sh->rx_ns;
> + resource->flags = dev_flow->flow->group ? 0 : 1;
Use flag macro rather then fixed value. Something like MLX5_DV_MODIFY_FLAGS_INNER_TABLE ?
> /* Lookup a matching resource from cache. */
> LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
> if (resource->ft_type == cache_resource->ft_type &&
> resource->actions_num == cache_resource->actions_num
> &&
> + resource->flags == cache_resource->flags &&
> !memcmp((const void *)resource->actions,
> (const void *)cache_resource->actions,
> (resource->actions_num *
> @@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
> cache_resource->verbs_action =
> mlx5_glue->dv_create_flow_action_modify_header
> (sh->ctx, cache_resource->ft_type,
> - ns, 0,
> + ns, cache_resource->flags,
> cache_resource->actions_num *
> sizeof(cache_resource->actions[0]),
> (uint64_t *)cache_resource-
> >actions);
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
2019-04-22 13:18 ` Shahaf Shuler
@ 2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 13:46 ` Ori Kam
1 sibling, 0 replies; 12+ messages in thread
From: Shahaf Shuler @ 2019-04-22 13:18 UTC (permalink / raw)
To: Ori Kam, Yongseok Koh; +Cc: dev, Ori Kam
Monday, April 22, 2019 3:34 PM, Ori Kam:
> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
>
> When creating the modify action using Direct Rules, we need to add flags to
> mark, if the action will be done on root table or on private table.
>
> Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
>
> Signed-off-by: Ori Kam <orika@mellanox.com>
> ---
> v2:
> * Change title of commit.
> ---
> drivers/net/mlx5/mlx5_flow.h | 1 +
> drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
> index c419e6b..b665420 100644
> --- a/drivers/net/mlx5/mlx5_flow.h
> +++ b/drivers/net/mlx5/mlx5_flow.h
> @@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
> uint32_t actions_num; /**< Number of modification actions. */
> struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
> /**< Modification actions. */
> + uint64_t flags; /**< Flags for RDMA API. */
Flags are for RDMA API or Direct rule API?
> };
>
> /* Jump action resource structure. */
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 2f777ec..ffc6ab7 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
> ns = sh->tx_ns;
> else
> ns = sh->rx_ns;
> + resource->flags = dev_flow->flow->group ? 0 : 1;
Use flag macro rather then fixed value. Something like MLX5_DV_MODIFY_FLAGS_INNER_TABLE ?
> /* Lookup a matching resource from cache. */
> LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
> if (resource->ft_type == cache_resource->ft_type &&
> resource->actions_num == cache_resource->actions_num
> &&
> + resource->flags == cache_resource->flags &&
> !memcmp((const void *)resource->actions,
> (const void *)cache_resource->actions,
> (resource->actions_num *
> @@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
> cache_resource->verbs_action =
> mlx5_glue->dv_create_flow_action_modify_header
> (sh->ctx, cache_resource->ft_type,
> - ns, 0,
> + ns, cache_resource->flags,
> cache_resource->actions_num *
> sizeof(cache_resource->actions[0]),
> (uint64_t *)cache_resource-
> >actions);
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 13:18 ` Shahaf Shuler
@ 2019-04-22 13:46 ` Ori Kam
2019-04-22 13:46 ` Ori Kam
1 sibling, 1 reply; 12+ messages in thread
From: Ori Kam @ 2019-04-22 13:46 UTC (permalink / raw)
To: Shahaf Shuler, Yongseok Koh; +Cc: dev
Hi Shahaf,
PSB
Thanks,
Ori
> -----Original Message-----
> From: Shahaf Shuler
> Sent: Monday, April 22, 2019 4:18 PM
> To: Ori Kam <orika@mellanox.com>; Yongseok Koh <yskoh@mellanox.com>
> Cc: dev@dpdk.org; Ori Kam <orika@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
>
> Monday, April 22, 2019 3:34 PM, Ori Kam:
> > Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
> >
> > When creating the modify action using Direct Rules, we need to add flags to
> > mark, if the action will be done on root table or on private table.
> >
> > Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
> >
> > Signed-off-by: Ori Kam <orika@mellanox.com>
> > ---
> > v2:
> > * Change title of commit.
> > ---
> > drivers/net/mlx5/mlx5_flow.h | 1 +
> > drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
> > 2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
> > index c419e6b..b665420 100644
> > --- a/drivers/net/mlx5/mlx5_flow.h
> > +++ b/drivers/net/mlx5/mlx5_flow.h
> > @@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
> > uint32_t actions_num; /**< Number of modification actions. */
> > struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
> > /**< Modification actions. */
> > + uint64_t flags; /**< Flags for RDMA API. */
>
> Flags are for RDMA API or Direct rule API?
>
Direct rules but they are located in RDMA,
The encap structure as the same comment exactly.
> > };
> >
> > /* Jump action resource structure. */
> > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> > b/drivers/net/mlx5/mlx5_flow_dv.c index 2f777ec..ffc6ab7 100644
> > --- a/drivers/net/mlx5/mlx5_flow_dv.c
> > +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> > @@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
> > ns = sh->tx_ns;
> > else
> > ns = sh->rx_ns;
> > + resource->flags = dev_flow->flow->group ? 0 : 1;
>
> Use flag macro rather then fixed value. Something like
> MLX5_DV_MODIFY_FLAGS_INNER_TABLE ?
>
> > /* Lookup a matching resource from cache. */
> > LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
> > if (resource->ft_type == cache_resource->ft_type &&
> > resource->actions_num == cache_resource->actions_num
> > &&
> > + resource->flags == cache_resource->flags &&
> > !memcmp((const void *)resource->actions,
> > (const void *)cache_resource->actions,
> > (resource->actions_num *
> > @@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
> > cache_resource->verbs_action =
> > mlx5_glue->dv_create_flow_action_modify_header
> > (sh->ctx, cache_resource->ft_type,
> > - ns, 0,
> > + ns, cache_resource->flags,
> > cache_resource->actions_num *
> > sizeof(cache_resource->actions[0]),
> > (uint64_t *)cache_resource-
> > >actions);
> > --
> > 1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
2019-04-22 13:46 ` Ori Kam
@ 2019-04-22 13:46 ` Ori Kam
0 siblings, 0 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 13:46 UTC (permalink / raw)
To: Shahaf Shuler, Yongseok Koh; +Cc: dev
Hi Shahaf,
PSB
Thanks,
Ori
> -----Original Message-----
> From: Shahaf Shuler
> Sent: Monday, April 22, 2019 4:18 PM
> To: Ori Kam <orika@mellanox.com>; Yongseok Koh <yskoh@mellanox.com>
> Cc: dev@dpdk.org; Ori Kam <orika@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
>
> Monday, April 22, 2019 3:34 PM, Ori Kam:
> > Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix modification action flags
> >
> > When creating the modify action using Direct Rules, we need to add flags to
> > mark, if the action will be done on root table or on private table.
> >
> > Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
> >
> > Signed-off-by: Ori Kam <orika@mellanox.com>
> > ---
> > v2:
> > * Change title of commit.
> > ---
> > drivers/net/mlx5/mlx5_flow.h | 1 +
> > drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
> > 2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
> > index c419e6b..b665420 100644
> > --- a/drivers/net/mlx5/mlx5_flow.h
> > +++ b/drivers/net/mlx5/mlx5_flow.h
> > @@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
> > uint32_t actions_num; /**< Number of modification actions. */
> > struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
> > /**< Modification actions. */
> > + uint64_t flags; /**< Flags for RDMA API. */
>
> Flags are for RDMA API or Direct rule API?
>
Direct rules but they are located in RDMA,
The encap structure as the same comment exactly.
> > };
> >
> > /* Jump action resource structure. */
> > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> > b/drivers/net/mlx5/mlx5_flow_dv.c index 2f777ec..ffc6ab7 100644
> > --- a/drivers/net/mlx5/mlx5_flow_dv.c
> > +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> > @@ -1830,10 +1830,12 @@ struct field_modify_info modify_tcp[] = {
> > ns = sh->tx_ns;
> > else
> > ns = sh->rx_ns;
> > + resource->flags = dev_flow->flow->group ? 0 : 1;
>
> Use flag macro rather then fixed value. Something like
> MLX5_DV_MODIFY_FLAGS_INNER_TABLE ?
>
> > /* Lookup a matching resource from cache. */
> > LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
> > if (resource->ft_type == cache_resource->ft_type &&
> > resource->actions_num == cache_resource->actions_num
> > &&
> > + resource->flags == cache_resource->flags &&
> > !memcmp((const void *)resource->actions,
> > (const void *)cache_resource->actions,
> > (resource->actions_num *
> > @@ -1856,7 +1858,7 @@ struct field_modify_info modify_tcp[] = {
> > cache_resource->verbs_action =
> > mlx5_glue->dv_create_flow_action_modify_header
> > (sh->ctx, cache_resource->ft_type,
> > - ns, 0,
> > + ns, cache_resource->flags,
> > cache_resource->actions_num *
> > sizeof(cache_resource->actions[0]),
> > (uint64_t *)cache_resource-
> > >actions);
> > --
> > 1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v3] net/mlx5: fix modification action flags
2019-04-22 12:21 [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags Ori Kam
2019-04-22 12:21 ` Ori Kam
2019-04-22 12:34 ` [dpdk-dev] [PATCH v2] net/mlx5: fix modification " Ori Kam
@ 2019-04-22 18:01 ` Ori Kam
2019-04-22 18:01 ` Ori Kam
2019-04-22 18:06 ` Ori Kam
3 siblings, 1 reply; 12+ messages in thread
From: Ori Kam @ 2019-04-22 18:01 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
v3:
* Address ML comments.
v2:
* Change title.
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..af2cf33 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -43,6 +43,10 @@
#define MLX5DV_FLOW_TABLE_TYPE_FDB 0
#endif
+#ifndef HAVE_MLX5DV_DR
+#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1
+#endif
+
union flow_dv_attr {
struct {
uint32_t valid:1;
@@ -1830,10 +1834,13 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags =
+ dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1863,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v3] net/mlx5: fix modification action flags
2019-04-22 18:01 ` [dpdk-dev] [PATCH v3] " Ori Kam
@ 2019-04-22 18:01 ` Ori Kam
0 siblings, 0 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 18:01 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
v3:
* Address ML comments.
v2:
* Change title.
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..af2cf33 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -43,6 +43,10 @@
#define MLX5DV_FLOW_TABLE_TYPE_FDB 0
#endif
+#ifndef HAVE_MLX5DV_DR
+#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1
+#endif
+
union flow_dv_attr {
struct {
uint32_t valid:1;
@@ -1830,10 +1834,13 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags =
+ dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1863,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v3] net/mlx5: fix modification action flags
2019-04-22 12:21 [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags Ori Kam
` (2 preceding siblings ...)
2019-04-22 18:01 ` [dpdk-dev] [PATCH v3] " Ori Kam
@ 2019-04-22 18:06 ` Ori Kam
2019-04-22 18:06 ` Ori Kam
3 siblings, 1 reply; 12+ messages in thread
From: Ori Kam @ 2019-04-22 18:06 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
v3:
* Address ML comments.
v2:
* Change title.
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..af2cf33 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -43,6 +43,10 @@
#define MLX5DV_FLOW_TABLE_TYPE_FDB 0
#endif
+#ifndef HAVE_MLX5DV_DR
+#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1
+#endif
+
union flow_dv_attr {
struct {
uint32_t valid:1;
@@ -1830,10 +1834,13 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags =
+ dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1863,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v3] net/mlx5: fix modification action flags
2019-04-22 18:06 ` Ori Kam
@ 2019-04-22 18:06 ` Ori Kam
0 siblings, 0 replies; 12+ messages in thread
From: Ori Kam @ 2019-04-22 18:06 UTC (permalink / raw)
To: yskoh, shahafs; +Cc: dev, orika
When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.
Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
Signed-off-by: Ori Kam <orika@mellanox.com>
---
v3:
* Address ML comments.
v2:
* Change title.
---
drivers/net/mlx5/mlx5_flow.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c419e6b..b665420 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource {
uint32_t actions_num; /**< Number of modification actions. */
struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
/**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
};
/* Jump action resource structure. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2f777ec..af2cf33 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -43,6 +43,10 @@
#define MLX5DV_FLOW_TABLE_TYPE_FDB 0
#endif
+#ifndef HAVE_MLX5DV_DR
+#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1
+#endif
+
union flow_dv_attr {
struct {
uint32_t valid:1;
@@ -1830,10 +1834,13 @@ struct field_modify_info modify_tcp[] = {
ns = sh->tx_ns;
else
ns = sh->rx_ns;
+ resource->flags =
+ dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;
/* Lookup a matching resource from cache. */
LIST_FOREACH(cache_resource, &sh->modify_cmds, next) {
if (resource->ft_type == cache_resource->ft_type &&
resource->actions_num == cache_resource->actions_num &&
+ resource->flags == cache_resource->flags &&
!memcmp((const void *)resource->actions,
(const void *)cache_resource->actions,
(resource->actions_num *
@@ -1856,7 +1863,7 @@ struct field_modify_info modify_tcp[] = {
cache_resource->verbs_action =
mlx5_glue->dv_create_flow_action_modify_header
(sh->ctx, cache_resource->ft_type,
- ns, 0,
+ ns, cache_resource->flags,
cache_resource->actions_num *
sizeof(cache_resource->actions[0]),
(uint64_t *)cache_resource->actions);
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2019-04-22 18:11 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 12:21 [dpdk-dev] [PATCH] net/mlx5: fix encapsulation action flags Ori Kam
2019-04-22 12:21 ` Ori Kam
2019-04-22 12:34 ` [dpdk-dev] [PATCH v2] net/mlx5: fix modification " Ori Kam
2019-04-22 12:34 ` Ori Kam
2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 13:18 ` Shahaf Shuler
2019-04-22 13:46 ` Ori Kam
2019-04-22 13:46 ` Ori Kam
2019-04-22 18:01 ` [dpdk-dev] [PATCH v3] " Ori Kam
2019-04-22 18:01 ` Ori Kam
2019-04-22 18:06 ` Ori Kam
2019-04-22 18:06 ` Ori Kam
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).