* [PATCH] net/mlx5: fix matcher flags in counter offset detection
@ 2025-08-20 8:45 Dariusz Sosnowski
2025-08-27 9:15 ` David Marchand
2025-08-29 12:50 ` Andre Muezerie
0 siblings, 2 replies; 4+ messages in thread
From: Dariusz Sosnowski @ 2025-08-20 8:45 UTC (permalink / raw)
To: Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad
Cc: dev, Raslan Darawsheh, stable, Andre Muezerie
This patch fixes a bug in
mlx5_flow_dv_discover_counter_offset_support()
uncovered by a warning reported by MSVC:
../drivers/net/mlx5/mlx5_flow_dv.c(19636): warning C5287:
operands are different enum types 'ibv_flow_attr_type' and
'ibv_flow_flags';
use an explicit cast to silence this warning
IBV_FLOW_ATTR_FLAGS_EGRESS was incorrectly passed in to
type field of mlx5dv_flow_matcher_attr struct,
instead of flags field.
As a result counter offset support discovery returned a false positive
result on application with old rdma-core.
Bugzilla ID: 1758
Fixes: 4fd5e1484887 ("net/mlx5: fix counter offset detection")
Cc: suanmingm@nvidia.com
Cc: stable@dpdk.org
Reported-by: Andre Muezerie <andremue@linux.microsoft.com>
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 7b9e5018b8..4a6f9d63fb 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -19652,7 +19652,8 @@ 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 | IBV_FLOW_ATTR_FLAGS_EGRESS,
+ .type = IBV_FLOW_ATTR_NORMAL,
+ .flags = IBV_FLOW_ATTR_FLAGS_EGRESS,
.priority = 0,
.match_criteria_enable = 0,
.match_mask = (void *)&mask,
--
2.39.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net/mlx5: fix matcher flags in counter offset detection
2025-08-20 8:45 [PATCH] net/mlx5: fix matcher flags in counter offset detection Dariusz Sosnowski
@ 2025-08-27 9:15 ` David Marchand
2025-08-29 12:43 ` Andre Muezerie
2025-08-29 12:50 ` Andre Muezerie
1 sibling, 1 reply; 4+ messages in thread
From: David Marchand @ 2025-08-27 9:15 UTC (permalink / raw)
To: Dariusz Sosnowski, Andre Muezerie
Cc: Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
Matan Azrad, dev, Raslan Darawsheh, stable
On Wed, 20 Aug 2025 at 10:47, Dariusz Sosnowski <dsosnowski@nvidia.com> wrote:
>
> This patch fixes a bug in
> mlx5_flow_dv_discover_counter_offset_support()
> uncovered by a warning reported by MSVC:
>
> ../drivers/net/mlx5/mlx5_flow_dv.c(19636): warning C5287:
> operands are different enum types 'ibv_flow_attr_type' and
> 'ibv_flow_flags';
> use an explicit cast to silence this warning
>
> IBV_FLOW_ATTR_FLAGS_EGRESS was incorrectly passed in to
> type field of mlx5dv_flow_matcher_attr struct,
> instead of flags field.
> As a result counter offset support discovery returned a false positive
> result on application with old rdma-core.
>
> Bugzilla ID: 1758
> Fixes: 4fd5e1484887 ("net/mlx5: fix counter offset detection")
> Cc: suanmingm@nvidia.com
> Cc: stable@dpdk.org
>
> Reported-by: Andre Muezerie <andremue@linux.microsoft.com>
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
I did not test the patch, but on the principle this lgtm.
Andre, can you confirm it solves the build warning you were seeing with MSVC?
--
David Marchand
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net/mlx5: fix matcher flags in counter offset detection
2025-08-27 9:15 ` David Marchand
@ 2025-08-29 12:43 ` Andre Muezerie
0 siblings, 0 replies; 4+ messages in thread
From: Andre Muezerie @ 2025-08-29 12:43 UTC (permalink / raw)
To: David Marchand
Cc: Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
Suanming Mou, Matan Azrad, dev, Raslan Darawsheh, stable
On Wed, Aug 27, 2025 at 11:15:57AM +0200, David Marchand wrote:
> On Wed, 20 Aug 2025 at 10:47, Dariusz Sosnowski <dsosnowski@nvidia.com> wrote:
> >
> > This patch fixes a bug in
> > mlx5_flow_dv_discover_counter_offset_support()
> > uncovered by a warning reported by MSVC:
> >
> > ../drivers/net/mlx5/mlx5_flow_dv.c(19636): warning C5287:
> > operands are different enum types 'ibv_flow_attr_type' and
> > 'ibv_flow_flags';
> > use an explicit cast to silence this warning
> >
> > IBV_FLOW_ATTR_FLAGS_EGRESS was incorrectly passed in to
> > type field of mlx5dv_flow_matcher_attr struct,
> > instead of flags field.
> > As a result counter offset support discovery returned a false positive
> > result on application with old rdma-core.
> >
> > Bugzilla ID: 1758
> > Fixes: 4fd5e1484887 ("net/mlx5: fix counter offset detection")
> > Cc: suanmingm@nvidia.com
> > Cc: stable@dpdk.org
> >
> > Reported-by: Andre Muezerie <andremue@linux.microsoft.com>
> > Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
>
> I did not test the patch, but on the principle this lgtm.
>
> Andre, can you confirm it solves the build warning you were seeing with MSVC?
>
>
> --
> David Marchand
>
Dariusz and David,
This patch compiles cleanly with MSVC.
Thanks for fixing this bug!
Andre Muezerie
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net/mlx5: fix matcher flags in counter offset detection
2025-08-20 8:45 [PATCH] net/mlx5: fix matcher flags in counter offset detection Dariusz Sosnowski
2025-08-27 9:15 ` David Marchand
@ 2025-08-29 12:50 ` Andre Muezerie
1 sibling, 0 replies; 4+ messages in thread
From: Andre Muezerie @ 2025-08-29 12:50 UTC (permalink / raw)
To: Dariusz Sosnowski
Cc: Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
Matan Azrad, dev, Raslan Darawsheh, stable
On Wed, Aug 20, 2025 at 10:45:21AM +0200, Dariusz Sosnowski wrote:
> This patch fixes a bug in
> mlx5_flow_dv_discover_counter_offset_support()
> uncovered by a warning reported by MSVC:
>
> ../drivers/net/mlx5/mlx5_flow_dv.c(19636): warning C5287:
> operands are different enum types 'ibv_flow_attr_type' and
> 'ibv_flow_flags';
> use an explicit cast to silence this warning
>
> IBV_FLOW_ATTR_FLAGS_EGRESS was incorrectly passed in to
> type field of mlx5dv_flow_matcher_attr struct,
> instead of flags field.
> As a result counter offset support discovery returned a false positive
> result on application with old rdma-core.
>
> Bugzilla ID: 1758
> Fixes: 4fd5e1484887 ("net/mlx5: fix counter offset detection")
> Cc: suanmingm@nvidia.com
> Cc: stable@dpdk.org
>
> Reported-by: Andre Muezerie <andremue@linux.microsoft.com>
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> ---
> drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
> index 7b9e5018b8..4a6f9d63fb 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -19652,7 +19652,8 @@ 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 | IBV_FLOW_ATTR_FLAGS_EGRESS,
> + .type = IBV_FLOW_ATTR_NORMAL,
> + .flags = IBV_FLOW_ATTR_FLAGS_EGRESS,
> .priority = 0,
> .match_criteria_enable = 0,
> .match_mask = (void *)&mask,
> --
> 2.39.5
>
This compiles cleanly with msvc. Thanks for fixing it.
Acked-by: Andre Muezerie <andremue@linux.microsoft.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-29 12:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-20 8:45 [PATCH] net/mlx5: fix matcher flags in counter offset detection Dariusz Sosnowski
2025-08-27 9:15 ` David Marchand
2025-08-29 12:43 ` Andre Muezerie
2025-08-29 12:50 ` Andre Muezerie
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).