Message ID | 1433974765-136411-1-git-send-email-damarion@cisco.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 19BA0C300; Thu, 11 Jun 2015 00:20:05 +0200 (CEST) Received: from aer-iport-3.cisco.com (aer-iport-3.cisco.com [173.38.203.53]) by dpdk.org (Postfix) with ESMTP id 73779C2DC for <dev@dpdk.org>; Thu, 11 Jun 2015 00:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=730; q=dns/txt; s=iport; t=1433974803; x=1435184403; h=from:to:cc:subject:date:message-id; bh=N2W8Jtoo3xcs5MnhsLmztAdLG0DMrpWJSTvP2JWM0k8=; b=PY/YqcxS3E0ExjWn7U3FH9v66bTZ+KrlN3gQruryGMNRU8MgepYodpQU y8RNrCSQ4keSA3emlbsKuC4GxOkpOkgYsdaFj7PQh1sxeGn/jEp0u5trT 8uxH9pGQHJQRFQwI6i9zo95OouAYwoD6h7rEhC/FeHMcNgaIFuN4cAnRh A=; X-IronPort-AV: E=Sophos;i="5.13,590,1427760000"; d="scan'208";a="514342376" Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-3.cisco.com with ESMTP; 10 Jun 2015 22:20:02 +0000 Received: from proteus.cisco.com (proteus.cisco.com [10.55.15.254]) by aer-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id t5AMK2tM023388; Wed, 10 Jun 2015 22:20:02 GMT From: Damjan Marion <damarion@cisco.com> To: dev@dpdk.org Date: Thu, 11 Jun 2015 00:19:25 +0200 Message-Id: <1433974765-136411-1-git-send-email-damarion@cisco.com> X-Mailer: git-send-email 2.1.4 Cc: Damjan Marion <damarion@cisco.com> Subject: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Damjan Marion (damarion)
June 10, 2015, 10:19 p.m. UTC
This patch improves performance of vectored rx on i40e devices.
Signed-off-by: Damjan Marion <damarion@cisco.com>
---
drivers/net/i40e/i40e_rxtx.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Helin, a comment? 2015-06-11 00:19, Damjan Marion: > This patch improves performance of vectored rx on i40e devices. > > Signed-off-by: Damjan Marion <damarion@cisco.com> > --- > drivers/net/i40e/i40e_rxtx.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 2de0ac4..152e9e6 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -778,6 +778,11 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq) > > rxdp = &rxq->rx_ring[alloc_idx]; > for (i = 0; i < rxq->rx_free_thresh; i++) { > + > + /* Prefetch next mbuf */ > + if (i < (rxq->rx_free_thresh - 1)) > + rte_prefetch0 (rxep[i+1].mbuf); > + > mb = rxep[i].mbuf; > rte_mbuf_refcnt_set(mb, 1); > mb->next = NULL; >
Hi Marion > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Damjan Marion > Sent: Wednesday, June 10, 2015 3:19 PM > To: dev@dpdk.org > Cc: Damjan Marion > Subject: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code > > This patch improves performance of vectored rx on i40e devices. It seems this is not a vectored i40e driver, but it is a good idea. Please reword the commit logs! > > Signed-off-by: Damjan Marion <damarion@cisco.com> > --- > drivers/net/i40e/i40e_rxtx.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index > 2de0ac4..152e9e6 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -778,6 +778,11 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq) > > rxdp = &rxq->rx_ring[alloc_idx]; > for (i = 0; i < rxq->rx_free_thresh; i++) { > + > + /* Prefetch next mbuf */ > + if (i < (rxq->rx_free_thresh - 1)) It would be better to add a 'likely' in above line. > + rte_prefetch0 (rxep[i+1].mbuf); Have you checked with checkpatch.pl? I guess there might be a warning/error there for above line. There shouldn't be a space between 'rte_prefetch0' and '('. Thanks, Helin > + > mb = rxep[i].mbuf; > rte_mbuf_refcnt_set(mb, 1); > mb->next = NULL; > -- > 2.1.4
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Damjan Marion > Sent: Wednesday, June 10, 2015 3:19 PM > To: dev@dpdk.org > Cc: Damjan Marion > Subject: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code > > This patch improves performance of vectored rx on i40e devices. > > Signed-off-by: Damjan Marion <damarion@cisco.com> Acked-by: Helin Zhang <helin.zhang@intel.com> with minor change requests. 1. commit log should be reworded. 2. likely should be added to the newly added if() line. 3. checkpatch.pl should be used to have a check. > --- > drivers/net/i40e/i40e_rxtx.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index > 2de0ac4..152e9e6 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -778,6 +778,11 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq) > > rxdp = &rxq->rx_ring[alloc_idx]; > for (i = 0; i < rxq->rx_free_thresh; i++) { > + > + /* Prefetch next mbuf */ > + if (i < (rxq->rx_free_thresh - 1)) > + rte_prefetch0 (rxep[i+1].mbuf); > + > mb = rxep[i].mbuf; > rte_mbuf_refcnt_set(mb, 1); > mb->next = NULL; > -- > 2.1.4
> > This patch improves performance of vectored rx on i40e devices. > > > > Signed-off-by: Damjan Marion <damarion@cisco.com> > Acked-by: Helin Zhang <helin.zhang@intel.com> with minor change requests. > > 1. commit log should be reworded. > 2. likely should be added to the newly added if() line. > 3. checkpatch.pl should be used to have a check. Applied with above comments, thanks
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 2de0ac4..152e9e6 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -778,6 +778,11 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq) rxdp = &rxq->rx_ring[alloc_idx]; for (i = 0; i < rxq->rx_free_thresh; i++) { + + /* Prefetch next mbuf */ + if (i < (rxq->rx_free_thresh - 1)) + rte_prefetch0 (rxep[i+1].mbuf); + mb = rxep[i].mbuf; rte_mbuf_refcnt_set(mb, 1); mb->next = NULL;