examples/ptpclient: enable Rx timestamp offload
authorHemant Agrawal <hemant.agrawal@nxp.com>
Tue, 23 Feb 2021 06:14:12 +0000 (11:44 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 17 Mar 2021 12:49:12 +0000 (13:49 +0100)
This patch add support to enable Rx offload for timestamp.
It is required to be enabled for some PMDs e.g. dpaa2.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
examples/ptpclient/ptpclient.c

index 09968cd..33b297e 100644 (file)
@@ -197,6 +197,9 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
                return retval;
        }
 
+       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)
+               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
+
        if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                port_conf.txmode.offloads |=
                        DEV_TX_OFFLOAD_MBUF_FAST_FREE;