From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id ED50EA0546;
	Fri, 14 Feb 2020 09:05:05 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 1B9D61BE80;
	Fri, 14 Feb 2020 09:05:05 +0100 (CET)
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-eopbgr80045.outbound.protection.outlook.com [40.107.8.45])
 by dpdk.org (Postfix) with ESMTP id C08232B96
 for <dev@dpdk.org>; Fri, 14 Feb 2020 09:05:02 +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=JRuqIrdRhWqa6eJj9vYl8xAAmtgzjJojbS9gRXN3toQ=;
 b=WSRd5v6/0hIX61fdUcuTZFeIDM03PPxZQQGLpexP5HJl7YAxQwhmh45fNh0qkp7X6cuGNshC0ZdMpx972VHjgDXBNqLL3RX8Yg8ECqWhiSuiBPRwtUg/TlPAq3L39I9tz6+6IDHdKpyDC73WbtwpiWY7ObscymBbTeUc3gRSeuQ=
Received: from VE1PR08CA0026.eurprd08.prod.outlook.com (2603:10a6:803:104::39)
 by DB6PR0802MB2325.eurprd08.prod.outlook.com (2603:10a6:4:85::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Fri, 14 Feb
 2020 08:05:00 +0000
Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com
 (2a01:111:f400:7e0a::208) by VE1PR08CA0026.outlook.office365.com
 (2603:10a6:803:104::39) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.24 via Frontend
 Transport; Fri, 14 Feb 2020 08:05:00 +0000
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=bestguesspass 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
 DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with
 Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2665.18 via Frontend Transport; Fri, 14 Feb 2020 08:05:00 +0000
Received: ("Tessian outbound efdea641ed36:v42");
 Fri, 14 Feb 2020 08:05:00 +0000
X-CR-MTA-TID: 64aa7808
Received: from 7d29cbd51d31.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B44E8C1A-C000-4897-8AE5-0882995196CD.1; 
 Fri, 14 Feb 2020 08:04:55 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7d29cbd51d31.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 14 Feb 2020 08:04:55 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UKUSXkv6lPxvcIGu2HcvEtyh+3vLnh+D+tpka65HfEM/7nzX3TpC4Ahgb/qrgbrdeyGQGmKzCheyYetuxl3E9KrD0oXt87rfwKMwsgi5LcnVa/vvth6AqPAYYeujQ9WY8bhi9lxZSW4UVcOBWnJQ6eMfCPirkF3k/XUeOr8yZ0yy1x+Z/5Dz4VL2t7XWck6q+6QIyeRBKoXclqnLTNiEnANXWdH8nCIA2uf7f6qcVyg9112Yl60mgpX86uj9eh0LGIdFa5ftzqCbS7fWHhGqi+DJ5APDY6TBEOiaTbjCO+42WhOsF8TZ8wJCYkgAAVJiMipCv8zGNvI3GJvTCPDb4w==
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=JRuqIrdRhWqa6eJj9vYl8xAAmtgzjJojbS9gRXN3toQ=;
 b=gBlhPzQo0zwv5wgAVzYbBnU28fHGpYybzkwn8ETDLEh3GdB1dGHCZcIHPBOxvFw0KoMUTOZ+9Q5tqVrUnFbbd05NuoN30vC6F5G2SBqrUfeNYlXDdIDkjHgFFZYdjWULzwcUVAX2LpRH9IbM+v+rwuIiFNsBFJfTCy0hdR34ISM2lGJWG6iQ+Qrf56LxRG1SvRm4AtZObjkFI1hRUBCShWurIucKCmFJILKu5jL38+gtxGWORDjLgI733uODYF4/Xjo6+U5tEkeAPCJIEnce6E6Js4GwtaqdLfBqNXUPE2/CHxH6htNcy4XHP6i4vilg7LwhY5wzihHSKf/7Db0FWg==
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=JRuqIrdRhWqa6eJj9vYl8xAAmtgzjJojbS9gRXN3toQ=;
 b=WSRd5v6/0hIX61fdUcuTZFeIDM03PPxZQQGLpexP5HJl7YAxQwhmh45fNh0qkp7X6cuGNshC0ZdMpx972VHjgDXBNqLL3RX8Yg8ECqWhiSuiBPRwtUg/TlPAq3L39I9tz6+6IDHdKpyDC73WbtwpiWY7ObscymBbTeUc3gRSeuQ=
Received: from VI1PR08MB5376.eurprd08.prod.outlook.com (10.255.196.79) by
 VI1PR08MB3759.eurprd08.prod.outlook.com (20.178.14.90) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2729.24; Fri, 14 Feb 2020 08:04:53 +0000
Received: from VI1PR08MB5376.eurprd08.prod.outlook.com
 ([fe80::e080:9698:5896:6837]) by VI1PR08MB5376.eurprd08.prod.outlook.com
 ([fe80::e080:9698:5896:6837%5]) with mapi id 15.20.2729.025; Fri, 14 Feb 2020
 08:04:53 +0000
From: Gavin Hu <Gavin.Hu@arm.com>
To: "dev@dpdk.org" <dev@dpdk.org>, "jerinj@marvell.com" <jerinj@marvell.com>
CC: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
 "david.marchand@redhat.com" <david.marchand@redhat.com>, Joyce Kong
 <Joyce.Kong@arm.com>, nd <nd@arm.com>, Phil Yang <Phil.Yang@arm.com>, Ruifeng
 Wang <Ruifeng.Wang@arm.com>, Steve Capper <Steve.Capper@arm.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>, "xiaolong.ye@intel.com"
 <xiaolong.ye@intel.com>, nd <nd@arm.com>
Thread-Topic: Re: [dpdk-dev] [PATCH v4] net/i40e: relaxed barrier in the tx
 fastpath
Thread-Index: AdXjDB7Sgrm0hMzjQsOK1Utl7QugDQAAK9dA
Date: Fri, 14 Feb 2020 08:04:52 +0000
Message-ID: <VI1PR08MB5376F47AEFD8BFB2C2D866C38F150@VI1PR08MB5376.eurprd08.prod.outlook.com>
References: <VI1PR08MB5376173EB8A8A58BC93CD2398F150@VI1PR08MB5376.eurprd08.prod.outlook.com>
In-Reply-To: <VI1PR08MB5376173EB8A8A58BC93CD2398F150@VI1PR08MB5376.eurprd08.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ts-tracking-id: 0502ffda-21e0-4dd2-a193-72ec8cb78add.0
x-checkrecipientchecked: true
Authentication-Results-Original: spf=none (sender IP is )
 smtp.mailfrom=Gavin.Hu@arm.com; 
x-originating-ip: [113.29.88.7]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: 71d46bd3-b25f-43de-9f02-08d7b12496f9
X-MS-TrafficTypeDiagnostic: VI1PR08MB3759:|VI1PR08MB3759:|DB6PR0802MB2325:
x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr
x-ms-exchange-transport-forked: True
X-Microsoft-Antispam-PRVS: <DB6PR0802MB232504A60719A71E157F8FCC8F150@DB6PR0802MB2325.eurprd08.prod.outlook.com>
x-checkrecipientrouted: true
nodisclaimer: true
x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882;
x-forefront-prvs: 03137AC81E
X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;
 SFS:(10009020)(4636009)(136003)(376002)(396003)(366004)(39860400002)(346002)(189003)(199004)(6506007)(52536014)(76116006)(316002)(66946007)(66446008)(8676002)(33656002)(66476007)(66556008)(55236004)(81166006)(8936002)(53546011)(110136005)(64756008)(54906003)(81156014)(5660300002)(7696005)(26005)(966005)(2906002)(9686003)(478600001)(86362001)(71200400001)(4326008)(186003)(55016002)(2940100002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3759;
 H:VI1PR08MB5376.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; MX:1; A:1; 
received-spf: None (protection.outlook.com: arm.com does not designate
 permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: Uxj+ghay/x9h+XPPE+CmzgplPmXrRTiuuaROl4Hwnmxql5Qnmj9emxTkUMTt+XCrYvDfg+aIWxNNc4KrgbRpXfMGJR5uVx3n8nsoHDaYfpX9AT105O3u4iWg/j9nhzcFY+6P04QvQYNQNFZMXkRdXGqWcdZJIanr3duy49xsoyqokDKXNNYjOXe/gAVRjH4WRwxfAOET+FGSDDS+X950BXL6FaI1ieTTlvjnqIJ3rf66eqLPXRHT0KzEyNEEPlkF3vAQOUDpX+974QEFj3+CaeLkxOFr4/sxS4fI0s9E6/0UkXCr/vrEkmCopAXnMBHx+E9i74TxfUZ97RDWopgQdp6QN4eUVn9CI3SbB+4riyWLPXlVldyrJvgpAExBoSE1TODT+YpWXKci9meLZ9kKF/10eWO2da0XJM9K+rTbMyA9S8+PDB5ywf7M6rpCigeG/AcM8yKbZlop4mcVt/BDDu3DPFXqy+pFXD19AhogVBXpNen6MxzVlREmf0UWkyXNbRVfismjQWNYVnH+26ETfA==
x-ms-exchange-antispam-messagedata: t4rJoUzAdDPidn1j4YpaOSpb1sJ524wX3xiPGF6Hd36OJczVQSWHIFh6cPblGlqgpB9IY9+JDRIPC0+A696mfz3Kq8fblo6HMVHaOeALMpJ4ozE+mUrTuv0QGs+JadsmDzzYY4mZU8I/7HeKehi4qw==
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3759
Original-Authentication-Results: spf=none (sender IP is )
 smtp.mailfrom=Gavin.Hu@arm.com; 
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE;
 EFV:NLI; SFV:NSPM;
 SFS:(10009020)(4636009)(39860400002)(396003)(136003)(376002)(346002)(189003)(199004)(478600001)(33656002)(55016002)(86362001)(26826003)(2940100002)(70586007)(966005)(9686003)(53546011)(70206006)(26005)(336012)(4326008)(6506007)(186003)(5660300002)(110136005)(2906002)(54906003)(316002)(81156014)(81166006)(356004)(8676002)(7696005)(52536014)(8936002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2325;
 H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en;
 PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; 
X-MS-Office365-Filtering-Correlation-Id-Prvs: 54c06bb5-e1d6-4402-2d59-08d7b1249279
X-Forefront-PRVS: 03137AC81E
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: qrUGj1ir1JYKa6tXBYa/t2fvGx1dxplLaghLgNSd1msvhCUXq7ov07zP2udgm2LE7aVBOM5zM36VFjf9ZUJg833l8r2Z1uenrXCexJTdH3zTFBxmN8h9SnItd/OII5uGbDQXzZF3ePqCtYtatQbvFm3l4nhi2fhntXqWOtkDPiYEi4L+1u+4DtxelVXP8rVlV0ACSYlanRytmZgItnHPcmiBd25JphRvrZN/2Y4+Fa0XNYk34LhTmeTSE7UQjquCFd65zbN2JxV7W/JhREmXWkO4CAs0T/zbDcPQjny9S/qXZIGvG+t8VNjzn9OiAhNShwAPQclm8ewsGP1BdUj/MRf3Pj5jVMy6VIXpTbCNNNGQSglwGNEmDNc+SkDKCxTjYRcBWmuVzorpjVjL1/uFznUwBErafCEy2wguwhCqgrNvmMqtrYkbFkrfbL0sCHccNEMQMHBehkReK4nFM3kdsVN5CfrnhpjEzcYvi1d0sArdduh/IV9WoU8+wun2uy3DKdKzoQh71qg8t8QiHpPPEw==
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 08:05:00.5404 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 71d46bd3-b25f-43de-9f02-08d7b12496f9
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-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2325
Subject: Re: [dpdk-dev] [PATCH v4] net/i40e: relaxed barrier in the tx
 fastpath
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Jerin,

Could you help review this patch?  We discussed a lot on this topic and I t=
hink we agreed already to relax the barrier only on the fast path.

Best Regards,
Gavin


> -----Original Message-----
> From: Gavin Hu <Gavin.Hu@arm.com>
> Sent: Friday, February 14, 2020 3:58 PM
> To: Gavin Hu <Gavin.Hu@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v4] net/i40e: relaxed barrier in the tx
> fastpath
>=20
> To keep ordering of mixed accesses, rte_cio is sufficient.
> The rte_io barrier inside the I40E_PCI_REG_WRITE is overkill.[1]
>=20
> [1] http://inbox.dpdk.org/dev/CALBAE1M-ezVWCjqCZDBw+MMDEC4O9
> qf0Kpn89EMdGDajepKoZQ@mail.gmail.com
>=20
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> Cc: stable@dpdk.org
>=20
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> ---
> V4:
> - add the Fixes tag and CC stable <Xiaolong Ye>
> V3:
> - optimize the barriers in the fast path only, leave as it is for the
>   barriers in the slow path and control path <jerin>
> - drop the virtio patches from the list as they are in the control path
> - it makes more sense to relax the barrier in the fast path, at the PMD l=
evel.
>   relaxing the fundamental rte_io_x barriers APIs requires scrutinization=
s for
>   each PMDs which use the barriers directly or indirectly.
> V2:
> - remove virtio_pci_read/write64 APIs definitions, they are not needed an=
d
> generate compiling errors like " error: unused function 'virtio_pci_write=
64' [-
> Werror,-Wunused-function]"
> - update the reference link to kernel source code
> ---
>  drivers/net/i40e/i40e_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>=20
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index fd1ae80da..8c0f7cc67 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -1248,7 +1248,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf
> **tx_pkts, uint16_t nb_pkts)
>     (unsigned) txq->port_id, (unsigned) txq->queue_id,
>     (unsigned) tx_id, (unsigned) nb_tx);
>=20
> -I40E_PCI_REG_WRITE(txq->qtx_tail, tx_id);
> +rte_cio_wmb();
> +I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, tx_id);
>  txq->tx_tail =3D tx_id;
>=20
>  return nb_tx;
> --
> 2.17.1
>=20