DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/rxtx_callbacks: fix HW timestamp enable
@ 2019-07-25 15:51 Harman Kalra
  2019-07-27 17:14 ` Jerin Jacob Kollanukkaran
  2019-07-29 22:18 ` [dpdk-dev] [PATCH] examples/rxtx_callbacks: fix HW timestamp enable Thomas Monjalon
  0 siblings, 2 replies; 9+ messages in thread
From: Harman Kalra @ 2019-07-25 15:51 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Harman Kalra, barbette

Offloafing Rx timestamp is a device capability than queue capability.
Hence the logic to enable HW timestamp via DEV_RX_OFFLOAD_TIMESTAMP
flag should be before device configuration.

Fixes: cd1dadeb9b2a ("examples/rxtx_callbacks: support HW timestamp")
Cc: barbette@kth.se

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 examples/rxtx_callbacks/main.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index c1abe9e1a..dbcd9f4fc 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -117,6 +117,15 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
+	if (hw_timestamping) {
+		if (!(dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)) {
+			printf("\nERROR: Port %u does not support hardware timestamping\n"
+					, port);
+			return -1;
+		}
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
+	}
+
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -127,15 +136,6 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 
 	rxconf = dev_info.default_rxconf;
 
-	if (hw_timestamping) {
-		if (!(dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP)) {
-			printf("\nERROR: Port %u does not support hardware timestamping\n"
-					, port);
-			return -1;
-		}
-		rxconf.offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
-	}
-
 	for (q = 0; q < rx_rings; q++) {
 		retval = rte_eth_rx_queue_setup(port, q, nb_rxd,
 			rte_eth_dev_socket_id(port), &rxconf, mbuf_pool);
-- 
2.18.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-07-30  9:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25 15:51 [dpdk-dev] [PATCH] examples/rxtx_callbacks: fix HW timestamp enable Harman Kalra
2019-07-27 17:14 ` Jerin Jacob Kollanukkaran
2019-07-27 20:34   ` [dpdk-dev] [PATCH v2 1/2] net/octeontx2: fix ptp performance issue Harman Kalra
2019-07-27 20:34     ` [dpdk-dev] [PATCH v2 2/2] net/octeontx2: support read clock API Harman Kalra
2019-07-29 22:18 ` [dpdk-dev] [PATCH] examples/rxtx_callbacks: fix HW timestamp enable Thomas Monjalon
2019-07-30  6:57   ` [dpdk-dev] [EXT] " Harman Kalra
2019-07-30  7:11     ` Thomas Monjalon
2019-07-30  7:46       ` [dpdk-dev] [PATCH v2] " Harman Kalra
2019-07-30  9:13         ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).