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 40C2441D3D; Thu, 2 Mar 2023 10:28:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2796D40E09; Thu, 2 Mar 2023 10:28:25 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2084.outbound.protection.outlook.com [40.107.14.84]) by mails.dpdk.org (Postfix) with ESMTP id 0C95C40DFB for ; Thu, 2 Mar 2023 10:28:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rGjTEI93WVrNo3KdoohVwkc2E5MUjIgi5bSTqwtupZc=; b=MFFeaHlWhCC5q+C/un/g7OkwRV0W2CFpGqRKWoqa/s6MlUD1lfemfyjrOJHhPmUGmoIxbyKQl6qYaF+XBHwhG7veXsbNIEM9RZCthuMa8C8EWQe/kLObAeezlIW8jG05L1PgDh1vUgF5HedP9Qx112gzQdANLqXPlZ6hTgtWmIw= Received: from DB6PR0802CA0032.eurprd08.prod.outlook.com (2603:10a6:4:a3::18) by DB9PR08MB8412.eurprd08.prod.outlook.com (2603:10a6:10:3d4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.17; Thu, 2 Mar 2023 09:28:22 +0000 Received: from DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:a3:cafe::ea) by DB6PR0802CA0032.outlook.office365.com (2603:10a6:4:a3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.17 via Frontend Transport; Thu, 2 Mar 2023 09:28:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT055.mail.protection.outlook.com (100.127.142.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19 via Frontend Transport; Thu, 2 Mar 2023 09:28:21 +0000 Received: ("Tessian outbound 0df938784972:v135"); Thu, 02 Mar 2023 09:28:21 +0000 X-CR-MTA-TID: 64aa7808 Received: from f1496eae0b75.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7384B150-E195-4718-8FAB-BE88695DC61C.1; Thu, 02 Mar 2023 09:28:10 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f1496eae0b75.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 02 Mar 2023 09:28:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bNDG7dxQQO7BqjswXXSxYG+Bb3xxhQ38cJgr81QFaWJSi7/zrwPY5V7+MHsBvi9j8eJC2v1WRjtHdRV5nhsulrJ+JAsZPz2XC81vN7Jk1eKsZihpUM+98vxT/BpzxwHIpWIA9EMBID00I2yrG0qsXe6sKzxMsbez3csZTzEsR7ODsMtdmQ608nSLgjgrnscsCoe7hTHPj0LFy+3779Ub1ALQl7YmgWtGzOxPrQewVULDmGz4D6paZ8+mtbA7hikhgOPLNihaODSs1Ryc6vHI6anK84SMSgP+/A7wBkUn8fnNwPHU3n+yipTOrYBoi7eryWnYQdbmMk+KZQTIYIo2EQ== 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=rGjTEI93WVrNo3KdoohVwkc2E5MUjIgi5bSTqwtupZc=; b=Mkl4op/4oua4hcYEBwmFuMfaSpLQXWzSyzBgstTRz83YiMxUwlQigktd/oOmNWubSHvloFCFkFVoLDCzEzZoNBj5gqcDKIYjckqw2/CFM26ZndxiGMOwahFc9AHLwBh7zmK6KUK516Si1YboCnE91cJBkjYqrZJ+AvIoOvTMby73dRYOxQ6HPoIIDj3yB86Dn2XRQqpg2a1tKgMcW11Pg6/2fZu8TZoIEGu0P92wGAs4jVkOhw+Kq4LRE98XOdlzqcjRXZl44LR1w2nm2Mf2z9QH3JF4f6Tth7h0I5mSWVIFz676QDEETk4k/S44UZqRdQEHAzLMQ9Kg19y+CcbQ+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rGjTEI93WVrNo3KdoohVwkc2E5MUjIgi5bSTqwtupZc=; b=MFFeaHlWhCC5q+C/un/g7OkwRV0W2CFpGqRKWoqa/s6MlUD1lfemfyjrOJHhPmUGmoIxbyKQl6qYaF+XBHwhG7veXsbNIEM9RZCthuMa8C8EWQe/kLObAeezlIW8jG05L1PgDh1vUgF5HedP9Qx112gzQdANLqXPlZ6hTgtWmIw= Received: from AM9PR08MB7085.eurprd08.prod.outlook.com (2603:10a6:20b:417::10) by AS8PR08MB9118.eurprd08.prod.outlook.com (2603:10a6:20b:5b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19; Thu, 2 Mar 2023 09:28:09 +0000 Received: from AM9PR08MB7085.eurprd08.prod.outlook.com ([fe80::ccce:1186:e892:90f2]) by AM9PR08MB7085.eurprd08.prod.outlook.com ([fe80::ccce:1186:e892:90f2%8]) with mapi id 15.20.6134.029; Thu, 2 Mar 2023 09:28:09 +0000 From: Ruifeng Wang To: Tyler Retzlaff , "dev@dpdk.org" CC: Honnappa Nagarahalli , "thomas@monjalon.net" , nd Subject: RE: [PATCH 11/17] net/iavf: use previous value atomic fetch operations Thread-Topic: [PATCH 11/17] net/iavf: use previous value atomic fetch operations Thread-Index: AQHZTKDi7x6G2jjIm0CDo/QK3nXTA67nOKqw Date: Thu, 2 Mar 2023 09:28:09 +0000 Message-ID: References: <1677718068-2412-1-git-send-email-roretzla@linux.microsoft.com> <1677718068-2412-12-git-send-email-roretzla@linux.microsoft.com> In-Reply-To: <1677718068-2412-12-git-send-email-roretzla@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: F83E5772CCAA264EA2D4B22C933EB015.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AM9PR08MB7085:EE_|AS8PR08MB9118:EE_|DBAEUR03FT055:EE_|DB9PR08MB8412:EE_ X-MS-Office365-Filtering-Correlation-Id: b5f5e9e6-aaae-4685-441d-08db1b00775d x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: p9DaXUfRNlvJTcOQ0xrXZqB3g4PRKcSXPpNR9OtBT8wMygLgTO8eyOCi+hPZO5S2rLUW2TVyEPi/NUdnzo3KFZidS2sYzmPi59ZXgw2db8gbc79TiXyW3+/J4HygCNH/Wo8KYLcKYaukBwgFoIVTGu3LP5GkIhVmht41RYwMIbCANWKuaA1HTuWsf094AqQP/03NVJ4YsLilAk5iby87oKExHuWcJvABclADgtwi8KXM5fXd/MnJszsK+1wXhNyJSw/ebfYTmGOZ3bknjdw9Le9e8xEpuYNNOJv1wBq0eeu4Pwlx+Bb1xPEc6LiVO5j31OexIGFauyw53GMVfV3+AbV0ovLe+yWpHfCIpATDIh2Xlbt59g8Zb03f4/6qpRc4GrmKSrbWHEwepotSdlLa3LRdf4/es/Uxa57fSrY6i6iFEqUB/hhKAWMV8GUYzxFBoCSH5MMFXAhdoZjhhLfOGIFulxYCLobrgi7ZOHz6Csejx2zP9H+ncR0zFTe91JkgDjvw6WttBmMjGhnYctU+t+w8FvWAYjRVG+3KtcUv4gWArkBENFrTLB43/yDMJvsILFR/h3uziA+z/x7lnKXHYm6VPskrwgwr28ABvL2KXt/cjF2FSKKdPf89H/rfF18FadNduNBy0eJmIr8J171z5vdMrM7/3vfxXM5aC2Ky7ABBuRmdELDb0AQ7GW0R1wC80XH5zfF+ZS0IEXzdoTVn9w== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB7085.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(396003)(366004)(376002)(136003)(346002)(451199018)(83380400001)(38100700002)(122000001)(5660300002)(478600001)(8936002)(52536014)(66556008)(33656002)(86362001)(38070700005)(55016003)(26005)(186003)(9686003)(53546011)(71200400001)(6506007)(66946007)(64756008)(66446008)(66476007)(8676002)(7696005)(2906002)(76116006)(316002)(4326008)(41300700001)(110136005)(54906003); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9118 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0e9ff683-c3c0-4f4f-78ce-08db1b006fdb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fUrrKRYkr8TBK35u//eVgOxyGslcqmgvUMiTQkPgOJa+ofFHFEeyPo6HuqP6PJrLlETptudGBaWwHTeUV8ciB6Fpv9yXdp495zn9hKKzbsLUhHReKr0n1ybBefHLFbEiRKfiaJDKjpHOpMePya28BgoZAbtrmXP1s5VJbzkiMtekf8K1swzog1CjETRU7bb7boOauzfk554fyd52gjIbFpEqVX9kLdtCCUsbu9o3p7URtKIfeD8ABs+DXpeNKEzFV1hxmwq1Fi1n6GA9+7AEjdo/Kb/vE/WWBec+thuPoMmYiwAdOFAueOV25RbcG4cb7RLLszdBE4RX+wwLB+vS1r+G2178Ts56yAjtX90NlY+ljetRNDe6ImYH+UR4CHfWQA/Gm0mx9gz6KFW1ULTlTxXg4pgzS3HnB/2WMbinatGvPPoJj7eJWt3waC5j0LK2gjSf+QFfiIOJHO3aMDyh1xW4i+6rPkbnVylZ4KTpdxt3yp8I3eCBszMiDOOa/GLyu5LP8V+JN0KJSC45RovEjmjotKe/fyWc1+0/wKFHRTA3le9HeyOmkqp6qymtusGIYBZ/kzSoCINqZoSZkznJsK3EQjHK+CYoHGliqqgNJDh5NCfZ0oNnUR76yzfo5WySv0ncqJhsWFIS+HBtaj+xGmk1ltARhH0hY9SG6bJWWDkUvKLCBnpuWoaPoUObThifQj2WpYf+AmqkkAwz9IrYIw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(396003)(376002)(136003)(451199018)(36840700001)(40470700004)(46966006)(5660300002)(40480700001)(4326008)(41300700001)(52536014)(83380400001)(336012)(47076005)(40460700003)(316002)(55016003)(82310400005)(70206006)(70586007)(2906002)(8676002)(33656002)(8936002)(81166007)(82740400003)(36860700001)(186003)(9686003)(7696005)(53546011)(6506007)(26005)(54906003)(478600001)(86362001)(110136005)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 09:28:21.9451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5f5e9e6-aaae-4685-441d-08db1b00775d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8412 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 > -----Original Message----- > From: Tyler Retzlaff > Sent: Thursday, March 2, 2023 8:48 AM > To: dev@dpdk.org > Cc: Honnappa Nagarahalli ; thomas@monjalon.= net; Tyler > Retzlaff > Subject: [PATCH 11/17] net/iavf: use previous value atomic fetch operatio= ns >=20 > Use __atomic_fetch_{add,and,or,sub,xor} instead of __atomic_{add,and,or,s= ub,xor}_fetch > when we have no interest in the result of the operation. >=20 > Reduces unnecessary codegen that provided the result of the atomic operat= ion that was not > used. >=20 > Change brings closer alignment with atomics available in C11 standard and= will reduce > review effort when they are integrated. >=20 > Signed-off-by: Tyler Retzlaff > --- > drivers/net/iavf/iavf_vchnl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 9adaadb..73875d7 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -128,7 +128,7 @@ struct iavf_event_handler { > int err =3D pipe(handler->fd); > #endif > if (err !=3D 0) { > - __atomic_sub_fetch(&handler->ndev, 1, __ATOMIC_RELAXED); > + __atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED); > return -1; > } >=20 > @@ -137,7 +137,7 @@ struct iavf_event_handler { >=20 > if (rte_ctrl_thread_create(&handler->tid, "iavf-event-thread", > NULL, iavf_dev_event_handle, NULL)) { > - __atomic_sub_fetch(&handler->ndev, 1, __ATOMIC_RELAXED); > + __atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED); > return -1; > } >=20 > @@ -533,7 +533,7 @@ struct iavf_event_handler { > /* read message and it's expected one */ > if (msg_opc =3D=3D vf->pend_cmd) { > uint32_t cmd_count =3D > - __atomic_sub_fetch(&vf->pend_cmd_count, > + __atomic_fetch_sub(&vf->pend_cmd_count, It doesn't apply here. The return value is used. The rest of the series looks good to me. > 1, __ATOMIC_RELAXED); > if (cmd_count =3D=3D 0) > _notify_cmd(vf, msg_ret); > -- > 1.8.3.1