From patchwork Fri Oct 2 00:07:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 313961 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:1081:0:0:0:0 with SMTP id r1csp1004288ilj; Thu, 1 Oct 2020 17:07:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbRRJ3gHb7pTDZonehIOtk1tu39FopjFBt6aqylbk0jwXEpXI4DBH3lx879rT6nypYIV+D X-Received: by 2002:a05:6402:7c8:: with SMTP id u8mr4681436edy.153.1601597264673; Thu, 01 Oct 2020 17:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601597264; cv=none; d=google.com; s=arc-20160816; b=Uz7Ecy+X4Y97dBX8gv/cBgP5pWqRL4ctsDmlmKd9mqz2GQwUXtnfqGUT3/xOfVQ2Xo Qy4/1f/KOybEeWE0q2v5GXPECQsWWivH5H9OSbFPjCJ9HnaeX25gMTScriQ8UFM9PiYo TAO6ZNyrUt62D61TakN0vgEoGEbEIrvonOvaXxMrHPLcCZ3jm1AB04jzj+cESKU4Gw8P PNWuWLpP3EDfk3LCyPDzv9z1PhR1qZChWjYvd2suwRSGHJVSwnpOu5A0FldHvfp8hqWp NbBPZZEdsY1vU92m1+sdvmjnG2YcBHav7NRuOxcksHJiR0G9AiiNimG8hPV2gClKW5wX uOgg== 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:message-id:date:cc:to :from; bh=nn7iCf9PP9lcny7RCduKCi7N50aye+EHZM0DME3L9JI=; b=bJr42AGqUG9n4KwZ3FrlKYmE6aewcvmx8bXFlklPcDcsl4aeItfaIRicGAd6f5qhXJ JGj3REsUxRoODE5OyrCulCjcHR/Oi221y4xEoVL9BhMN/lQhFCPpjk50WfXzVqJuXn15 76ziLWFZpBlw4S0fSu0fdXviXljrFp2CYfL5vxvhlnM/+tMVVha40DTzFqNqz+LFV70Y G96uRN+l0IuKajtnVbFEmCxMaxeAFhUYQZHWjbuLd5+FIPqVk5gBLvqIap8L82rxirv4 T18AhToDroKZjbE1MdBDHr+HvN9WTZ6y9a/Qb9aTBBnVbo0mkU1x0+lRLkmnJygUzOVI yALg== 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 s26si4539019edw.32.2020.10.01.17.07.43; Thu, 01 Oct 2020 17:07:44 -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 508291D619; Fri, 2 Oct 2020 02:07:38 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 0E09A1D614 for ; Fri, 2 Oct 2020 02:07:37 +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 68F2B1042; Thu, 1 Oct 2020 17:07:35 -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 55FDA3F6CF; Thu, 1 Oct 2020 17:07:35 -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 Cc: abhinandan.gujjar@intel.com, nd@arm.com Date: Thu, 1 Oct 2020 19:07:10 -0500 Message-Id: <20201002000711.41511-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH 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 --- lib/librte_ethdev/rte_ethdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.17.1 Acked-by: Konstantin Ananyev 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;