DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 1/3] net/ixgbe: initialize PTP to system time
@ 2024-11-22 15:18 Anatoly Burakov
  2024-11-22 15:18 ` [PATCH v1 2/3] net/i40e: " Anatoly Burakov
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Anatoly Burakov @ 2024-11-22 15:18 UTC (permalink / raw)
  To: dev, Vladimir Medvedkin

Currently, ixgbe driver initializes PTP timestamp to 0. This is different
from what kernel driver does (which initializes it to system time).

Align the DPDK driver to kernel driver by setting PTP timestamp to system
time when enabling PTP.

Note that ixgbe driver always uses zero-based timestamps for PTP, so we
would only ever update the internal timecounter and not the actual NIC
registers.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d02d1e43a3..8bc706f97b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6924,6 +6924,12 @@ ixgbe_timesync_enable(struct rte_eth_dev *dev)
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t tsync_ctl;
 	uint32_t tsauxc;
+	struct timespec ts;
+
+	memset(&ts, 0, sizeof(struct timespec));
+
+	/* get current system time */
+	clock_gettime(CLOCK_REALTIME, &ts);
 
 	/* Stop the timesync system time. */
 	IXGBE_WRITE_REG(hw, IXGBE_TIMINCA, 0x0);
@@ -6956,6 +6962,9 @@ ixgbe_timesync_enable(struct rte_eth_dev *dev)
 
 	IXGBE_WRITE_FLUSH(hw);
 
+	/* ixgbe uses zero-based timestamping so only adjust timecounter */
+	ixgbe_timesync_write_time(dev, &ts);
+
 	return 0;
 }
 
-- 
2.43.5


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

* [PATCH v1 2/3] net/i40e: initialize PTP to system time
  2024-11-22 15:18 [PATCH v1 1/3] net/ixgbe: initialize PTP to system time Anatoly Burakov
@ 2024-11-22 15:18 ` Anatoly Burakov
  2024-11-22 15:18 ` [PATCH v1 3/3] net/e1000: " Anatoly Burakov
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
  2 siblings, 0 replies; 12+ messages in thread
From: Anatoly Burakov @ 2024-11-22 15:18 UTC (permalink / raw)
  To: dev, Ian Stokes, Bruce Richardson

Currently, i40e driver initializes PTP timestamp to 0. This is different
from what kernel driver does (which initializes it to system time).

Align the DPDK driver to kernel driver by setting PTP timestamp to system
time when enabling PTP.

Note that i40e driver always uses zero-based timestamps for PTP, so we
would only ever update the internal timecounter and not the actual NIC
registers.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index ca128c7556..30dcdc68a8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -10556,6 +10556,9 @@ i40e_timesync_enable(struct rte_eth_dev *dev)
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t tsync_ctl_l;
 	uint32_t tsync_ctl_h;
+	struct timespec ts;
+
+	memset(&ts, 0, sizeof(struct timespec));
 
 	/* Stop the timesync system time. */
 	I40E_WRITE_REG(hw, I40E_PRTTSYN_INC_L, 0x0);
@@ -10585,6 +10588,9 @@ i40e_timesync_enable(struct rte_eth_dev *dev)
 	I40E_WRITE_REG(hw, I40E_PRTTSYN_CTL0, tsync_ctl_l);
 	I40E_WRITE_REG(hw, I40E_PRTTSYN_CTL1, tsync_ctl_h);
 
+	/* i40e uses zero-based timestamping so only adjust timecounter */
+	i40e_timesync_write_time(dev, &ts);
+
 	return 0;
 }
 
-- 
2.43.5


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

* [PATCH v1 3/3] net/e1000: initialize PTP to system time
  2024-11-22 15:18 [PATCH v1 1/3] net/ixgbe: initialize PTP to system time Anatoly Burakov
  2024-11-22 15:18 ` [PATCH v1 2/3] net/i40e: " Anatoly Burakov
