[v2,12/12] event/cnxk: offset timestamp data only if enabled on port

Message ID 20220616092420.17861-12-ndabilpuram@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v2,01/12] common/cnxk: use computed value for WQE skip |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues

Commit Message

Nithin Dabilpuram June 16, 2022, 9:24 a.m. UTC
  Offset timestamp data only when enabled on the port instead of
just checking for offload flags.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/event/cnxk/cn10k_worker.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Nithin Dabilpuram June 16, 2022, 10:30 a.m. UTC | #1
Please ignore this particular patch 12/12. It is already part of other 
patch.

https://patchwork.dpdk.org/project/dpdk/patch/20220612175612.3101-1-pbhagavatula@marvell.com/

Thanks
Nithin

On 2022-06-16 2:54 PM, Nithin Dabilpuram wrote:
> Offset timestamp data only when enabled on the port instead of
> just checking for offload flags.
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> ---
>   drivers/event/cnxk/cn10k_worker.h | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
> index 034f508..7412a1b 100644
> --- a/drivers/event/cnxk/cn10k_worker.h
> +++ b/drivers/event/cnxk/cn10k_worker.h
> @@ -112,8 +112,7 @@ static __rte_always_inline void
>   cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
>   		   void *lookup_mem, void *tstamp, uintptr_t lbase)
>   {
> -	uint64_t mbuf_init = 0x100010000ULL | RTE_PKTMBUF_HEADROOM |
> -			     (flags & NIX_RX_OFFLOAD_TSTAMP_F ? 8 : 0);
> +	uint64_t mbuf_init = 0x100010000ULL | RTE_PKTMBUF_HEADROOM;
>   	struct rte_event_vector *vec;
>   	uint64_t aura_handle, laddr;
>   	uint16_t nb_mbufs, non_vec;
> @@ -133,6 +132,9 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
>   	for (i = OBJS_PER_CLINE; i < vec->nb_elem; i += OBJS_PER_CLINE)
>   		rte_prefetch0(&vec->ptrs[i]);
>   
> +	if (flags & NIX_RX_OFFLOAD_TSTAMP_F && tstamp)
> +		mbuf_init |= 8;
> +
>   	nb_mbufs = RTE_ALIGN_FLOOR(vec->nb_elem, NIX_DESCS_PER_LOOP);
>   	nb_mbufs = cn10k_nix_recv_pkts_vector(&mbuf_init, wqe, nb_mbufs,
>   					      flags | NIX_RX_VWQE_F, lookup_mem,
  

Patch

diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index 034f508..7412a1b 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -112,8 +112,7 @@  static __rte_always_inline void
 cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
 		   void *lookup_mem, void *tstamp, uintptr_t lbase)
 {
-	uint64_t mbuf_init = 0x100010000ULL | RTE_PKTMBUF_HEADROOM |
-			     (flags & NIX_RX_OFFLOAD_TSTAMP_F ? 8 : 0);
+	uint64_t mbuf_init = 0x100010000ULL | RTE_PKTMBUF_HEADROOM;
 	struct rte_event_vector *vec;
 	uint64_t aura_handle, laddr;
 	uint16_t nb_mbufs, non_vec;
@@ -133,6 +132,9 @@  cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
 	for (i = OBJS_PER_CLINE; i < vec->nb_elem; i += OBJS_PER_CLINE)
 		rte_prefetch0(&vec->ptrs[i]);
 
+	if (flags & NIX_RX_OFFLOAD_TSTAMP_F && tstamp)
+		mbuf_init |= 8;
+
 	nb_mbufs = RTE_ALIGN_FLOOR(vec->nb_elem, NIX_DESCS_PER_LOOP);
 	nb_mbufs = cn10k_nix_recv_pkts_vector(&mbuf_init, wqe, nb_mbufs,
 					      flags | NIX_RX_VWQE_F, lookup_mem,