Build error:
.../drivers/net/cxgbe/cxgbe_flow.c:315:2:
    error: implicit truncation from 'int' to bitfield changes value
    from -1 to 7 [-Werror,-Wbitfield-constant-conversion]
        CXGBE_FILL_FS(adap->pf, ~0, pf);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../drivers/net/cxgbe/cxgbe_flow.c:25:2:
    note: expanded from macro 'CXGBE_FILL_FS'
        __CXGBE_FILL_FS(v, m, fs, elem, e)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../drivers/net/cxgbe/cxgbe_flow.c:15:18: note:
    expanded from macro '__CXGBE_FILL_FS'
        (fs)->mask.elem = (__m); \
                        ^ ~~~~~
Commit in fixes line changes 'PF_BITWIDTH' to '3', which makes 'fs->pf'
bitfield size '3', changing '~0' to '0x7' to prevent truncation in
assignment.

Fixes: dcd456abe46f ("net/cxgbe: support flow API for matching all packets on 
PF")

Reported-by: Raslan Darawsheh <rasl...@mellanox.com>
Reported-by: Xueming Zhang <xuemingx.zh...@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yi...@intel.com>
---
Cc: kaara.sat...@chelsio.com
---
 drivers/net/cxgbe/cxgbe_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index 13fd78aaf..a46515d3b 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -312,7 +312,7 @@ ch_rte_parsetype_pf(const void *dmask __rte_unused,
 
        CXGBE_FILL_FS(1, 1, pfvf_vld);
 
-       CXGBE_FILL_FS(adap->pf, ~0, pf);
+       CXGBE_FILL_FS(adap->pf, 0x7, pf);
        return 0;
 }
 
-- 
2.25.1

Reply via email to