From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 279F0A04A4; Wed, 2 Mar 2022 09:02:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E62D54014E; Wed, 2 Mar 2022 09:02:49 +0100 (CET) Received: from smtpbgeu2.qq.com (smtpbgeu2.qq.com [18.194.254.142]) by mails.dpdk.org (Postfix) with ESMTP id 43BB540141 for ; Wed, 2 Mar 2022 09:02:48 +0100 (CET) X-QQ-mid: bizesmtp78t1646208164t1jk989b Received: from jiawenwu (unknown [183.129.236.74]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 02 Mar 2022 16:02:43 +0800 (CST) X-QQ-SSF: 01400000000000F0M000B00A0000000 X-QQ-FEAT: pqOtrSRu7rihnUgL8emwjbWRJ65Jf3xeSHczWfIwJFXAQQV2Fbu+dEXAw7lnD m1Vq61ZG2iYvy/n4rdCNiVgpXs4bvBGgNa/PSVnREms+m+9ap4sBjSpQhf/Z67gvgy8oBMg Cx9a51LFF8AkDWLL1Hr48USCwdu/ClXi0ylGltB4oZ2jCtdKv6G06kPVal/yqTfkJtds8BT TO5jzzhj31CBG1aWawyZ2i3zlMc7UPjun3IZvUuqYkRg7wgTQ4Ed01I9YITdVPwRp/jJI/j 64j2LbsCX5JXiZq3+VqHNaFV+9DaQp38+TvQbsvKyUFGmSBy4/lD9+z3bHvOsTculOOrKls nXMubYuxk9stQLRlcw= X-QQ-GoodBg: 2 From: "Jiawen Wu" To: "'Weiguo Li'" Cc: References: LkRqr2tzIWJ5HHp6ZGrppcchuNK5SsIjWTu+y+SeWnizDcA6o6Nt845FWdw808au6UlOP3CgjphA Zy+PmAkoHX6sJYIcOiwZ+1Y2GRWl6xWcvz6aaV4Te2Hb98Z4tIAymZrkFPvSvaiuVhA8rDbaQ1zk Sm3A8Gy2vpGpbcANmLELrQziPd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hLEUUXIjTQZEzbioN7qMLXkdGrm6KA5E6fmsxZlXr5p I4GGQxaWIGIyv7txmu4NQJI837Uzu3UF5kX/fGsVRXcLYv4yD3+89jstS42EFnnWY5JFR/nzkHTi vlKtMmqGxODoISatDVZGr118BudxxFsvUEHG9sgJTb46rhAqpQxukl9fp/lYa1k/fHmuP0EjX5GR tuoFyo0DRCOInVbCJXMtmgpfHjRhKoTv9n2uAy/SyeWZaaV2xu+4uY7HxDuMuYUulFapqr4RWujV Yc04Kgg5yXWXtIT6wbFZsnjkBr7BE1Y3QnZ9a7U5E2Qis8gd7lccCV9ygM4DIr+6Z5qj4tyHerTD 2YRRazLwzIDUpD7tXJXRYt5Sn5It6F6LCJBfBNvP2mht+YzI/pRSz2fYmq90ZdHM8iGSn35t1UuL NbuM59EsOf2DazwF1z6JHNmg5vUSAw3iFQ1znvu1ayqGcpbYrdp9mDveKaByGvGqCLGsNPBEN4TE 8gYdfkFbVDZ1xDm5cE4Ij3o8svawFcLNz3TiRXkW8tokHpfHj8qoNB9GXDJw1yig== Subject: RE: [PATCH] net/txgbe: fix a bit with boolean operator Date: Wed, 2 Mar 2022 16:02:43 +0800 Message-ID: <004601d82e0b$e60ab910$b2202b30$@trustnetic.com>+450D0D8ADD3E9A2D MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQFsg2CtfJLx30wqZ6bxkfYBs5BThq2DEK/A X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On March 1, 2022 2:09 PM, Weiguo Li wrote: > 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: c1d4e9d37abdc6 ("net/txgbe: add queue stats mapping") > > Signed-off-by: Weiguo Li > --- > drivers/net/txgbe/txgbe_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/txgbe/txgbe_ethdev.c > b/drivers/net/txgbe/txgbe_ethdev.c > index 19d4444748..f0994f028d 100644 > --- a/drivers/net/txgbe/txgbe_ethdev.c > +++ b/drivers/net/txgbe/txgbe_ethdev.c > @@ -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", > -- > 2.25.1 Thanks. Acked-by: Jiawen Wu