From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47AE7A04BA; Wed, 7 Oct 2020 19:08:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0F791B62E; Wed, 7 Oct 2020 19:08:34 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2062.outbound.protection.outlook.com [40.107.21.62]) by dpdk.org (Postfix) with ESMTP id 0B78729AC; Wed, 7 Oct 2020 19:08:32 +0200 (CEST) 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=VWQPGD3DVcChk14QT2LzrOCxJ6rqa9i5RkWUfsdWlSc=; b=lTcVmGZgERayq68oe3GOnA+SKroxb89m94uQ1jZeVrVer5AeqswQqI1nqpbNUpZDFqTDfE8CwLlPEnEIbRZsqm5+s134xb+Wx+fa443HHg1z8ALj5BPI+1QvKq6QZF7zA1bfNPG4cYkXqyiKzu1L4rwmpbtuRcj3s18rksAADKw= Received: from AM5PR0601CA0043.eurprd06.prod.outlook.com (2603:10a6:203:68::29) by AM6PR08MB3509.eurprd08.prod.outlook.com (2603:10a6:20b:4e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Wed, 7 Oct 2020 17:08:29 +0000 Received: from VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:68:cafe::ed) by AM5PR0601CA0043.outlook.office365.com (2603:10a6:203:68::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22 via Frontend Transport; Wed, 7 Oct 2020 17:08:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT039.mail.protection.outlook.com (10.152.19.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23 via Frontend Transport; Wed, 7 Oct 2020 17:08:28 +0000 Received: ("Tessian outbound 34b830c8a0ef:v64"); Wed, 07 Oct 2020 17:08:28 +0000 X-CR-MTA-TID: 64aa7808 Received: from eb1327d494cc.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 96A6303D-2020-4984-BF37-ACABF13CFA23.1; Wed, 07 Oct 2020 17:08:23 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eb1327d494cc.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 07 Oct 2020 17:08:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MjqBVJ2a9i32GNoOOMIBKvrQx91nDLKqLXr3+u+8nIwZ76ai8PjLfHTM2JPvEf2tg80cGHB6XCZDa1B6xWt6dE9dsAmLN3DR8P2fpzrS4C8Rgsaf6C6MVkaSH7qvBO0UKBQuwGJjQqkyykpVeuDyav6tglSsO5W/iQPgXKPUmvU9zNfmKvlineeuvDoZZonbUqHL6hOegYfUy8315m4JL2M6ubQnH9Jrfpejq+v7aWHrKyEwbmTBCVQlIWZv/429NhSBJwofx2hNOmFL8LWJnU6bSrLEZ3I1zyrBeT5tNnLkLMPcbJBPN0t5oe2TQxAwxAiEE72GRO2cxZiELnGuQQ== 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-SenderADCheck; bh=VWQPGD3DVcChk14QT2LzrOCxJ6rqa9i5RkWUfsdWlSc=; b=aKQ6VDSNgKpUkYy4IiyaZKRMfaejVosqdGQtJiMXV40GCG2+QOWMv0jelhjcva+YUQ+Isd7o4Jk2gnSrdFtLRQxKZ8uiYWvnjAcDv5YfaQL/xJomY1UA1MtlQ67s9hVJiaDhEJv/n3M6lNYvpvjH/HTuCRNj731gLF/nWvM7sSSZFAJiDPYm5ZMkCUGlLWQya0x+r2+Zn2TB28GhiQ4qZfwB/kn5PXbfp39rB2c+fjpC1Noul+tph273fPES1S6PWO+0vVtD7zw6AMyUixt6Pkjoql6DW7p1L0eoNgyeD8A5okO0TdSr3Vtm3I/QtuY1OdBc+NYTzuCu4VIAvlPOmA== 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=VWQPGD3DVcChk14QT2LzrOCxJ6rqa9i5RkWUfsdWlSc=; b=lTcVmGZgERayq68oe3GOnA+SKroxb89m94uQ1jZeVrVer5AeqswQqI1nqpbNUpZDFqTDfE8CwLlPEnEIbRZsqm5+s134xb+Wx+fa443HHg1z8ALj5BPI+1QvKq6QZF7zA1bfNPG4cYkXqyiKzu1L4rwmpbtuRcj3s18rksAADKw= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR08MB2646.eurprd08.prod.outlook.com (2603:10a6:6:20::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Wed, 7 Oct 2020 17:08:19 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d%4]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 17:08:19 +0000 From: Honnappa Nagarahalli To: Honnappa Nagarahalli , "dev@dpdk.org" , Phil Yang , "jgrajcia@cisco.com" , "ferruh.yigit@intel.com" CC: nd , "stable@dpdk.org" , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v2 1/8] net/memif: do not update local copy of tail in tx function Thread-Index: AQHWlcosB7VsAUrxuUOJval6E4t0mqmMbLlA Date: Wed, 7 Oct 2020 17:08:19 +0000 Message-ID: References: <20200921192254.20560-1-honnappa.nagarahalli@arm.com> <20200928190334.40624-1-honnappa.nagarahalli@arm.com> In-Reply-To: <20200928190334.40624-1-honnappa.nagarahalli@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 52E56BA90CA31E4B940977757E51AAD6.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.112.90.121] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 22dfff3b-afa3-42c7-aa64-08d86ae39ca5 x-ms-traffictypediagnostic: DB6PR08MB2646:|AM6PR08MB3509: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: xaZIo8QhkFeorWDMIBacme3yV422S5bF65pv31+fzU6jQRWR8mO7B8WNZNFmB6fmj92/4GGEbyA4VeFpTqlIhc5A1zgkv9BQwljHm3NVKModhqKK71nK0nnE703Wmuo5SfapGo1mVN/DGx7MMmPCmvoUHJzEn2IUlnLGNPcWfAvWR4re5eyOLuhTbxyfK7sY7WMEZMTOGvM7AfySqfdUOMsoa3+1IHnDEQnknqd+OdTDWfLrzHazOA7LroBsM3UM6tAHv+DXOVG8wlJzJY8DeNPKWZSWGxowwQ3tolQLLAmtRst8OhCY0gmjudh4DCCS2RlASUWfdXeF2V5wxT+Xlg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(366004)(136003)(39860400002)(186003)(26005)(4326008)(64756008)(478600001)(7696005)(66446008)(52536014)(66946007)(66476007)(76116006)(6506007)(8676002)(53546011)(5660300002)(54906003)(55016002)(9686003)(316002)(110136005)(86362001)(15650500001)(8936002)(83380400001)(71200400001)(66556008)(33656002)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 3uEos059Onoh0mK5SjN4kGaLsNogZb4UE++2jcqn7Sr6gJitUxPiRM8DWz/WmqOpIbXnnYPNnpxfW6cl1N7K/8QD8Pgq5GxpkevAp0dJfV6fnPT709NkdxKMkqGVBRLcDezERcrquuMG1nmBHR0sCeiCH7TU4UY3wDntShmZCTHStFVQPYUs85l7DBxE86jRcUjwVuv0pbEXbuydWf9wVOCzr5fHLjPJVt1q5ESC/LCq8b31d1nzC6xEW6RD58JyX2dRrZaQjMcdIKmCCBaQsujS1pNF58SCrdWUCc9nVHgyL831mRN4x30E5ZjgYgoSuNR8G8xR4kXw8BXcPmYIPdcMd73BgE3qB1qddebXIPpsurzvnl7jc5fNR3rcXzBPz1EdgLcFo9SLopVS2kTUAC+ObIyjxmQOnaaO/tEkS4CjKk6lkIYIhY6CfGCAy25ZlEbQz9Tw4wxubWChgoH9axBlgmnBwY5gKVfEjETQ/Tx+U1MeSXZxgvef0iT2Kn0iIyJnkkBFJtwaFUoc79I5R7zG2c5S6QBL/EzhNr8hPZVAHplww9lz6A857CRQ7kN25pIpjJMetgqpCvWIQGKl3lC+r0tKmy05iZzaxRocHvOraQLh2HukqgZjxDSCTZHg7NZEtKaCR4gp1wOJa09q6g== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2646 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4ed0537f-1a34-40ca-5def-08d86ae3970d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9VHb9ilcD9qEIGyrJNzT4f6iolTDWDillUp8jFdKbA8WMQkdtuBqjmCQOrUf7km3o1UgrijOJuqy/DsTXYtEymAJdjYpRCiEfiJBZTNEAeNUHcdNTcvVr9i+/Q5yVp0Y6Gjn03BMExewYQZt72e+kaD2wVnYqJUyj4yYdRBJToUbkZDH83y0EO5V5vr+gA4ReOBPlqksk+xTY44TrEn/j75IwoaTJBqvQCWWA/wV7fU9oDbmo6Yak5ehm78wt97IJ0kwvWRreq3CQ1PUaFlG/FqBKR7CbDglGQdwhInfvaVG3pIGaw1mjFp0VE1GAEn3seZlcRQe/Cx2wJQjBDfT1ocnzesyle7jTg23FlnotiEaIpAnhKxzC+TwKu5AXFpMMMLYxS5XPsLjvHPM9mEXHQ== 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:(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966005)(53546011)(6506007)(110136005)(54906003)(2906002)(7696005)(8936002)(15650500001)(450100002)(8676002)(4326008)(336012)(26005)(33656002)(478600001)(316002)(36906005)(186003)(55016002)(9686003)(81166007)(356005)(70586007)(70206006)(83380400001)(47076004)(82740400003)(5660300002)(86362001)(82310400003)(52536014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 17:08:28.9689 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22dfff3b-afa3-42c7-aa64-08d86ae39ca5 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: VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3509 Subject: Re: [dpdk-dev] [PATCH v2 1/8] net/memif: do not update local copy of tail in tx function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Jakub, Appreciate if you could review this series and provide any comments you mi= ght have. Thank you, Honnappa > -----Original Message----- > From: Honnappa Nagarahalli > Sent: Monday, September 28, 2020 2:03 PM > To: dev@dpdk.org; Honnappa Nagarahalli ; > Phil Yang ; jgrajcia@cisco.com; ferruh.yigit@intel.com > Cc: nd ; stable@dpdk.org > Subject: [PATCH v2 1/8] net/memif: do not update local copy of tail in tx > function >=20 > In the case of S2M queues, the receiver synchronizes with the sender (i.e= . > informs of the packets it has received) using ring->tail. > Hence, the sender does not need to update last_tail. >=20 > In the case of M2S queues, the receiver uses last_tail to keep track of t= he > descriptors it has received. The sender is not required to update the las= t_tail. > Updating the last_tail makes it a shared variable between the transmitter= and > receiver affecting the performance. >=20 > Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") > Cc: jgrajcia@cisco.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Phil Yang > Reviewed-by: Ruifeng Wang > --- > drivers/net/memif/rte_eth_memif.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/memif/rte_eth_memif.c > b/drivers/net/memif/rte_eth_memif.c > index a19c0f3e6..130099f2e 100644 > --- a/drivers/net/memif/rte_eth_memif.c > +++ b/drivers/net/memif/rte_eth_memif.c > @@ -580,12 +580,10 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts) > ring_size =3D 1 << mq->log2_ring_size; > mask =3D ring_size - 1; >=20 > - n_free =3D __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE) - mq- > >last_tail; > - mq->last_tail +=3D n_free; > - > if (type =3D=3D MEMIF_RING_S2M) { > slot =3D __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE); > - n_free =3D ring_size - slot + mq->last_tail; > + n_free =3D ring_size - slot + > + __atomic_load_n(&ring->tail, > __ATOMIC_ACQUIRE); > } else { > slot =3D __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE); > n_free =3D __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE) > - slot; > -- > 2.17.1