From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0062.outbound.protection.outlook.com [104.47.40.62]) by dpdk.org (Postfix) with ESMTP id 554DB592C for ; Fri, 13 Jan 2017 09:31:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wwqwcP8CD1ZvqK7jVEElx4yy2cJQtdMIR5eUWVCmxtg=; b=QlOjNoeFqekIsV7dRlqPWzLPq+919daHmQeTs957mJR2ApHxvQM9lIHxEqa7LWbSvRN91UVrvpOeI1PnYuZmPgaHXBfcji7J8jwniVSuKPJJuFbXkQEtyv6Ajzl2ZhHTZglhcGLHzEaMxuNDVc4YYrK/0N+k5Km7z9+Opr/PZQE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (171.61.97.114) by BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Fri, 13 Jan 2017 08:31:07 +0000 Date: Fri, 13 Jan 2017 14:00:54 +0530 From: Jerin Jacob To: Ferruh Yigit CC: , , , , , , , Stephen Hurd , Ajit Khaparde Message-ID: <20170113083052.GA19741@localhost.localdomain> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-17-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [171.61.97.114] X-ClientProxiedBy: BMXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.174.214.141) To BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) X-MS-Office365-Filtering-Correlation-Id: 54ff482e-09bb-4290-f297-08d43b8e87e9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 3:T9NFU+LRHC7LY0rDsO0Nb/A7FE6sxQQ9RpeuMH0FSC84fUnM1rUpwtQUyFpAUE9WKkGLgUvzTQ3D/W9xBr/GjuWdx01wBSlVUS4pmA6Cb1vN+FJJPcvjXuBEr0rcteXoS9+NR/FDUfMgnTercABJTpPrK647KqZCFSdAki7bXMcsiAuzM0HtDb/yr1CdctzTilc2iCFwomMKNURMfolVzNq0CzrgnfBMhg4w4ePBE+TUurNMmTyUzRuB2JVHWX3fnpeElIHqM2km8D5XJXBnYQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 25:VagoNuSgsUSxWUgDEa3onHyIyhxwRvQKSgz9Fbh5FCikFuYqSFNfRycKXQkUQseVG5kQw+ENcJpjrRPX7/eDjikjNdd9q1BIU9Ywxm8IyAHv8SfAZjV9zSre+rvZ5HK/HhRdULL0I7RiE9xftkH1KxKdx0TNI4+opHjbKArddSBO8yXfAjuVcqxrYY3JD7jSzWAyywqqlmh8wR9BU/kAPRkedc2PFtPH+ZulxxqXZch2rEU0GooK/TEKXI5li5NLdpOfQYpZwHOjlHmFbKx5E+rPEN4pCl9c7dVOj+E1KOT/cy2DNVJL3SH8u6AkuelJZHdVnjwWdKZ+WH0TznDLBQmHcDKZ6vZm9YwsFow0/qCoRFTgXm8YmItpAwArOC+g7f+b2eHQG0wG/pG4qKXJWhnMS/gTzMJ3vnTIMLc0kfHQen3oXUqVqK6DOnq4iAYvMQuI8jpOH3QonowTEE7XGYP++M89qc4kCOqiDSh+FJfcEXqsCq/KRXmj7LqQPbyzqa+q7DqqB/1LYuEWXP4T+cCwg9OooQIphXlD+gYTUYdy7nySdDtG1pk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Qg4yNiniKUctg9QyK3OBEg2S6/qRJNf2wdnYrXMSo3QODJP6yGrE6axl8aI9dcSsuSw4X2hPMqU01eb322uv85AZNa/2Elvx0F/sKYuLFFJrOfGA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:BY1PR0701MB1721; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 4:8hG3GdrUPclWnHh5laX6Vj1C0xdKpzUqOXO+9upDp4XW2SPrdt7qdjeh9JlWxd7RPWUP8kZA8fVWUBDO8FWwcaD6MChRZCR2VhtNAnZCFlxMm/KRnQSN4L+70FfTcpSw56URfa5kdhrv46HoEUCtszZ713Gf25vKAYsl0T/NiwjTuXWxIV9vDpXDmfp7expnwPswm2nRLxleLWM2Cx255MHe9fB6qPFpCGXR3ovg10/rDT/CLUv4UXJx0qqYWct2/Guoa2+j0stor8wfqkW6TVYNL452LIzcXJ2WOtUU94UTm83/zKJzyjr3aLSVdjlGBStWDRGDUqfT7FqtLS2bCdV/Igkasgo6KxQkMrFzLIZu/orrTePoUKXFMybDyhAf8I8ZAWTZMxbXAmtk7flM1vX5DU20D7BZKMJaTBv50jGsWfoNL9vRZSrsP7x0IEeq1y+Awia57rsP29qMGOO0fAgnnF2vOBKYSsoNLNiBygkOXcfdUeqrYoFtrOZqtJUpvrntDAycFB+J2hAPhL2DqHGD7aH+EAKx6hZyp33pRkDtw7z4reGeELTLM7Yjc1uQhZ8pFDUbQrolix6Dr1c0Sw== X-Forefront-PRVS: 018632C080 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(199003)(24454002)(377454003)(189002)(3846002)(54906002)(6116002)(92566002)(55016002)(46406003)(6506006)(25786008)(38730400001)(229853002)(50466002)(4326007)(2906002)(93886004)(47776003)(83506001)(68736007)(189998001)(33656002)(105586002)(50986999)(305945005)(42186005)(106356001)(54356999)(66066001)(8676002)(5660300001)(76176999)(97756001)(42882006)(2950100002)(81156014)(61506002)(6916009)(110136003)(7736002)(23726003)(81166006)(9686003)(97736004)(101416001)(6666003)(4001350100001)(1076002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1721; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1721; 23:KBnoHiipe1x+bXkiDfut45LLTHYqJf7VlzOrHDk?= =?us-ascii?Q?/i9SQmEmqN33qEqhE/SoBCEEKFmeQZVsV9uGAp+ZwnDm++RgzLFOZ7X67F4p?= =?us-ascii?Q?xg/W+OX6e2l18VoTor3O2Gi4Y1g6qgD3jgGSbuehfRTWA6R/1zhoGsXHN5Q8?= =?us-ascii?Q?SkKwrhZzd3PfIqtwjTcOfdgRz8Ue7FxkaIUujlixM2ddsk1CYID2LAYhLhm7?= =?us-ascii?Q?rSp2gvSBZoZjqKnso3iKXoC9hjehpGXXHDJn6ZYWm4adf2KNk8Qmn9j+Vh70?= =?us-ascii?Q?goLiYhDXotyxwRObu5C9rePHcEclNYYg32HEie2oqO/BXKnNlAY8O3dKybX+?= =?us-ascii?Q?9h29TMyel+eOkpBM44GKVyTkwpePxFhtWI6c185izRBLxxHHGObWf3BUoMuy?= =?us-ascii?Q?rWfT1Hi7dVIrPDFD/qMC2HC1YzE8SVEzE3aZ7HX/q/2XroIYY/b24RnfFFIe?= =?us-ascii?Q?1Wnq7MXWhZUT73czHgLz5Nkv+6lAn+rhCBIEnbOrINEiuY6WNfnTPRMtAOnX?= =?us-ascii?Q?eIeOvrpKhvKS+e8hPG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xhOPeUNYbh5/GGrGVIxCjYjRr3v6/MOqEDut8GKv3eMOW/N0OQSqlRir0gRkERUdciNZVLxzRLeUJOwjTgFNAP8eK7arMPc7EcUOJpuNcXWu4F0MNKQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 08:31:07.6359 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1721 Subject: Re: [dpdk-dev] [PATCH v3 16/29] net/bnxt: use eal I/O device memory read/write API 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: , X-List-Received-Date: Fri, 13 Jan 2017 08:31:14 -0000 On Thu, Jan 12, 2017 at 07:10:24PM +0000, Ferruh Yigit wrote: Thanks Ferruh for the review. > On 1/12/2017 9:17 AM, Jerin Jacob wrote: > <...> > > #define B_CP_DB_REARM(cpr, raw_cons) \ > > - (*(uint32_t *)((cpr)->cp_doorbell) = (DB_CP_REARM_FLAGS | \ > > - RING_CMP(cpr->cp_ring_struct, raw_cons))) > > + rte_write32((DB_CP_REARM_FLAGS | \ > > Just asking, can this be rte_write32_relaxed() since there is explicit > memory barrier defined for B_CP_DIS_DB but not for here? Here is the logic followed across the driver change: 1) If the top level code is in the pattern like "explicit barrier" and then io write. Then second the io write operation can be relaxed. 2) If the code runs in slow path, To make patch clean and scope limited, use only nonrelaxed versions. > > > + RING_CMP(((cpr)->cp_ring_struct), raw_cons)), \ > > + ((cpr)->cp_doorbell)) > > > > #define B_CP_DIS_DB(cpr, raw_cons) \ > > - rte_smp_wmb(); \ > > - (*(uint32_t *)((cpr)->cp_doorbell) = (DB_CP_FLAGS | \ > > - RING_CMP(cpr->cp_ring_struct, raw_cons))) > > + rte_write32((DB_CP_FLAGS | \ > > + RING_CMP(((cpr)->cp_ring_struct), raw_cons)), \ > > + ((cpr)->cp_doorbell)) > > > > <...> > > > @@ -80,11 +82,12 @@ static int bnxt_hwrm_send_message_locked(struct bnxt *bp, void *msg, > > for (; i < bp->max_req_len; i += 4) { > > bar = (uint8_t *)bp->bar0 + i; > > *(volatile uint32_t *)bar = 0; > > Should this line be removed? Yes. Will be fixed in next revision. > > > + rte_write32(0, bar); > > } > > > > /* Ring channel doorbell */ > > bar = (uint8_t *)bp->bar0 + 0x100; > > - *(volatile uint32_t *)bar = 1; > > + rte_write32(1, bar); > > > > /* Poll for the valid bit */ > > for (i = 0; i < HWRM_CMD_TIMEOUT; i++) { > <...>