DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH] eventdev: remove event copy in Rx adapter
@ 2019-06-10  4:23 Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 6+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-06-10  4:23 UTC (permalink / raw)
  To: Nikhil Rao, mattias.ronnblom; +Cc: dev



> -----Original Message-----
> From: Nikhil Rao <nikhil.rao@intel.com>
> Sent: Wednesday, May 22, 2019 3:23 AM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> mattias.ronnblom@ericsson.com
> Cc: dev@dpdk.org; Nikhil Rao <nikhil.rao@intel.com>
> Subject: [PATCH] eventdev: remove event copy in Rx adapter
> 
> Remove copy from temporary event array on the stack to the enqueue
> buffer event array entry, instead initialize event in the enqueue buffer event
> array entry.
> 
> Suggested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
> 
> Hi Mattias,
> 
> This patch eliminates the event copy as you previously mentioned
> (https://patches.dpdk.org/patch/53350/), the enqueue buffer array is still
> retained in the rx_adapter struct, since the Rx adapter service function can
> return with events in the enqueue buffer that have not yet been shipped to
> the event device.
> 
> Let me know your comments.
 
Mattias,

Let us know, if you have any comments on this patch?



> Thanks,
> Nikhil
> 
>  lib/librte_eventdev/rte_event_eth_rx_adapter.c | 20 ++++----------------
>  1 file changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> index 8d178be..a201668 100644
> --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> @@ -715,18 +715,6 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
>  	}
>  }
> 
> -/* Add event to buffer, free space check is done prior to calling
> - * this function
> - */
> -static inline void
> -rxa_buffer_event(struct rte_event_eth_rx_adapter *rx_adapter,
> -		struct rte_event *ev)
> -{
> -	struct rte_eth_event_enqueue_buffer *buf =
> -	    &rx_adapter->event_enqueue_buffer;
> -	rte_memcpy(&buf->events[buf->count++], ev, sizeof(struct
> rte_event));
> -}
> -
>  /* Enqueue buffered events to event device */  static inline uint16_t
> rxa_flush_event_buffer(struct rte_event_eth_rx_adapter *rx_adapter)
> @@ -769,11 +757,11 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
>  					&dev_info-
> >rx_queue[rx_queue_id];
>  	struct rte_eth_event_enqueue_buffer *buf =
>  					&rx_adapter-
> >event_enqueue_buffer;
> +	struct rte_event *ev = &buf->events[buf->count];
>  	int32_t qid = eth_rx_queue_info->event_queue_id;
>  	uint8_t sched_type = eth_rx_queue_info->sched_type;
>  	uint8_t priority = eth_rx_queue_info->priority;
>  	uint32_t flow_id;
> -	struct rte_event events[BATCH_SIZE];
>  	struct rte_mbuf *m = mbufs[0];
>  	uint32_t rss_mask;
>  	uint32_t rss;
> @@ -811,7 +799,6 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
> 
>  	for (i = 0; i < num; i++) {
>  		m = mbufs[i];
> -		struct rte_event *ev = &events[i];
> 
>  		rss = do_rss ?
>  			rxa_do_softrss(m, rx_adapter->rss_key_be) :
> @@ -828,9 +815,10 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
>  		ev->sub_event_type = 0;
>  		ev->priority = priority;
>  		ev->mbuf = m;
> -
> -		rxa_buffer_event(rx_adapter, ev);
> +		ev++;
>  	}
> +
> +	buf->count += num;
>  }
> 
>  /* Enqueue packets from  <port, q>  to event buffer */
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH] eventdev: remove event copy in Rx adapter
@ 2019-05-21 21:52 Nikhil Rao
  2019-06-11 10:55 ` Mattias Rönnblom
  0 siblings, 1 reply; 6+ messages in thread
From: Nikhil Rao @ 2019-05-21 21:52 UTC (permalink / raw)
  To: jerinj, mattias.ronnblom; +Cc: dev, Nikhil Rao

Remove copy from temporary event array on the stack to the
enqueue buffer event array entry, instead initialize event in the
enqueue buffer event array entry.

Suggested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---

Hi Mattias,

This patch eliminates the event copy as you previously mentioned
(https://patches.dpdk.org/patch/53350/), the enqueue buffer
array is still retained in the rx_adapter struct, since the Rx adapter
service function can return with events in the enqueue buffer
that have not yet been shipped to the event device.

Let me know your comments.

Thanks,
Nikhil

 lib/librte_eventdev/rte_event_eth_rx_adapter.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index 8d178be..a201668 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -715,18 +715,6 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
 	}
 }
 
-/* Add event to buffer, free space check is done prior to calling
- * this function
- */
-static inline void
-rxa_buffer_event(struct rte_event_eth_rx_adapter *rx_adapter,
-		struct rte_event *ev)
-{
-	struct rte_eth_event_enqueue_buffer *buf =
-	    &rx_adapter->event_enqueue_buffer;
-	rte_memcpy(&buf->events[buf->count++], ev, sizeof(struct rte_event));
-}
-
 /* Enqueue buffered events to event device */
 static inline uint16_t
 rxa_flush_event_buffer(struct rte_event_eth_rx_adapter *rx_adapter)
@@ -769,11 +757,11 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
 					&dev_info->rx_queue[rx_queue_id];
 	struct rte_eth_event_enqueue_buffer *buf =
 					&rx_adapter->event_enqueue_buffer;
+	struct rte_event *ev = &buf->events[buf->count];
 	int32_t qid = eth_rx_queue_info->event_queue_id;
 	uint8_t sched_type = eth_rx_queue_info->sched_type;
 	uint8_t priority = eth_rx_queue_info->priority;
 	uint32_t flow_id;
-	struct rte_event events[BATCH_SIZE];
 	struct rte_mbuf *m = mbufs[0];
 	uint32_t rss_mask;
 	uint32_t rss;
@@ -811,7 +799,6 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
 
 	for (i = 0; i < num; i++) {
 		m = mbufs[i];
-		struct rte_event *ev = &events[i];
 
 		rss = do_rss ?
 			rxa_do_softrss(m, rx_adapter->rss_key_be) :
@@ -828,9 +815,10 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
 		ev->sub_event_type = 0;
 		ev->priority = priority;
 		ev->mbuf = m;
-
-		rxa_buffer_event(rx_adapter, ev);
+		ev++;
 	}
+
+	buf->count += num;
 }
 
 /* Enqueue packets from  <port, q>  to event buffer */
-- 
1.8.3.1


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

end of thread, other threads:[~2019-06-13 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-10  4:23 [dpdk-dev] [PATCH] eventdev: remove event copy in Rx adapter Jerin Jacob Kollanukkaran
  -- strict thread matches above, loose matches on Subject: below --
2019-05-21 21:52 Nikhil Rao
2019-06-11 10:55 ` Mattias Rönnblom
2019-06-13 13:02   ` Rao, Nikhil
2019-06-13 14:05     ` Jerin Jacob Kollanukkaran
2019-06-13 14:43       ` Jerin Jacob Kollanukkaran

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