Received: by 10.213.65.68 with SMTP id h4csp1313986imn; Thu, 29 Mar 2018 02:18:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+FeAOIKl8miqsNYclg4gy1U08LwrfclfY1KLYZfhcOb6QLdPXSdCUI9lTpJAjl5M8RmJjC X-Received: by 2002:a17:902:1006:: with SMTP id b6-v6mr7537293pla.252.1522315132540; Thu, 29 Mar 2018 02:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522315132; cv=none; d=google.com; s=arc-20160816; b=ABNQc0mBtsq6ZWuFVARQXRkLOmtMbwsghG+jRfRZw136Q4tnVVcc8on2VfUpBFqFQD KPfs0cqTSqPK6agoPCSTIPk6mO4mMAIjWnhIaYDFaLnZHjP0shJASvVQBuWxcB52fAmX RxKaMWejvhGEysiDh2Eg7Pc2sJjVHblwjQ8yzCThYeJpM7nsEU/LKK9DcejQCrLMWw20 ELD18tQ/2fziGVR18XO7r5ngkdr3eqTm6BwPSP09ax1fEVocqWWb73CkZCETB0NYEdvk J/ObQWn3gFymb8K4PQUrulCWhj4VhrN0kE9KQtoHJS7leVXIeblT1ynoAT+WEBoo4VPJ ouaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=aY5t1iptM/1hW6XpQGWepBH02Aqw6u+n+CaH2OSbF78=; b=oUZ19cqpKZhilkwcRzrJnyIE4U5He9+drPx5CeD/uQKgb7ahVsFzxttRGNrysM0x5K kloAUQJhnpMgcD9brs2QOIajFqg1iXMPYoOZOWvM0zOv08t7rDVGDUPxtaROgaCRk+D9 yO30K5mNnM4EH6xqIDptsCNylMzmGTboJDx2isbGIh2Kcku3cNrJdY9NNG9fVFrKn0yf hRaOAf0tqjb966WNJkDZqDizniOKPOcQoDc3KDHiC7E4NCg/ZJl/Mp0QLxM+ME1C2rt+ KGmxzAmOYVIkfFlDVDjSKToZf6ZYcvETbO0iMugDYIhxK3E/IVxlZEUseNpalgpZyaTv JJGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=boUVQfoh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si4078238pff.312.2018.03.29.02.18.37; Thu, 29 Mar 2018 02:18:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=boUVQfoh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751227AbeC2JRr (ORCPT + 99 others); Thu, 29 Mar 2018 05:17:47 -0400 Received: from mail-bl2nam02on0042.outbound.protection.outlook.com ([104.47.38.42]:3325 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750716AbeC2JRp (ORCPT ); Thu, 29 Mar 2018 05:17:45 -0400 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=aY5t1iptM/1hW6XpQGWepBH02Aqw6u+n+CaH2OSbF78=; b=boUVQfohsvVuKwHcXFhswFyKt5vz5hYJ3KkyjGIZ1cTpbV5gJTNpcUoc6AAvaq2fUNBbtd0vD8K4AcQEegE+i52uzyEdkxx1IUTNM5I7inZOWyQxcP/r64AAC8+F+F5blTy5Gg+GnIGBjQ8KQ84vrufRrAvqR02eFOlEPfDW9Hc= Received: from CY1PR0701MB1337.namprd07.prod.outlook.com (10.160.150.140) by CY1PR0701MB1744.namprd07.prod.outlook.com (10.163.21.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Thu, 29 Mar 2018 09:17:43 +0000 Received: from CY1PR0701MB1337.namprd07.prod.outlook.com ([fe80::e188:be7c:6fea:7575]) by CY1PR0701MB1337.namprd07.prod.outlook.com ([fe80::e188:be7c:6fea:7575%14]) with mapi id 15.20.0609.012; Thu, 29 Mar 2018 09:17:43 +0000 From: "Elior, Ariel" To: Sinan Kaya , "netdev@vger.kernel.org" , "timur@codeaurora.org" , "sulrich@codeaurora.org" CC: "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Dept-Eng Everest Linux L2 , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v7 3/7] bnx2x: Replace doorbell barrier() with wmb() Thread-Topic: [PATCH v7 3/7] bnx2x: Replace doorbell barrier() with wmb() Thread-Index: AQHTxEcZZxtoEOu+xkGnixx3V0bVgaPm8sKA Date: Thu, 29 Mar 2018 09:17:43 +0000 Message-ID: References: <1521988761-30344-1-git-send-email-okaya@codeaurora.org> <1521988761-30344-4-git-send-email-okaya@codeaurora.org> In-Reply-To: <1521988761-30344-4-git-send-email-okaya@codeaurora.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ariel.Elior@cavium.com; x-originating-ip: [31.168.140.228] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR0701MB1744;7:pDSza6keV7wt4gZH/MQgw6w2GFwWbtBXVJ4Ydn6rEeATGRzXOAhAManM25AyMbqegpzBVZSAGKaEYOwBivPS+e9Ea4Gy60DJf7OpsMaK4tgGhsGW7EuZGrgmCdou+mqxv6FThYTNKaj4eSUNfUUqrFhYLlqysXmeS6fG59pqZunHO3k6TQSozKdRGxi+GhzIC+oKRwOcwJuJTwKrm3Ttmp39JOf0k1/vKYcybxe3F/OvJz3BD1MuObruHl0rD2oX x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: d067abba-bb2b-4fc8-1e61-08d59555ed75 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY1PR0701MB1744; x-ms-traffictypediagnostic: CY1PR0701MB1744: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(190756311086443)(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CY1PR0701MB1744;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1744; x-forefront-prvs: 0626C21B10 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39380400002)(376002)(396003)(346002)(39860400002)(366004)(189003)(199004)(316002)(229853002)(446003)(81156014)(305945005)(2501003)(5660300001)(8676002)(74316002)(33656002)(66066001)(26005)(54906003)(105586002)(106356001)(81166006)(110136005)(68736007)(486005)(11346002)(186003)(486005)(2900100001)(97736004)(7736002)(102836004)(6116002)(9686003)(6436002)(5250100002)(4326008)(3280700002)(6246003)(2906002)(53936002)(72206003)(99286004)(14454004)(76176011)(59450400001)(25786009)(3660700001)(6506007)(476003)(478600001)(7696005)(8936002)(86362001)(3846002)(2201001)(55016002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1744;H:CY1PR0701MB1337.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wB1y68OnmobmOnfyLn4BtE3H0r0oI2Glp7lAX9g87avTj9gAdPNVFukwDZ6/37hLikliLxBNPRoN5YzvyCJrC9016g8+RQhAFt5oja4oeipP32/sYZaptIjItI69Nv60nXmh/tcrZyQZqh7yQi2gnTDIOckhHLQAG2WqWKfFWMY/D5/NcxLc15itlOFpJbqaS2limVytx07+kmhNOqLAOQq+jvAsIsZmv8k1/tzvtPvytZLnVT7HJfzWLXO5SkPmgMLufNioVoe6ugFSvEc3bTmwA8g24qqhYlveNNZHQxthwzviwC3+WlrzA0HZstTvVIJn8uUQRW/gwO/KHpFuHg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: d067abba-bb2b-4fc8-1e61-08d59555ed75 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2018 09:17:43.0490 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1744 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Subject: [PATCH v7 3/7] bnx2x: Replace doorbell barrier() with wmb() >=20 > barrier() doesn't guarantee memory writes to be observed by the hardware = on > all architectures. barrier() only tells compiler not to move this code > with respect to other read/writes. >=20 > If memory write needs to be observed by the HW, wmb() is the right choice= . The wmb() is there (a couple of lines above). Your modification adds an unnecessary fence which would hurt high pps scenarios. The memory writes which the HW needs to observe are the buffer descriptors, not the producer update message. The producer is written to the HW, and exists on the stack. The barrier() is there to prevent the compiler from mixing th= e order of the prod update message preparation and writing it to the host. A possible alternative would be to move the existing wmb() to where the barrier() is, achieving both goals, although in the existing design eac= h barrier has a distinct purpose. The comment location is misleading, though. Thanks, Ariel