@ 2024-11-22 15:18 ` Anatoly Burakov
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
  2 siblings, 0 replies; 12+ messages in thread
From: Anatoly Burakov @ 2024-11-22 15:18 UTC (permalink / raw)
  To: dev

Currently, e1000 driver initializes PTP timestamp to 0. This is different
from what kernel driver does (which initializes it to system time).

Align the DPDK driver to kernel driver by setting PTP timestamp to system
time when enabling PTP.

Note that e1000 driver always uses zero-based timestamps for PTP, so we
would only ever update the internal timecounter and not the actual NIC
registers.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index d3a9181874..c695f44c4c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -4817,6 +4817,9 @@ igb_timesync_enable(struct rte_eth_dev *dev)
 	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t tsync_ctl;
 	uint32_t tsauxc;
+	struct timespec ts;
+
+	memset(&ts, 0, sizeof(struct timespec));
 
 	/* Stop the timesync system time. */
 	E1000_WRITE_REG(hw, E1000_TIMINCA, 0x0);
@@ -4861,6 +4864,9 @@ igb_timesync_enable(struct rte_eth_dev *dev)
 	tsync_ctl |= E1000_TSYNCTXCTL_ENABLED;
 	E1000_WRITE_REG(hw, E1000_TSYNCTXCTL, tsync_ctl);
 
+	/* e1000 uses zero-based timestamping so only adjust timecounter */
+	igb_timesync_write_time(dev, &ts);
+
 	return 0;
 }
 
-- 
2.43.5


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

* [PATCH v2 1/3] net/ixgbe: initialize PTP to system time
  2024-11-22 15:18 [PATCH v1 1/3] net/ixgbe: initialize PTP to system time Anatoly Burakov
  2024-11-22 15:18 ` [PATCH v1 2/3] net/i40e: " Anatoly Burakov
  2024-11-22 15:18 ` [PATCH v1 3/3] net/e1000: " Anatoly Burakov
@ 2024-11-25 11:33 ` Anatoly Burakov
  2024-11-25 11:33   ` [PATCH v2 2/3] net/i40e: " Anatoly Burakov
                     ` (4 more replies)
  2 siblings, 5 replies; 12+ messages in thread
From: Anatoly Burakov @ 2024-11-25 11:33 UTC (permalink / raw)
  To: dev, Vladimir Medvedkin

Currently, ixgbe driver initializes PTP timestamp to 0. This is different
from what kernel driver does (which initializes it to system time).

Align the DPDK driver to kernel driver by setting PTP timestamp to system
time when enabling PTP.

Note that ixgbe driver always uses zero-based timestamps for PTP, so we
would only ever update the internal timecounter and not the actual NIC
registers.

Implementation note: in order to get access to clock_gettime on MinGW, we
have to use rte_os_shim.h header, which provides a wrapper around that
function. However, what it *also* provides is wrapper macros around various
other OS-related functions such as read(). Due to one of the mailbox ops
in base code being called "read", MinGW will misinterpret a call into
that op as an attempt to call read() the OS function, and produce a
compile error. This is being worked around by using parentheses around
access to the read op.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d02d1e43a3..277fdbc9f2 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -35,6 +35,7 @@
 #ifdef RTE_LIB_SECURITY
 #include <rte_security_driver.h>
 #endif
+#include <rte_os_shim.h>
 
 #include "ixgbe_logs.h"
 #include "base/ixgbe_api.h"
@@ -4168,7 +4169,12 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	/* if the read failed it could just be a mailbox collision, best wait
 	 * until we are called again and don't report an error
 	 */
-	if (mbx->ops[0].read(hw, &in_msg, 1, 0))
+
+	/*
+	 * on MinGW, the read op call is interpreted as call into read() macro,
+	 * so avoid calling it directly.
+	 */
+	if ((mbx->ops[0].read)(hw, &in_msg, 1, 0))
 		goto out;
 
 	if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
@@ -6924,6 +6930,12 @@ ixgbe_timesync_enable(struct rte_eth_dev *dev)
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t tsync_ctl;
 	uint32_t tsauxc;
+	struct timespec ts;
+
+	memset(&ts, 0, sizeof(struct timespec));
+
+	/* get current system time */
+	clock_gettime(CLOCK_REALTIME, &ts);
 
 	/* Stop the timesync system time. */
 	IXGBE_WRITE_REG(hw, IXGBE_TIMINCA, 0x0);
@@ -6956,6 +6968,9 @@ ixgbe_timesync_enable(struct rte_eth_dev *dev)
 
 	IXGBE_WRITE_FLUSH(hw);
 
