From: Hemant Agrawal Date: Fri, 10 Jul 2020 16:21:30 +0000 (+0530) Subject: net/dpaa2: support per-port Rx mbuf timestamp X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=724f79dff0a8667952f8e0f954eac1071448f08a;p=dpdk.git net/dpaa2: support per-port Rx mbuf timestamp DEV_RX_OFFLOAD_TIMESTAMP is per port, so the internal implementation shall enable it on per port basis only. Signed-off-by: Hemant Agrawal --- diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 3685e2e023..831883d211 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -21,6 +21,8 @@ VLAN offload = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y +Timesync = Y +Timestamp offload = Y Basic stats = Y Extended stats = Y FW version = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index d6658f20bf..55b12b8837 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -64,7 +64,7 @@ static uint64_t dev_tx_offloads_nodis = DEV_TX_OFFLOAD_MULTI_SEGS; /* enable timestamp in mbuf */ -bool dpaa2_enable_ts; +bool dpaa2_enable_ts[RTE_MAX_ETHPORTS]; struct rte_dpaa2_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; @@ -519,7 +519,7 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) #if !defined(RTE_LIBRTE_IEEE1588) if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) #endif - dpaa2_enable_ts = true; + dpaa2_enable_ts[dev->data->port_id] = true; if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) tx_l3_csum_offload = true; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 2e6d26d4f9..e577355d57 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -91,7 +91,7 @@ #define DPAA2_PKT_TYPE_VLAN_2 0x0260 /* enable timestamp in mbuf*/ -extern bool dpaa2_enable_ts; +extern bool dpaa2_enable_ts[]; #define DPAA2_QOS_TABLE_RECONFIGURE 1 #define DPAA2_FS_TABLE_RECONFIGURE 2 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 86cb952684..4dd1d5f578 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -108,7 +108,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd, m->hash.rss = fd->simple.flc_hi; m->ol_flags |= PKT_RX_RSS_HASH; - if (dpaa2_enable_ts) { + if (dpaa2_enable_ts[m->port]) { m->timestamp = annotation->word2; m->ol_flags |= PKT_RX_TIMESTAMP; DPAA2_PMD_DP_DEBUG("pkt timestamp:0x%" PRIx64 "", m->timestamp);