net/dpaa2: support per-port Rx mbuf timestamp
authorHemant Agrawal <hemant.agrawal@nxp.com>
Fri, 10 Jul 2020 16:21:30 +0000 (21:51 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Jul 2020 11:54:54 +0000 (13:54 +0200)
DEV_RX_OFFLOAD_TIMESTAMP is per port, so the internal implementation
shall enable it on per port basis only.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
doc/guides/nics/features/dpaa2.ini
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/dpaa2/dpaa2_ethdev.h
drivers/net/dpaa2/dpaa2_rxtx.c

index 3685e2e..831883d 100644 (file)
@@ -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
index d6658f2..55b12b8 100644 (file)
@@ -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;
index 2e6d26d..e577355 100644 (file)
@@ -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
index 86cb952..4dd1d5f 100644 (file)
@@ -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);