[v2,03/29] net/dpaa2: enable timestamp for Rx offload case as well
diff mbox series

Message ID 20200707092244.12791-4-hemant.agrawal@nxp.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • NXP DPAAx enhancements
Related show

Checks

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

Commit Message

Hemant Agrawal July 7, 2020, 9:22 a.m. UTC
From: Gagandeep Singh <g.singh@nxp.com>

This patch enables the packet timestamping
conditionally when Rx offload is enabled for timestamp.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Thomas Monjalon July 11, 2020, 1:46 p.m. UTC | #1
07/07/2020 11:22, Hemant Agrawal:
> From: Gagandeep Singh <g.singh@nxp.com>
> 
> This patch enables the packet timestamping
> conditionally when Rx offload is enabled for timestamp.
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>  drivers/net/dpaa2/dpaa2_ethdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index a1f19194d..8edd4b3cd 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -524,8 +524,10 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
>  		return ret;
>  	}
>  
> +#if !defined(RTE_LIBRTE_IEEE1588)
>  	if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP)
> -		dpaa2_enable_ts = true;
> +#endif
> +	dpaa2_enable_ts = true;

I don't understand this patch at all.
There is no comment in the code, and the commit log
is not very explanatory.

You are lucky Ferruh is less strict than me.
I remember I already said I was bored of the lack of explanations
in NXP drivers.
Hemant Agrawal July 13, 2020, 3:47 a.m. UTC | #2
-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net> 
Sent: Saturday, July 11, 2020 7:16 PM
To: Gagandeep Singh <G.Singh@nxp.com>; Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: dev@dpdk.org; ferruh.yigit@intel.com
Subject: Re: [dpdk-dev] [PATCH v2 03/29] net/dpaa2: enable timestamp for Rx offload case as well
Importance: High

07/07/2020 11:22, Hemant Agrawal:
> From: Gagandeep Singh <g.singh@nxp.com>
> 
> This patch enables the packet timestamping conditionally when Rx 
> offload is enabled for timestamp.
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>  drivers/net/dpaa2/dpaa2_ethdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c 
> b/drivers/net/dpaa2/dpaa2_ethdev.c
> index a1f19194d..8edd4b3cd 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -524,8 +524,10 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
>  		return ret;
>  	}
>  
> +#if !defined(RTE_LIBRTE_IEEE1588)
>  	if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP)
> -		dpaa2_enable_ts = true;
> +#endif
> +	dpaa2_enable_ts = true;

I don't understand this patch at all.
There is no comment in the code, and the commit log is not very explanatory.

You are lucky Ferruh is less strict than me.
I remember I already said I was bored of the lack of explanations in NXP drivers.

[Hemant] We will improve next time. 
The patch description says:  "> This patch enables the packet timestamping conditionally when Rx 
> offload is enabled for timestamp."
It should be improved with - Enable the timestamping by default when IEEE1588 is enabled irrespective of offload flag.

Patch
diff mbox series

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index a1f19194d..8edd4b3cd 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -524,8 +524,10 @@  dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
 		return ret;
 	}
 
+#if !defined(RTE_LIBRTE_IEEE1588)
 	if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP)
-		dpaa2_enable_ts = true;
+#endif
+	dpaa2_enable_ts = true;
 
 	if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)
 		tx_l3_csum_offload = true;