+	/* ixgbe uses zero-based timestamping so only adjust timecounter */
+	ixgbe_timesync_write_time(dev, &ts);
+
 	return 0;
 }
 
-- 
2.43.5


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

* [PATCH v2 2/3] net/i40e: initialize PTP to system time
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
@ 2024-11-25 11:33   ` Anatoly Burakov
  2024-11-26 15:44     ` Bruce Richardson
  2024-11-25 11:33   ` [PATCH v2 3/3] net/e1000: " Anatoly Burakov
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Anatoly Burakov @ 2024-11-25 11:33 UTC (permalink / raw)
  To: dev, Ian Stokes, Bruce Richardson

Currently, i40e driver initializes PTP timestamp to 0. This is different
from what kernel driver does (which initializes it to system time).

Align the DPDK driver to kernel driver by setting PTP timestamp to system
time when enabling PTP.

Note that i40e driver always uses zero-based timestamps for PTP, so we
would only ever update the internal timecounter and not the actual NIC
registers.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index ca128c7556..30dcdc68a8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -10556,6 +10556,9 @@ i40e_timesync_enable(struct rte_eth_dev *dev)
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t tsync_ctl_l;
 	uint32_t tsync_ctl_h;
+	struct timespec ts;
+
+	memset(&ts, 0, sizeof(struct timespec));
 
 	/* Stop the timesync system time. */
 	I40E_WRITE_REG(hw, I40E_PRTTSYN_INC_L, 0x0);
@@ -10585,6 +10588,9 @@ i40e_timesync_enable(struct rte_eth_dev *dev)
 	I40E_WRITE_REG(hw, I40E_PRTTSYN_CTL0, tsync_ctl_l);
 	I40E_WRITE_REG(hw, I40E_PRTTSYN_CTL1, tsync_ctl_h);
 
+	/* i40e uses zero-based timestamping so only adjust timecounter */
+	i40e_timesync_write_time(dev, &ts);
+
 	return 0;
 }
 
-- 
2.43.5


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

* [PATCH v2 3/3] net/e1000: initialize PTP to system time
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
  2024-11-25 11:33   ` [PATCH v2 2/3] net/i40e: " Anatoly Burakov
@ 2024-11-25 11:33   ` Anatoly Burakov
  2024-11-26  8:30     ` Xu, HailinX
  2024-11-26 15:44     ` Bruce Richardson
  2024-11-26  8:30   ` [PATCH v2 1/3] net/ixgbe: " Xu, HailinX
                     ` (2 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Anatoly Burakov @ 2024-11-25 11:33 UTC (permalink / raw)
  To: dev

Currently, e1000 driver initializes PTP timestamp to 0. This is different
from what kernel driver does (which initializes it to system time).

Align the DPDK driver to kernel driver by setting PTP timestamp to system
time when enabling PTP.

Note that e1000 driver always uses zero-based timestamps for PTP, so we
would only ever update the internal timecounter and not the actual NIC
registers.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index d3a9181874..c695f44c4c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -4817,6 +4817,9 @@ igb_timesync_enable(struct rte_eth_dev *dev)
 	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t tsync_ctl;
 	uint32_t tsauxc;
+	struct timespec ts;
+
+	memset(&ts, 0, sizeof(struct timespec));
 
 	/* Stop the timesync system time. */
 	E1000_WRITE_REG(hw, E1000_TIMINCA, 0x0);
@@ -4861,6 +4864,9 @@ igb_timesync_enable(struct rte_eth_dev *dev)
 	tsync_ctl |= E1000_TSYNCTXCTL_ENABLED;
 	E1000_WRITE_REG(hw, E1000_TSYNCTXCTL, tsync_ctl);
 
+	/* e1000 uses zero-based timestamping so only adjust timecounter */
+	igb_timesync_write_time(dev, &ts);
+
 	return 0;
 }
 
-- 
2.43.5


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

* RE: [PATCH v2 1/3] net/ixgbe: initialize PTP to system time
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
  2024-11-25 11:33   ` [PATCH v2 2/3] net/i40e: " Anatoly Burakov
  2024-11-25 11:33   ` [PATCH v2 3/3] net/e1000: " Anatoly Burakov
@ 2024-11-26  8:30   ` Xu, HailinX
  2024-11-26 15:43   ` Bruce Richardson
  2024-11-26 16:09   ` Bruce Richardson
  4 siblings, 0 replies; 12+ messages in thread
