diff options
author | Matias Elo <matias.elo@nokia.com> | 2020-11-18 17:06:30 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2020-12-23 09:57:04 +0200 |
commit | 7be0b7dfd08761ad70853ae2fc53459d9449aaaf (patch) | |
tree | 42d1f76311a3498a4325f2e24d2c4eeedec027b9 /platform/linux-dpdk/include | |
parent | 46d32e73ba24c3fb65a8fc1f83c27164c0b5c5c2 (diff) |
Port c13a23704 "linux-gen: pktio: implement odp_pktout_ts_read() function"
Port original commit from linux-generic.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include')
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_io_internal.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index 91fe0d307..7cf0b4972 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -1,5 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019, Nokia + * Copyright (c) 2019-2020, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -55,6 +55,8 @@ struct pktio_entry { uint8_t chksum_insert : 1; /* Classifier */ uint8_t cls : 1; + /* Tx timestamp */ + uint8_t tx_ts : 1; } enabled; odp_pktio_t handle; /**< pktio handle */ unsigned char ODP_ALIGNED_CACHE pkt_priv[PKTIO_PRIVATE_SIZE]; @@ -84,6 +86,8 @@ struct pktio_entry { struct { odp_atomic_u64_t in_discards; } stats_extra; + /* Latest Tx timestamp */ + odp_atomic_u64_t tx_ts; odp_proto_chksums_t in_chksums; /**< Checksums validation settings */ char name[PKTIO_NAME_LEN]; /**< name of pktio provided to internal pktio_open() calls */ @@ -214,6 +218,18 @@ uint16_t dpdk_pktio_port_id(pktio_entry_t *entry); int input_pkts(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[], int num); +static inline int _odp_pktio_tx_ts_enabled(pktio_entry_t *entry) +{ + return entry->s.enabled.tx_ts; +} + +static inline void _odp_pktio_tx_ts_set(pktio_entry_t *entry) +{ + odp_time_t ts_val = odp_time_global(); + + odp_atomic_store_u64(&entry->s.tx_ts, ts_val.u64); +} + extern const pktio_if_ops_t null_pktio_ops; extern const pktio_if_ops_t dpdk_pktio_ops; extern const pktio_if_ops_t * const pktio_if_ops[]; |