DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code
@ 2015-06-10 22:19 Damjan Marion
  2015-07-10 14:33 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Damjan Marion @ 2015-06-10 22:19 UTC (permalink / raw)
  To: dev; +Cc: 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;
-- 
2.1.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code
  2015-06-10 22:19 [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code Damjan Marion
@ 2015-07-10 14:33 ` Thomas Monjalon
  2015-07-10 15:24 ` Zhang, Helin
  2015-07-10 16:18 ` Zhang, Helin
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2015-07-10 14:33 UTC (permalink / raw)
  To: Helin Zhang; +Cc: dev, Damjan Marion

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;
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code
  2015-06-10 22:19 [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code Damjan Marion
  2015-07-10 14:33 ` Thomas Monjalon
@ 2015-07-10 15:24 ` Zhang, Helin
  2015-07-10 16:18 ` Zhang, Helin
  2 siblings, 0 replies; 5+ messages in thread
From: Zhang, Helin @ 2015-07-10 15:24 UTC (permalink / raw)
  To: Damjan Marion; +Cc: dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code
  2015-06-10 22:19 [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code Damjan Marion
  2015-07-10 14:33 ` Thomas Monjalon
  2015-07-10 15:24 ` Zhang, Helin
@ 2015-07-10 16:18 ` Zhang, Helin
  2015-07-10 17:18   ` Thomas Monjalon
  2 siblings, 1 reply; 5+ messages in thread
From: Zhang, Helin @ 2015-07-10 16:18 UTC (permalink / raw)
  To: Damjan Marion; +Cc: dev



> -----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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code
  2015-07-10 16:18 ` Zhang, Helin
@ 2015-07-10 17:18   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2015-07-10 17:18 UTC (permalink / raw)
  To: Damjan Marion; +Cc: dev

> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-10 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 22:19 [dpdk-dev] [PATCH] i40e: prefetch next mbuf in rx alloc code Damjan Marion
2015-07-10 14:33 ` Thomas Monjalon
2015-07-10 15:24 ` Zhang, Helin
2015-07-10 16:18 ` Zhang, Helin
2015-07-10 17:18   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).