net/txgbe: fix queue statistics mapping
authorWeiguo Li <liwg06@foxmail.com>
Tue, 1 Mar 2022 06:08:30 +0000 (14:08 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 2 Mar 2022 17:28:49 +0000 (18:28 +0100)
Since boolean value is in 0 and 1, it's strange to combines a boolean
value with a bit operator.

Thus it's highly possible a typo error with "if (A & !B)", and more
probably to use "if (A & ~B)" instead.

Fixes: c1d4e9d37abd ("net/txgbe: add queue stats mapping")
Cc: stable@dpdk.org
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
drivers/net/txgbe/txgbe_ethdev.c

index 19d4444..f0994f0 100644 (file)
@@ -376,7 +376,7 @@ txgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
        if (hw->mac.type != txgbe_mac_raptor)
                return -ENOSYS;
 
-       if (stat_idx & !QMAP_FIELD_RESERVED_BITS_MASK)
+       if (stat_idx & ~QMAP_FIELD_RESERVED_BITS_MASK)
                return -EIO;
 
        PMD_INIT_LOG(DEBUG, "Setting port %d, %s queue_id %d to stat index %d",