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 bluca committed Mar 9, 2022
1 parent cd135f6 commit 4e76a13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/txgbe/txgbe_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,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 4e76a13

Please sign in to comment.