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 3B9AFA09E9 for ; Mon, 14 Dec 2020 19:52:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1408CC968; Mon, 14 Dec 2020 19:51:59 +0100 (CET) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id 4690A29AC for ; Mon, 14 Dec 2020 19:51:56 +0100 (CET) Received: by mail-pj1-f67.google.com with SMTP id l23so7167866pjg.1 for ; Mon, 14 Dec 2020 10:51:56 -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=qygLdYKAiUNz6Qz5tpzSOYupAvwqWcCW4yXm4KjJQ2E=; b=bdgBfnasNg+ZJHPpAWgPlqGh/iwnQ+tkXnhn5l32Bis+9xpb2U+s3o6JH+5iCyIx9I Zia61uU2xUFYjqqqwNNqVvsoWiMvPkSX4qi5IP5brzSdoWMPFeQC1vHyE79vScDop6pd uLz3IfjhHZyDiLwA5CPYcotb8eswGN+v9eGus= 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=qygLdYKAiUNz6Qz5tpzSOYupAvwqWcCW4yXm4KjJQ2E=; b=THVdwo7zTQhlJztycbrOfUTk0UoLUCnRN8tbiiKK5eKdyk2pScWeIWb7HIU1AO2SXf jJVS3iCgA+M+EHHbPDan5RPWKEX+Num8Sy2zzFlKkXWhFs2NlawvLioYLF92pgQd2NAh rP0/QPvtwsmT7KY6OL1pkp7IN5gqGQ0NadQL1Eo5RHnhbFxG3C7wvl22NjfWxjy29AsW izckfSnHLrPRNuYAkmM5ZjgYotNEnjFisIzsB49fBAXfzetKffSK0H5MH1NMk7sbIDpq Hr8IF3UXQwegTCQ8FV4llNXoKwWFFu0jHFXpmlPrJrJRCASljURbH+HEi26zpUeKGK3i pdrA== X-Gm-Message-State: AOAM5317qMXTEWD97eA3s2JyHdaA2Slzh3zUEAChANfGKc8peLQAvwwO Ju12a0N2Il6HM7s2CK5fr2TI5R6mzrWKwiPsc//wK7+x2suPfH8X2mhsz+ZWOSJiRzWqzk1slw= = X-Google-Smtp-Source: ABdhPJxu5dkSSGlj+u9gzqb/MrtmRxK6zI2+2ifs56tHXBhyEn0djkFyUb2Z7EzpcG9T7YVdFe6KKw== X-Received: by 2002:a17:90a:bf16:: with SMTP id c22mr26994690pjs.11.1607971914287; Mon, 14 Dec 2020 10:51:54 -0800 (PST) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id p21sm11423930pjz.14.2020.12.14.10.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 10:51:53 -0800 (PST) From: Lance Richardson To: Ajit Khaparde , Somnath Kotur Cc: dev@dpdk.org, stable@dpdk.org Date: Mon, 14 Dec 2020 13:51:44 -0500 Message-Id: <20201214185144.252284-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] 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 possiblity 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 --- 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.