From patchwork Thu Mar 18 19:52:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Richardson X-Patchwork-Id: 89508 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B48EFA0561; Thu, 18 Mar 2021 20:52:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 344B1140F27; Thu, 18 Mar 2021 20:52:21 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 300AF40698 for ; Thu, 18 Mar 2021 20:52:19 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id f2-20020a17090a4a82b02900c67bf8dc69so5563217pjh.1 for ; Thu, 18 Mar 2021 12:52:19 -0700 (PDT) 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=gJ4Iw32LyEJoCXhlbZkYrXPVVlRIOQ6XNf7siOOC8tU=; b=VJr9rbFmJzRycW+dZLsQYQhZk+ddC9VeTpIrW1B9KNepIj7J9uuzgOuLQa1PAl1c4U 6ZLYUGghnRXzV3fQWsWPG6QCTnuzYfBlSfmKck8jgsn1IVe7vww8j+R3nRps/evyhho3 8N9CnI4nhE53d0eTBj0RYLIxAHHnTDzUTttB8= 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=gJ4Iw32LyEJoCXhlbZkYrXPVVlRIOQ6XNf7siOOC8tU=; b=tYFTLDURoho/22rd3YzCKtRGtQqfcvyRa4jC+scgLpQ5wRMq7MEX6+6C/PGaQPmt7/ JyukmxgXokLdlJZrBWu/VfYB7XflHq6YQg8tWtf6w3Q1wd7aB1c3IH/8tCqS21I8QZRk YC/ZYhHNW0jMspVyGlirPmHGEySJwnlx+uWbUPm36EmUxBsgk5bQ1JSMOuOvWwihLW4K 7lgKibFh5kt355mSW7soeXlhF2IamOdoWc5jiorMR56llecXzmn7+9DXXHH4MdcKlS39 5xPQUwN8nuy+l1jc+/muSnqQT344xa/+KC9dDMF8cL2rsdMPzdeYDbACYsEP3/K0GUGs xVQA== X-Gm-Message-State: AOAM5319uSy1BWtZHHgy5Xy1mljf8nomhMkILUH5iIAesSxo2yIw8Vm8 sK6emznUUCZgAZ2+Jxk7L4z1/g== X-Google-Smtp-Source: ABdhPJxYMCdWbjOgZCye+TOO+cn2lQLK+zlrjS/dmOltrtVTuSmN0bllYQQBIC0TkLNL0yd/blY3og== X-Received: by 2002:a17:90a:9f4a:: with SMTP id q10mr6075578pjv.129.1616097138189; Thu, 18 Mar 2021 12:52:18 -0700 (PDT) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id c193sm3318237pfc.180.2021.03.18.12.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 12:52:17 -0700 (PDT) From: Lance Richardson To: Ajit Khaparde , Somnath Kotur Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 18 Mar 2021 15:52:13 -0400 Message-Id: <20210318195213.683281-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH 1/1] net/bnxt: fix Rx buffer posting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Remove early buffer posting logic from burst receive loop to address several issues: - Posting receive descriptors without first posting completion entries risks overflowing the completion queue. - Posting receive descriptors without updating rx_raw_prod creates the possibility that the receive descriptor doorbell can be written twice with the same value. - Having this logic in the inner descriptor processing loop can impact performance. Fixes: 637e34befd9c ("net/bnxt: optimize Rx processing") Fixes: 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring") Cc: stable@dpdk.org Signed-off-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_rxr.c | 3 --- drivers/net/bnxt/bnxt_rxr.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index c72545ada7..7179c6cb30 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -1018,9 +1018,6 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, raw_cons = NEXT_RAW_CMP(raw_cons); if (nb_rx_pkts == nb_pkts || nb_rep_rx_pkts == nb_pkts || evt) break; - /* Post some Rx buf early in case of larger burst processing */ - if (nb_rx_pkts == BNXT_RX_POST_THRESH) - bnxt_db_write(&rxr->rx_db, rxr->rx_raw_prod); } cpr->cp_raw_cons = raw_cons; diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h index a6fdd7767a..b43256e03e 100644 --- a/drivers/net/bnxt/bnxt_rxr.h +++ b/drivers/net/bnxt/bnxt_rxr.h @@ -41,8 +41,6 @@ static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp, (((cmp)->agg_bufs_v1 & RX_PKT_CMPL_AGG_BUFS_MASK) >> \ RX_PKT_CMPL_AGG_BUFS_SFT) -#define BNXT_RX_POST_THRESH 32 - /* Number of descriptors to process per inner loop in vector mode. */ #define RTE_BNXT_DESCS_PER_LOOP 4U