From patchwork Tue Oct 13 16:25:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 317725 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp5720524ilm; Tue, 13 Oct 2020 09:26:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwccgOSPnmjhxgrKbCWCYlYZXhrpfxRRBSuqBMJft91XcIiWZM+jA2omPFjW/KsjwswXtHK X-Received: by 2002:a17:906:647:: with SMTP id t7mr570846ejb.428.1602606366783; Tue, 13 Oct 2020 09:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602606366; cv=none; d=google.com; s=arc-20160816; b=kJwGEonS4gdObnXMVHqtTEd19u/DtTW6Nv/PrsAT5jJ4wvwEBZtrXR5ojQ05VHxTN/ aF5SbQfcfzG0HmDB+02PheANMwjjggdxnqC5DDMVioJqAM8o6135o3I0jlZg+VzromvF w249e4IXVfqQcHWfrUqZTgDxw6ydnB5D+EHkc9+iih0Em/a/kajiCIxgDHELTEMFZm2b e3kXi4J/juZ8FR5/Kjnh7zNGfMqPvCVfBrAg6QMwu9biDAza/rcronZKQrIjjbiQ37Yp 4qYZ49y24MN0b4RnsfjKVWG+vglJX4fUrd9FbZEIpIhQ2QDzM8EM2NcC2A4YC5ROpiZ/ RNmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=nZLbY/JXl1eYatcQj9Xn4X+vGWOBoRYOyj+qaIXhn9U=; b=X7SflX3smI/3YtyhV5OcOQ0XH5rJTsZ7wSwE7jwSBVO5WUdP6Rz4JByN2URWy3bvRU sfhoekiOBVyzna24rXNGIvl+uUevQ0CeVLyk5TnNLDJUKTqlgyuT5jlWOk02wzHauLjW LdexnSdAGXohtCZErkUacj/ACAI3fhXkYLfHa3w2Jo8sQgoD5me7xgtdmdXIeKuJG8GC D3ZZVP90f/6/HOHXiHZJKH+fRIlP7K50hrXs/NP1EJKlIzLbfiBi0ZJdNqqw5F0OkmP5 MwmqyAntFO9dQ9M9a6mJGV1GijcYqV8hjuEE571/2qCoNEOxJNu84iasf4o1NKlWkXAm BhxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id a25si120144edx.310.2020.10.13.09.26.06; Tue, 13 Oct 2020 09:26:06 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D07F1DA84; Tue, 13 Oct 2020 18:26:00 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 9F54D1DA84 for ; Tue, 13 Oct 2020 18:25:57 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E8BCC31B; Tue, 13 Oct 2020 09:25:55 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D53393F66B; Tue, 13 Oct 2020 09:25:55 -0700 (PDT) From: Honnappa Nagarahalli To: dev@dpdk.org, honnappa.nagarahalli@arm.com, phil.yang@arm.com, thomas@monjalon.net, arybchenko@solarflare.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, jerinj@marvell.com, tgw_team@tencent.com Cc: abhinandan.gujjar@intel.com, nd@arm.com Date: Tue, 13 Oct 2020 11:25:36 -0500 Message-Id: <20201013162537.24029-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002000711.41511-1-honnappa.nagarahalli@arm.com> References: <20201002000711.41511-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v2 1/2] lib/ethdev: replace full barrier with relaxed barrier 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" From: Phil Yang While registering the call back functions full write barrier can be replaced with one-way write barrier. Signed-off-by: Phil Yang Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang Acked-by: Konstantin Ananyev --- v2 - no change lib/librte_ethdev/rte_ethdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 7858ad5f1..59a41c07f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -4527,8 +4526,12 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_spinlock_lock(&rte_eth_rx_cb_lock); /* Add the callbacks at first position */ cb->next = rte_eth_devices[port_id].post_rx_burst_cbs[queue_id]; - rte_smp_wmb(); - rte_eth_devices[port_id].post_rx_burst_cbs[queue_id] = cb; + /* Stores to cb->fn, cb->param and cb->next should complete before + * cb is visible to data plane threads. + */ + __atomic_store_n( + &rte_eth_devices[port_id].post_rx_burst_cbs[queue_id], + cb, __ATOMIC_RELEASE); rte_spinlock_unlock(&rte_eth_rx_cb_lock); return cb;