DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx2: fix PTP enable via Rx ofload flags
@ 2019-07-25 15:30 Harman Kalra
  2019-07-27 13:56 ` [dpdk-dev] [PATCH v2] " Harman Kalra
  0 siblings, 1 reply; 3+ messages in thread
From: Harman Kalra @ 2019-07-25 15:30 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda
  Cc: dev, Harman Kalra

Earlier implementation for enabling ptp via RX offload flag was
causing segmentation fault as it was getting executed in the
device configuration stage where RX and TX queues were not
configured. As in the ptp enable process rx queues are used for
mbuf setup while tx queues are used for send descriptor setup.
Moving the logic in dev start as all the resources will be
configured.

Fixes: b5dc3140448ee ("net/octeontx2: support base PTP")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/net/octeontx2/otx2_ethdev.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 725fb2431..f6774d01d 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -1333,16 +1333,6 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev)
 		goto q_irq_fini;
 	}
 
-	/* Enable PTP if it was requested by the app or if it is already
-	 * enabled in PF owning this VF
-	 */
-	memset(&dev->tstamp, 0, sizeof(struct otx2_timesync_info));
-	if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) ||
-	    otx2_ethdev_is_ptp_en(dev))
-		otx2_nix_timesync_enable(eth_dev);
-	else
-		otx2_nix_timesync_disable(eth_dev);
-
 	/*
 	 * Restore queue config when reconfigure followed by
 	 * reconfigure and no queue configure invoked from application case.
@@ -1569,6 +1559,16 @@ otx2_nix_dev_start(struct rte_eth_dev *eth_dev)
 	otx2_eth_set_tx_function(eth_dev);
 	otx2_eth_set_rx_function(eth_dev);
 
+	/* Enable PTP if it was requested by the app or if it is already
+	 * enabled in PF owning this VF
+	 */
+	memset(&dev->tstamp, 0, sizeof(struct otx2_timesync_info));
+	if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) ||
+	    otx2_ethdev_is_ptp_en(dev))
+		otx2_nix_timesync_enable(eth_dev);
+	else
+		otx2_nix_timesync_disable(eth_dev);
+
 	return 0;
 
 rx_disable:
-- 
2.18.0


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

end of thread, other threads:[~2019-07-28 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25 15:30 [dpdk-dev] [PATCH] net/octeontx2: fix PTP enable via Rx ofload flags Harman Kalra
2019-07-27 13:56 ` [dpdk-dev] [PATCH v2] " Harman Kalra
2019-07-28 16:24   ` Jerin Jacob Kollanukkaran

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).