[dpdk-dev,v3,1/3] ethdev: add Rx HW timestamp capability

Message ID 1506617303-32509-1-git-send-email-rasland@mellanox.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Raslan Darawsheh Sept. 28, 2017, 4:48 p.m. UTC
Add a new offload capability flag for Rx HW timestamp and enabling/disabling
this via rte_eth_rxmode.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 lib/librte_ether/rte_ethdev.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Andrew Rybchenko Sept. 29, 2017, 7:25 a.m. UTC | #1
On 09/28/2017 07:48 PM, Raslan Darawsheh wrote:
> Add a new offload capability flag for Rx HW timestamp and enabling/disabling
> this via rte_eth_rxmode.

I think it should be on top [1] and ideally follow a new offload API without
addition of a new bit field which will be removed soon.

Also, please, update documentation (doc/guides/nics/features.rst)

Andrew.

[1] http://dpdk.org/ml/archives/dev/2017-September/076872.html
  
Shahaf Shuler Oct. 1, 2017, 6:44 a.m. UTC | #2
Hi Andrew,

Friday, September 29, 2017 10:26 AM, Andrew Rybchenko:

>On 09/28/2017 07:48 PM, Raslan Darawsheh wrote:


>>Add a new offload capability flag for Rx HW timestamp and enabling/disabling


>>this via rte_eth_rxmode.

>

>I think it should be on top [1] and ideally follow a new offload API without

>addition of a new bit field which will be removed soon.

>

>Also, please, update documentation (doc/guides/nics/features.rst)

>

>Andrew.

>

>[1] http://dpdk.org/ml/archives/dev/2017-September/076872.html<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpdk.org%2Fml%2Farchives%2Fdev%2F2017-September%2F076872.html&data=02%7C01%7Cshahafs%40mellanox.com%7C029845c0b55d49299f3f08d5070b57e0%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636422667676863312&sdata=83RStoqLwxS55vOFENOq1BDsM%2BhN3QNldpTdfooZMck%3D&reserved=0>


I agree it should be on top of [1].
Unfortunately since the PMDs will move to the new API only on 18.02, and in the current state Rx offloads are disabled by default, there will be no way to enable this feature without a dedicated bit.

So my suggestion is to keep the timestamp bit on rxmode, and to update the convert function introduced on [1]. This bit will be removed along with the entire bit-field array once the old offloads API will be deprecated.
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0adf327..b8f3e16 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -357,7 +357,8 @@  struct rte_eth_rxmode {
 		jumbo_frame      : 1, /**< Jumbo Frame Receipt enable. */
 		hw_strip_crc     : 1, /**< Enable CRC stripping by hardware. */
 		enable_scatter   : 1, /**< Enable scatter packets rx handler */
-		enable_lro       : 1; /**< Enable LRO */
+		enable_lro       : 1, /**< Enable LRO */
+		hw_timestamp	 : 1; /**< Enable HW timestamp */
 };
 
 /**
@@ -907,6 +908,8 @@  struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_QINQ_STRIP  0x00000020
 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
 #define DEV_RX_OFFLOAD_MACSEC_STRIP     0x00000080
+#define DEV_RX_OFFLOAD_TIMESTAMP 0x00000100
+/**< Device delivers timestamp of packet arrival. */
 
 /**
  * TX offload capabilities of a device.