summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
diff options
context:
space:
mode:
authorRaslan Darawsheh <rasland@mellanox.com>2017-10-10 17:37:07 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-12 01:52:49 +0100
commit78c7406b7b5acd3a3498ad619f63c16989ef6956 (patch)
treec9709571360ac6888f92bce9f550a5488a080b14 /drivers/net/mlx5/mlx5_rxtx_vec_neon.h
parent912267a33eede1427e865fc591e3ee2645cd596c (diff)
downloaddpdk-next-eventdev-78c7406b7b5acd3a3498ad619f63c16989ef6956.zip
dpdk-next-eventdev-78c7406b7b5acd3a3498ad619f63c16989ef6956.tar.gz
dpdk-next-eventdev-78c7406b7b5acd3a3498ad619f63c16989ef6956.tar.xz
net/mlx5: add Rx HW timestamp
Expose Rx HW timestamp to packet mbufs. Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxtx_vec_neon.h')
-rw-r--r--drivers/net/mlx5/mlx5_rxtx_vec_neon.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 86b37d5..4cb7f28 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -566,7 +566,9 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
{
uint16x4_t ptype;
uint32x4_t pinfo, cv_flags;
- uint32x4_t ol_flags = vdupq_n_u32(rxq->rss_hash * PKT_RX_RSS_HASH);
+ uint32x4_t ol_flags =
+ vdupq_n_u32(rxq->rss_hash * PKT_RX_RSS_HASH |
+ rxq->hw_timestamp * PKT_RX_TIMESTAMP);
const uint32x4_t ptype_ol_mask = { 0x106, 0x106, 0x106, 0x106 };
const uint8x16_t cv_flag_sel = {
0,
@@ -973,6 +975,24 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
/* C.4 fill in mbuf - rearm_data and packet_type. */
rxq_cq_to_ptype_oflags_v(rxq, ptype_info, flow_tag,
opcode, &elts[pos]);
+ if (rxq->hw_timestamp) {
+ elts[pos]->timestamp =
+ rte_be_to_cpu_64(
+ container_of(p0, struct mlx5_cqe,
+ pkt_info)->timestamp);
+ elts[pos + 1]->timestamp =
+ rte_be_to_cpu_64(
+ container_of(p1, struct mlx5_cqe,
+ pkt_info)->timestamp);
+ elts[pos + 2]->timestamp =
+ rte_be_to_cpu_64(
+ container_of(p2, struct mlx5_cqe,
+ pkt_info)->timestamp);
+ elts[pos + 3]->timestamp =
+ rte_be_to_cpu_64(
+ container_of(p3, struct mlx5_cqe,
+ pkt_info)->timestamp);
+ }
#ifdef MLX5_PMD_SOFT_COUNTERS
/* Add up received bytes count. */
byte_cnt = vbic_u16(byte_cnt, invalid_mask);