From: Xu, HailinX @ 2024-11-26  8:30 UTC (permalink / raw)
  To: Burakov, Anatoly, dev, Medvedkin, Vladimir

> -----Original Message-----
> From: Anatoly Burakov <anatoly.burakov@intel.com>
> Sent: Monday, November 25, 2024 7:33 PM
> To: dev@dpdk.org; Medvedkin, Vladimir <vladimir.medvedkin@intel.com>
> Subject: [PATCH v2 1/3] net/ixgbe: initialize PTP to system time
> 
> Currently, ixgbe driver initializes PTP timestamp to 0. This is different from
> what kernel driver does (which initializes it to system time).
> 
> Align the DPDK driver to kernel driver by setting PTP timestamp to system time
> when enabling PTP.
> 
> Note that ixgbe driver always uses zero-based timestamps for PTP, so we
> would only ever update the internal timecounter and not the actual NIC
> registers.
> 
> Implementation note: in order to get access to clock_gettime on MinGW, we
> have to use rte_os_shim.h header, which provides a wrapper around that
> function. However, what it *also* provides is wrapper macros around various
> other OS-related functions such as read(). Due to one of the mailbox ops in
> base code being called "read", MinGW will misinterpret a call into that op as an
> attempt to call read() the OS function, and produce a compile error. This is
> being worked around by using parentheses around access to the read op.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Tested-by: Hailin Xu <hailinx.xu@intel.com>

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

* RE: [PATCH v2 3/3] net/e1000: initialize PTP to system time
  2024-11-25 11:33   ` [PATCH v2 3/3] net/e1000: " Anatoly Burakov
@ 2024-11-26  8:30     ` Xu, HailinX
  2024-11-26 15:44     ` Bruce Richardson
  1 sibling, 0 replies; 12+ messages in thread
From: Xu, HailinX @ 2024-11-26  8:30 UTC (permalink / raw)
  To: Burakov, Anatoly, dev

> -----Original Message-----
> From: Anatoly Burakov <anatoly.burakov@intel.com>
> Sent: Monday, November 25, 2024 7:33 PM
> To: dev@dpdk.org
> Subject: [PATCH v2 3/3] net/e1000: initialize PTP to system time
> 
> Currently, e1000 driver initializes PTP timestamp to 0. This is different from
> what kernel driver does (which initializes it to system time).
> 
> Align the DPDK driver to kernel driver by setting PTP timestamp to system time
> when enabling PTP.
> 
> Note that e1000 driver always uses zero-based timestamps for PTP, so we
> would only ever update the internal timecounter and not the actual NIC
> registers.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Tested-by: Hailin Xu <hailinx.xu@intel.com>

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

* Re: [PATCH v2 1/3] net/ixgbe: initialize PTP to system time
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
                     ` (2 preceding siblings ...)
  2024-11-26  8:30   ` [PATCH v2 1/3] net/ixgbe: " Xu, HailinX
@ 2024-11-26 15:43   ` Bruce Richardson
  2024-11-26 16:09   ` Bruce Richardson
  4 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2024-11-26 15:43 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, Vladimir Medvedkin

On Mon, Nov 25, 2024 at 11:33:24AM +0000, Anatoly Burakov wrote:
> Currently, ixgbe driver initializes PTP timestamp to 0. This is different
> from what kernel driver does (which initializes it to system time).
> 
> Align the DPDK driver to kernel driver by setting PTP timestamp to system
> time when enabling PTP.
> 
> Note that ixgbe driver always uses zero-based timestamps for PTP, so we
> would only ever update the internal timecounter and not the actual NIC
> registers.
> 
> Implementation note: in order to get access to clock_gettime on MinGW, we
> have to use rte_os_shim.h header, which provides a wrapper around that
> function. However, what it *also* provides is wrapper macros around various
> other OS-related functions such as read(). Due to one of the mailbox ops
> in base code being called "read", MinGW will misinterpret a call into
> that op as an attempt to call read() the OS function, and produce a
> compile error. This is being worked around by using parentheses around
> access to the read op.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [PATCH v2 2/3] net/i40e: initialize PTP to system time
  2024-11-25 11:33   ` [PATCH v2 2/3] net/i40e: " Anatoly Burakov
