From patchwork Mon Mar 2 14:32:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 184066 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2170232ile; Mon, 2 Mar 2020 01:01:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwBP7UkmmpRKU3DtqrLXFu09l0rpBYzGQj/HUgToLZ2+uwUKPFJFTDRmg4kxTjPBAsF47pR X-Received: by 2002:a17:906:5acd:: with SMTP id x13mr14703119ejs.147.1583139672975; Mon, 02 Mar 2020 01:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583139672; cv=none; d=google.com; s=arc-20160816; b=YsqOsuwD+oqEx8ME6HkVrUUaOwoIMXCIEpyaBinAse5/17pYgvv+M+fAhBOGNEj77M 4iwIK5jPBAugCMYaYYBd2wZXne/2mW+Xh4juFG9GNv5BTQ7Zvh1+08BDkqzpcmL4zmZ/ Cf0k+1Gx71x1WPFOHY5eebRlw7nHe0IZVtq+vLxbLL6TjmC+bGvi33mWCNUbNqqj02qu 0axA/0y89bWiHJBs2Wlsa2PJumwkfZ6rTUrsOnajicILwcMB9CfnUSLEf05jlMmSxtpX 6VgAzhpMKa/tmW9ZwQ8geyRIxsBy81Zn4YViBoMdQp3OLZxKxv1QseJXwpwBcRAIPqDq nqUg== 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:references:in-reply-to :message-id:date:cc:to:from; bh=ZaqNnk3Km/9XAjh0C8gETSn+rBLpXjqFx3OfqUhuA3Q=; b=WxdM12H3JZ8ycit+rWu4XwSrh0Ts3NNj5mx2W6oWyXCEykbbsxT6ZD7MINQon80mTY ptBzNt7tHnwgAZ0RGq0D5wkwx1LfSnAszbax23egT583kWkfm07zs9TTAV35Hr5jAu58 /QH8jRauTCueI3cpUKWpp/fnOJ5SM6Hn387Tu2CLeFD4E6Wz1psRHamCtPHrdz6XOveK IjkZcgs/XJdrSjeuekF+TmNsW8MThM39tsddvrq0GZh1CtjYS/9erxD+cOBBS61fmdLQ fZ20LhUCWO6Z9Rkz9G/yOl8nHX775vdShUp8ppxi/obp46QYDOLLmK4Px4Lco8C6KLUo t/jA== 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=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id e2si5160708ejd.235.2020.03.02.01.01.12; Mon, 02 Mar 2020 01:01:12 -0800 (PST) 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=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9DB211C07B; Mon, 2 Mar 2020 10:00:23 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 35E921C01B for ; Mon, 2 Mar 2020 10:00:18 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 172321A0FC1; Mon, 2 Mar 2020 10:00:18 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 8BC9A1A0FA6; Mon, 2 Mar 2020 10:00:15 +0100 (CET) Received: from bf-netperf1.ap.com (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4B64840324; Mon, 2 Mar 2020 17:00:12 +0800 (SGT) From: Hemant Agrawal To: ferruh.yigit@intel.com Cc: dev@dpdk.org, g.singh@nxp.com, Alex Marginean Date: Mon, 2 Mar 2020 20:02:04 +0530 Message-Id: <20200302143209.11854-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200302143209.11854-1-hemant.agrawal@nxp.com> References: <20200302143209.11854-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 05/10] net/enetc: improve batching Rx ring refill 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: Alex Marginean Move from doing batch refill of Rx ring from bundles of 8 to once per enetc_clean_rx_ring call. One benefit is that we're cleaning up all the BDs that we just processed, which should still be cached. The other is that hardware Rx index stays a little back and doesn't cause contention on the BDs processed in the Rx loop. Signed-off-by: Alex Marginean --- drivers/net/enetc/enetc_rxtx.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.c index 958e3a21d..262ed8a0f 100644 --- a/drivers/net/enetc/enetc_rxtx.c +++ b/drivers/net/enetc/enetc_rxtx.c @@ -14,8 +14,6 @@ #include "enetc.h" #include "enetc_logs.h" -#define ENETC_RXBD_BUNDLE 8 /* Number of BDs to update at once */ - static int enetc_clean_tx_ring(struct enetc_bdr *tx_ring) { @@ -305,12 +303,6 @@ enetc_clean_rx_ring(struct enetc_bdr *rx_ring, union enetc_rx_bd *rxbd; uint32_t bd_status; - if (cleaned_cnt >= ENETC_RXBD_BUNDLE) { - int count = enetc_refill_rx_ring(rx_ring, cleaned_cnt); - - cleaned_cnt -= count; - } - rxbd = ENETC_RXBD(*rx_ring, i); bd_status = rte_le_to_cpu_32(rxbd->r.lstatus); if (!bd_status) @@ -337,6 +329,8 @@ enetc_clean_rx_ring(struct enetc_bdr *rx_ring, rx_frm_cnt++; } + enetc_refill_rx_ring(rx_ring, cleaned_cnt); + return rx_frm_cnt; }