Skip to content

Commit

Permalink
net/txgbe: fix queue statistics mapping
Browse files Browse the repository at this point in the history
[ upstream commit f694671 ]

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: c1d4e9d ("net/txgbe: add queue stats mapping")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
liwg06 authored and kevintraynor committed Mar 8, 2022
1 parent e28e67f commit 0316ab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/txgbe/txgbe_ethdev.c
Expand Up @@ -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",
Expand Down

0 comments on commit 0316ab0

Please sign in to comment.