@ 2024-11-26 15:44     ` Bruce Richardson
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2024-11-26 15:44 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, Ian Stokes

On Mon, Nov 25, 2024 at 11:33:25AM +0000, Anatoly Burakov wrote:
> Currently, i40e driver initializes PTP timestamp to 0. This is different
> from what kernel driver does (which initializes it to system time).
> 
> Align the DPDK driver to kernel driver by setting PTP timestamp to system
> time when enabling PTP.
> 
> Note that i40e driver always uses zero-based timestamps for PTP, so we
> would only ever update the internal timecounter and not the actual NIC
> registers.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [PATCH v2 3/3] net/e1000: initialize PTP to system time
  2024-11-25 11:33   ` [PATCH v2 3/3] net/e1000: " Anatoly Burakov
  2024-11-26  8:30     ` Xu, HailinX
@ 2024-11-26 15:44     ` Bruce Richardson
  1 sibling, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2024-11-26 15:44 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev

On Mon, Nov 25, 2024 at 11:33:26AM +0000, Anatoly Burakov wrote:
> Currently, e1000 driver initializes PTP timestamp to 0. This is different
> from what kernel driver does (which initializes it to system time).
> 
> Align the DPDK driver to kernel driver by setting PTP timestamp to system
> time when enabling PTP.
> 
> Note that e1000 driver always uses zero-based timestamps for PTP, so we
> would only ever update the internal timecounter and not the actual NIC
> registers.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [PATCH v2 1/3] net/ixgbe: initialize PTP to system time
  2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
                     ` (3 preceding siblings ...)
  2024-11-26 15:43   ` Bruce Richardson
@ 2024-11-26 16:09   ` Bruce Richardson
  4 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2024-11-26 16:09 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, Vladimir Medvedkin

On Mon, Nov 25, 2024 at 11:33:24AM +0000, Anatoly Burakov wrote:
> Currently, ixgbe driver initializes PTP timestamp to 0. This is different
> from what kernel driver does (which initializes it to system time).
> 
> Align the DPDK driver to kernel driver by setting PTP timestamp to system
> time when enabling PTP.
> 
> Note that ixgbe driver always uses zero-based timestamps for PTP, so we
> would only ever update the internal timecounter and not the actual NIC
> registers.
> 
> Implementation note: in order to get access to clock_gettime on MinGW, we
> have to use rte_os_shim.h header, which provides a wrapper around that
> function. However, what it *also* provides is wrapper macros around various
> other OS-related functions such as read(). Due to one of the mailbox ops
> in base code being called "read", MinGW will misinterpret a call into
> that op as an attempt to call read() the OS function, and produce a
> compile error. This is being worked around by using parentheses around
> access to the read op.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---

Series applied to dpdk-next-net-intel.

Thanks,
/Bruce

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

end of thread, other threads:[~2024-11-26 16:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-22 15:18 [PATCH v1 1/3] net/ixgbe: initialize PTP to system time Anatoly Burakov
2024-11-22 15:18 ` [PATCH v1 2/3] net/i40e: " Anatoly Burakov
2024-11-22 15:18 ` [PATCH v1 3/3] net/e1000: " Anatoly Burakov
2024-11-25 11:33 ` [PATCH v2 1/3] net/ixgbe: " Anatoly Burakov
2024-11-25 11:33   ` [PATCH v2 2/3] net/i40e: " Anatoly Burakov
2024-11-26 15:44     ` Bruce Richardson
2024-11-25 11:33   ` [PATCH v2 3/3] net/e1000: " Anatoly Burakov
2024-11-26  8:30     ` Xu, HailinX
2024-11-26 15:44     ` Bruce Richardson
2024-11-26  8:30   ` [PATCH v2 1/3] net/ixgbe: " Xu, HailinX
2024-11-26 15:43   ` Bruce Richardson
2024-11-26 16:09   ` Bruce Richardson

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