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 139C6A09EE for ; Mon, 14 Dec 2020 19:56:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E427DC996; Mon, 14 Dec 2020 19:56:47 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 12908C97A for ; Mon, 14 Dec 2020 19:56:45 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id n10so5143238pgl.10 for ; Mon, 14 Dec 2020 10:56:45 -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=63vFTibzEKA5NgCn4ri+rtPzLCrZ/L9XGHK81Zm2Lbg=; b=cxRjoamnV/KwxGMg1+kwoCgJaUdzUBOeQJKFbqRjIDYKFa9hT4T+7H3RW6rGEBfmAz tjv4YnyoaHZxOoLF6KLPCbJVT0HHqV4N0zydSOQto7zfh+LWrVGizzW6LstOnTnURkAI tAHa5gyqvNlCZQYC6A9BDHKpKZl/wUgZXO2IE= 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=63vFTibzEKA5NgCn4ri+rtPzLCrZ/L9XGHK81Zm2Lbg=; b=kfA/l7jwZ48NhVR0lOOVSTo529VDkhmxpApW4daa3uZELF5oMYSQEPsTfMr04Vdj8z JkjqtRYB/p2DorZE9QhkZdwgZH5SiY/eBHNfbp2x/lTUZi6cl89bQBqmPuCrUq4XAVNr 8ENcA0vgQ+JF0beyDQYULhRgqnJgMPrwgu0/HNBIXWf1K47RXxw9p/R4d2VwDCiFQGdg V+kH9pq3cAOljbYtt1sR9Y3r7C7w0/FTgNqAW8hGO9Wm4BprqWUol2S1uXnjX5P6Es0B pMRJLYnV0Kkd43Cv4QbH2Dp10rif1B5Ep770vhk4eYRvpew0kQQ07naj/sf8m920bfK4 BDxw== X-Gm-Message-State: AOAM530mVPFqaWJFjxbtVHSfEi2Gf85STOkiOneDfA1fLWs7MV/Umomu EkeS8sjr8Zf33TCsMaAtIBrijaDMj0DAZ2w829TFYHX78IdasI9zEA9Tf4heUXkWcELZHNW9sg= = 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-stable] [PATCH v2] net/bnxt: fix doorbell write ordering X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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.