From patchwork Mon Mar 2 14:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 184064 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2169754ile; Mon, 2 Mar 2020 01:00:47 -0800 (PST) X-Google-Smtp-Source: APXvYqy9GoF4s3m03lpMswMGZvnMBsFJ++p3Fi/ow0x6Pa8+JOLi1WWbIulPYt7gPs1qiylPxvXi X-Received: by 2002:a17:906:2498:: with SMTP id e24mr13905117ejb.223.1583139647782; Mon, 02 Mar 2020 01:00:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583139647; cv=none; d=google.com; s=arc-20160816; b=LQqk/SLc/GowK3AR4wxnlSMd5VefG3kuO9liaN3hAhPVk8p3OC6SpSGNulBrrFWrpr 3/Zjbse0yGHxwZUJK7muW4dF3jXgtzy48yGqQIuFBaw9FMxCuMhA9Yz0PlSHEUbMZZ7u ifNw5w4DBVeuuWaMYRpDmEamz6NJoGSZkMGEl+O7yukyPJg7x2f9Z4XJcWdORowiC4Pw ulh0F+XudVyPrnsUFcesIeN97be62hIPvR72blUMFlYPnd4XR34a8LszPKKbSjlkMxlC BBmx8r0d0jRP3fwPWGR+G7kOa7FqC02oNSM3cypGQou4VwyHH2KAKAnRrSIqkHLIA2vA ZJig== 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=3Jz631ZnVJ48KhwvuOF4lDGfMxw45dPZSOfqwcszhT8=; b=CnyKUUokO6T2uXVah21Tm9LwXtkt25JfHKEVJ0Ldx82GPqF9sGZoCFsEAB7Fwi1qHm TZDSwWr2OUFdEHS2ouUn0qUU8uQTFhWwFfqmIYMiGotgs31Sg7QOp0xKwr+m2dSmxTpP CaKq8J9TYKmrCLJfGEhLEMwe+w4zYRuYTJqDB7v9xkcL7gTgOQKCIUQv+MNmk+tsu0aD JOXA2O8JuO8n/vOV1jxYQfz/OGcBJkY52/dF+/cC0SM85SNUTozk+lm3Ps1gL3+u1eRy UDP3PyaYL2PWmG275vsOruguCsUq3dBhcGGvg5MjAK9d5Qu0InKMT76qBrjtM0fIAq0m 4wxw== 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 v9si6298963ejw.11.2020.03.02.01.00.47; Mon, 02 Mar 2020 01:00:47 -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 7867B1C030; Mon, 2 Mar 2020 10:00:20 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id BB3191C00D for ; Mon, 2 Mar 2020 10:00:16 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 79B3C1A0FC5; Mon, 2 Mar 2020 10:00:16 +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 EF5DC1A0FE2; Mon, 2 Mar 2020 10:00:13 +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 8B08D4029E; Mon, 2 Mar 2020 17:00:10 +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:02 +0530 Message-Id: <20200302143209.11854-4-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 03/10] net/enetc: batch process enetc clean Tx ring calls 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 Each call to enetc_clean_tx_ring will cost at least 150-200 CPU cycles even if no clean-up is done, due to the CI register read. We're only calling it once at the end of the function, on the assumption that software is slower than hardware and hardware completed sending older frames out by now. We're also cleaning up the ring before kicking off Tx for the new batch to minimize chances of contention on the Tx ring. Signed-off-by: Alex Marginean --- drivers/net/enetc/enetc_rxtx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.c index 395f5ecf4..958e3a21d 100644 --- a/drivers/net/enetc/enetc_rxtx.c +++ b/drivers/net/enetc/enetc_rxtx.c @@ -76,7 +76,6 @@ enetc_xmit_pkts(void *tx_queue, start = 0; while (nb_pkts--) { - enetc_clean_tx_ring(tx_ring); tx_ring->q_swbd[i].buffer_addr = tx_pkts[start]; txbd = ENETC_TXBD(*tx_ring, i); tx_swbd = &tx_ring->q_swbd[i]; @@ -92,6 +91,14 @@ enetc_xmit_pkts(void *tx_queue, i = 0; } + /* we're only cleaning up the Tx ring here, on the assumption that + * software is slower than hardware and hardware completed sending + * older frames out by now. + * We're also cleaning up the ring before kicking off Tx for the new + * batch to minimize chances of contention on the Tx ring + */ + enetc_clean_tx_ring(tx_ring); + tx_ring->next_to_use = i; enetc_wr_reg(tx_ring->tcir, i); return start;