[DPDK/other Bug 1758] net/mlx5: Incompatible enum type used in bitwise operation

bugzilla at dpdk.org bugzilla at dpdk.org
Mon Jul 21 16:19:31 CEST 2025


https://bugs.dpdk.org/show_bug.cgi?id=1758

            Bug ID: 1758
           Summary: net/mlx5: Incompatible enum type used in bitwise
                    operation
           Product: DPDK
           Version: 25.03
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: other
          Assignee: dev at dpdk.org
          Reporter: andremuz at gmail.com
  Target Milestone: ---

Compiling with MSCS results in the warning below:

../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

It looks like a legit bug. Here is the offending line:

        struct mlx5dv_flow_matcher_attr dv_attr = {
                .type = IBV_FLOW_ATTR_NORMAL | IBV_FLOW_ATTR_FLAGS_EGRESS,

As the warning states, the constants in the bitwise operation belong to
different enums, and these enums have overlaping values, which makes the
bitwise operation very suspicious.
On top of that, I see that struct mlx5dv_flow_matcher_attr has a field named
"flags" which accepts values from ibv_flow_flags:

        struct mlx5dv_flow_matcher_attr {
                enum ibv_flow_attr_type type;
                uint32_t flags; /* From enum ibv_flow_flags. */

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250721/ccc5cfe2/attachment-0001.htm>


More information about the dev mailing list