* [dpdk-stable] [PATCH] net/mlx5: fix counter offset detection
@ 2021-05-13 8:05 Suanming Mou
2021-05-13 9:55 ` Matan Azrad
0 siblings, 1 reply; 3+ messages in thread
From: Suanming Mou @ 2021-05-13 8:05 UTC (permalink / raw)
To: viacheslavo, matan; +Cc: rasland, dev, stable
Currently, the counter offset support is discovered by creating the
rule with invalid offset counter and drop action in root table. If
the rule creation fails with EINVAL errno, that mean counter offset
is not supported in root table.
However, drop action may not be supported in some rdma-core version
in root table. In this case, the discover code will not work properly.
This commits changes flow attribute to egress. That removes all the
extra fate actions in the flow to avoid any unsupported fate actions
make the discover code fail time to time.
Fixes: 994829e695c0 ("net/mlx5: remove single counter container")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 7fc7efbc5c..71d9f88a95 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -16081,7 +16081,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
.size = sizeof(value.buf),
};
struct mlx5dv_flow_matcher_attr dv_attr = {
- .type = IBV_FLOW_ATTR_NORMAL,
+ .type = IBV_FLOW_ATTR_NORMAL | IBV_FLOW_ATTR_FLAGS_EGRESS,
.priority = 0,
.match_criteria_enable = 0,
.match_mask = (void *)&mask,
@@ -16093,7 +16093,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
void *flow = NULL;
int ret = -1;
- tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, false, NULL,
+ tbl = flow_dv_tbl_resource_get(dev, 0, 1, 0, false, NULL,
0, 0, 0, NULL);
if (!tbl)
goto err;
@@ -16104,14 +16104,12 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
&actions[0]);
if (ret)
goto err;
- actions[1] = sh->dr_drop_action ? sh->dr_drop_action :
- priv->drop_queue.hrxq->action;
dv_attr.match_criteria_enable = flow_dv_matcher_enable(mask.buf);
ret = mlx5_flow_os_create_flow_matcher(sh->ctx, &dv_attr, tbl->obj,
&matcher);
if (ret)
goto err;
- ret = mlx5_flow_os_create_flow(matcher, (void *)&value, 2,
+ ret = mlx5_flow_os_create_flow(matcher, (void *)&value, 1,
actions, &flow);
err:
/*
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] net/mlx5: fix counter offset detection
2021-05-13 8:05 [dpdk-stable] [PATCH] net/mlx5: fix counter offset detection Suanming Mou
@ 2021-05-13 9:55 ` Matan Azrad
2021-05-13 12:55 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Matan Azrad @ 2021-05-13 9:55 UTC (permalink / raw)
To: Suanming Mou, Slava Ovsiienko; +Cc: Raslan Darawsheh, dev, stable
From: Suanming Mou
> Currently, the counter offset support is discovered by creating the rule with
> invalid offset counter and drop action in root table. If the rule creation fails
> with EINVAL errno, that mean counter offset is not supported in root table.
>
> However, drop action may not be supported in some rdma-core version in
> root table. In this case, the discover code will not work properly.
>
> This commits changes flow attribute to egress. That removes all the extra
> fate actions in the flow to avoid any unsupported fate actions make the
> discover code fail time to time.
>
> Fixes: 994829e695c0 ("net/mlx5: remove single counter container")
> Cc: stable@dpdk.org
>
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix counter offset detection
2021-05-13 9:55 ` Matan Azrad
@ 2021-05-13 12:55 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2021-05-13 12:55 UTC (permalink / raw)
To: Suanming Mou; +Cc: Slava Ovsiienko, dev, Raslan Darawsheh, stable, Matan Azrad
> > Currently, the counter offset support is discovered by creating the rule with
> > invalid offset counter and drop action in root table. If the rule creation fails
> > with EINVAL errno, that mean counter offset is not supported in root table.
> >
> > However, drop action may not be supported in some rdma-core version in
> > root table. In this case, the discover code will not work properly.
> >
> > This commits changes flow attribute to egress. That removes all the extra
> > fate actions in the flow to avoid any unsupported fate actions make the
> > discover code fail time to time.
> >
> > Fixes: 994829e695c0 ("net/mlx5: remove single counter container")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
Applied in next-net-mlx, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-13 12:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 8:05 [dpdk-stable] [PATCH] net/mlx5: fix counter offset detection Suanming Mou
2021-05-13 9:55 ` Matan Azrad
2021-05-13 12:55 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
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).