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 57436A04A4; Wed, 2 Mar 2022 18:23:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDF0B42715; Wed, 2 Mar 2022 18:23:16 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id EAB8B40141 for ; Wed, 2 Mar 2022 18:23:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646241795; x=1677777795; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=ujt+oMs5xTYdX3gRBORM2tqQlUFhmcdOhjEaBDpLnfM=; b=IvAh4QfOh4lpfvtM1giHFNPVvEfYIvelZeFtC5zn19sk1Dl+Dh1CuBhv oaYlWAbAMUxX6RD3aVfnzcM5/hqCXfbkTxl64cCkmlRd8X4MgGCKIuI7O zPgbNxNUh+K6UpVb0kenp5c9aL6LWwQoUFjk+BII5IJ/CQzYR42+83wn6 QuXhMiV19vQ4MHC9Zkosrbk2meSV51fc7t8MI/oBUZYGfav1k3+Hs/zw0 VMETeHvOYNPyv+HukGJiqqWSfw+FMkXQ1vM66SC19iaJ/qC2uQR0QFRiP qYVNQXuiHW2n8Uv3ycjZPhowTnWApmMSyxpdM6A3auvNxZyA+vDUD3EjD w==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="278131910" X-IronPort-AV: E=Sophos;i="5.90,149,1643702400"; d="scan'208";a="278131910" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 09:23:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,149,1643702400"; d="scan'208";a="594077942" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga008.fm.intel.com with ESMTP; 02 Mar 2022 09:23:13 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 2 Mar 2022 09:23:13 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 2 Mar 2022 09:23:13 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 2 Mar 2022 09:23:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fjY1mLa+EG2t5V2uvOKr/xES7w4tigNCYc6eauHB/obDgDHpojawLRbjohDMCvYzo25aq+fDJpBOJk8xrG9JFzWHzLwOupSoC/sKHsbKgKPN3AcXX9HTv6UhH+UFltvtIqF9j7CJUXUSBv4OGYlingWZXiZTYIurWTzzVO+SKNRctY4I4dKKce43KdbC/9rGaYfsPRNX/n7QLUS21nFFutd9epzRUSZ0/S/PKpJYchhacD1GPcs1GKgWX9JTI1poIVcHGlEla8txEYOkB4QTkTcubHHanFo57VqDyO132YgpZa5kf3gKar/nd3AKIe7+TID5pEinfyka3oZEO1bkeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ti1Q0W7cqdDrCBjus855+8qVSa7Zt86QsjYlrjGzY0w=; b=KOgDx+gx6Hqxh0AyFnhugH1Q23diIT9qX+bX+U/sSmtnPGzq7+x6zW4E23BpajrcTmwYhcb+o04ERIqxclogMr+r15DpvO6MCfIvEcy1xZPe7V4KOcW9JF9CLtJrkuqA31dNN3lgrRTEHFysro2wSaplMkbc3p/bd/4hl0V2XHso7xYkQSrRfK8l09yokMsk5fGvi77MhHZCcHkoee5v8E+omMqWO/WlsAK/TYQbrXQYaD0GRKy2QyG6t+De//9TrIuhOfmte16SdBnwN5sP2oMwBW16ML1/2ViyUEYIhLcGeB4F/4JwdCjeS6PW0wj+XgXKKxAfKS8mXgIOfzpFZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by DM6PR11MB3516.namprd11.prod.outlook.com (2603:10b6:5:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 2 Mar 2022 17:23:11 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf%7]) with mapi id 15.20.5038.014; Wed, 2 Mar 2022 17:23:11 +0000 Message-ID: Date: Wed, 2 Mar 2022 17:23:05 +0000 Content-Language: en-US To: Jiawen Wu , 'Weiguo Li' CC: , David Marchand , Aaron Conole References: <004601d82e0b$e60ab910$b2202b30$@trustnetic.com> From: Ferruh Yigit Subject: Re: [PATCH] net/txgbe: fix a bit with boolean operator X-User: ferruhy In-Reply-To: <004601d82e0b$e60ab910$b2202b30$@trustnetic.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0279.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:195::14) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72d9629c-a2ac-4795-c194-08d9fc715348 X-MS-TrafficTypeDiagnostic: DM6PR11MB3516:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lFjkEpUnC2V7N/ACSfL25h06VE2Jcr7sADRFbL1g5FjiUyggPLO8aknPf9i1p6F4a2zg0ivf8dyYc5ISRuhQ5kmFx5C3xx80m7+x8P9IRGqoPhFZ7o7+CNbvXPqNOFiT56IuMaDEpx+c6PNbZwnP3UM5+uHpbF12GiheqmV1pMJ53FVwYEWGGatADVn2AFB2hzwPGTvnkt+8c/hRV3Ofv4yfrmZtcpnz55i/e+l2Xw8pnb0g1dd8zlOcFobwrrKpRdCIiIcTvz+SpiVCkdju00IEfafg2pVL58dMVB3JMlog6B96lq5maN0Vk3V/ZD6YAmx1bTAbFXISX+vK6CU9OU3pLPJnkhFyT9viZeinhhH//vKaFiDwRLPDefYUp6e+vXkHKFNGhXAk115QCGrkxovyzO09UG0G9fN4gBJMX84+LuAgDUO6XLpCBM4/odqCY+/5GNizjiotmvmj2eHgaqp+jzr04UUjKCu3geNsKrF4qyhpv+MDb4qQsXe7A/uI0tCdNj0VKW59Bda+ilmPeMbNwT2l5CAvD+sFiYVQnt3J0EgsyH8N6zfkG4jUPDqZPPYodxMQbXBuLvcniRFzOm2sjnBfpgrvte5cdO9dOb+VmY1r/mvxjnYSd6qNgOZsnE0xHOXU656CC3U5jczqaI/SuIWLN+g7WVaS9j5Lubel2MObPRDhLs+dFK6XsW3KHjCa27SX+78NLcFjYBKcvTNPlle4rjCeO1JBri5xx7yeykqCvLg1zOLtwq7cc67V X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(44832011)(6512007)(82960400001)(8936002)(38100700002)(2906002)(186003)(26005)(2616005)(54906003)(110136005)(316002)(5660300002)(86362001)(66946007)(83380400001)(4326008)(66556008)(6486002)(31696002)(66476007)(508600001)(8676002)(31686004)(6506007)(53546011)(36756003)(6666004)(48020200001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NGdyYmRMZ0gvdkJ2M3Jsd2wraWNuSGZ6dTJya1hBOFRUSG1DR3ZBZmRTaCtl?= =?utf-8?B?bkprcFpXRnVlVEtWWUk2aU1qWXVkcEprUWtlQ1lJWFc0ZXNuMFRvaDZxbTVB?= =?utf-8?B?R3BqdFV0Z1hSTEc2cjdRLzlxMFpmeENCWjIxNklLeTZFaEYzRjNJdkVuNThN?= =?utf-8?B?VWFaQzBJRUtvSisvZEZMR3k3OHJ0NDczR1FPZ1pPZ3QvekFFclVKWG90VElq?= =?utf-8?B?c1VVblVnbWxCWXcwWmJTZzFDMlU4OTdUUHpLWHBxVTlnZkIxZ241c2t1d2dU?= =?utf-8?B?U2ZxTnJoTTZ4dDYrMlFpT0czZGttelZ6b0dMamJPWURoOUVudGVVaitFWWhR?= =?utf-8?B?UXBlWk92cHBRdzZLR2ZMS052b1I4VnUwOXBBaVdmcGR1TFdHZUhPTW9HbXJ5?= =?utf-8?B?OThpejFOVHdtbjZ5ZmFxVTNRcVNndUttd09zSHovS3k4RHdPaFJ6TEowRjRt?= =?utf-8?B?WXg4MmpaN0FiVjVoSjdWY1ZIeEZ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5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 17:23:11.1385 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pq0k9s8EfsLcPRlCW7qV+b5lmC5AJfZvdhOls/aYYePmLAhKZqHOHjND/80TUntw9JCv3UYZJCoaBIJnwnGhMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3516 X-OriginatorOrg: intel.com 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 3/2/2022 8:02 AM, Jiawen Wu wrote: > 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 > Hi Weiguo, Good catch, I wonder how did you detect this? If there is an automated way, maybe we can consider using it in our CI.