From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0039BA09E9; Mon, 14 Dec 2020 19:56:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C0F0C97A; Mon, 14 Dec 2020 19:56:46 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 0DCEEC876 for ; Mon, 14 Dec 2020 19:56:44 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id w5so12388174pgj.3 for ; Mon, 14 Dec 2020 10:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=a2wbOddTUyLUB56U/1sH7rdkANRuiASfOMi813rJdvM=; b=QVi53BKGywAN3Q9h9RIxKpQ3ywPQHjWFwiZEr1dkbWS1tZcAT9TEuCK4ye7evDtQVM +usK1dpyTnE6TpP+xwy6YpHwAWGev3Fuxuuclho3rKLEQFFBT4trfQnkjDqnpPPLMKYV T4p+XDzYkO4D/MHH439wSmnKk8cNkJvhTjeCE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=a2wbOddTUyLUB56U/1sH7rdkANRuiASfOMi813rJdvM=; b=f1zpCSYH+jMiwZ8m81FsG/10qydDu4IzuT2a95ho16U7sW36b/8HJce1z5kfLjpSxx yLWVbzZRvk30DNLjqm82yAbxnSmPCeZOUYv9Rm2PHPzl2TLqbzH4jwrm+4afEt2LQiWO KDWecSiQw513JvfQEuozmElzBC3d7wDSNAi/cEA0gHgO6Fi1rpyXqkr3xWpR1zeGxSJF Qfts/kY/MHvfQJbZfGxSHMCuM1Pf3GQpjKiMbefaKogg4hGqp+408tozyW4/Em/x+ZSP pRWbih9x2qb3NnheMcttg9KM8LoEihS5gxC22m1oqiXrJow5uvM7218fi0yOJPhLweNy sLvA== X-Gm-Message-State: AOAM533VI4ZNZYKayylJ5519PM19GFYosydZucFZ0w1WfetS0zSMvOXc FMSAqXrk/cu4zkStaa2oIPddwx7bxS1h7IA4SLiBb9WfkK54yXy76pxViNFPIjwoDZ2ZIoq6Bx3 FCQ== X-Google-Smtp-Source: ABdhPJwDi36i6tZryFrY01XL3R12zAk2oSiZPWG1xgzBybbmeYcZ9qlIibZQQjAaXY9TNgjkhANNRg== X-Received: by 2002:a63:5802:: with SMTP id m2mr25316983pgb.58.1607972203172; Mon, 14 Dec 2020 10:56:43 -0800 (PST) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id k21sm19837119pfu.77.2020.12.14.10.56.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 10:56:42 -0800 (PST) From: Lance Richardson To: Ajit Khaparde , Somnath Kotur Cc: dev@dpdk.org, ferruh.yigit@intel.com, stable@dpdk.org Date: Mon, 14 Dec 2020 13:56:38 -0500 Message-Id: <20201214185638.252662-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH v2] net/bnxt: fix doorbell write ordering 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" Write completion queue doorbell before receive descriptor doorbell to avoid possibility of completion queue overflow when completion queue size is equal to receive descriptor ring size. Remove unnecessary compiler barriers (db write functions have the necessary barriers.) Fixes: 637e34befd9c ("net/bnxt: optimize Rx processing") Signed-off-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde Reviewed-by: Somnath Kotur Cc: stable@dpdk.org --- v2 - Fixed typo in commit log. drivers/net/bnxt/bnxt_rxr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index e2d388e69f..ffdeeecc3a 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -917,17 +917,17 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, goto done; } - rte_compiler_barrier(); + /* Ring the completion queue doorbell. */ + bnxt_db_cq(cpr); + + /* Ring the receive descriptor doorbell. */ if (rx_raw_prod != rxr->rx_raw_prod) bnxt_db_write(&rxr->rx_db, rxr->rx_raw_prod); - rte_compiler_barrier(); /* Ring the AGG ring DB */ if (ag_raw_prod != rxr->ag_raw_prod) bnxt_db_write(&rxr->ag_db, rxr->ag_raw_prod); - bnxt_db_cq(cpr); - /* Attempt to alloc Rx buf in case of a previous allocation failure. */ if (rc == -ENOMEM) { int i = RING_NEXT(rx_raw_prod); -- 2.25.1 -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.