DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue
@ 2015-07-30  8:34 Wenzhuo Lu
  2015-07-30  9:58 ` Mcnamara, John
  2015-07-31  1:20 ` [dpdk-dev] [PATCH v2] " Wenzhuo Lu
  0 siblings, 2 replies; 6+ messages in thread
From: Wenzhuo Lu @ 2015-07-30  8:34 UTC (permalink / raw)
  To: dev

Ieee1588 reads system time to set its timestamp. On 1G NICs, for example,
i350, system time is disabled by default. It means the ieee1588 timestamp
will always be 0.
This patch enables system time when ieee1588 is enabled.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 56734a3..8fb67ac 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -3898,11 +3898,19 @@ eth_igb_set_mc_addr_list(struct rte_eth_dev *dev,
 	return 0;
 }
 
+#define E1000_TSAUXC_DISABLE_SYSTIME 0x80000000
+
 static int
 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;
+
+	/* Enable system time for it isn't on by default. */
+	tsauxc = E1000_READ_REG(hw, E1000_TSAUXC);
+	tsauxc &= ~E1000_TSAUXC_DISABLE_SYSTIME;
+	E1000_WRITE_REG(hw, E1000_TSAUXC, tsauxc);
 
 	/* Start incrementing the register used to timestamp PTP packets. */
 	E1000_WRITE_REG(hw, E1000_TIMINCA, E1000_TIMINCA_INIT);
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue
  2015-07-30  8:34 [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue Wenzhuo Lu
@ 2015-07-30  9:58 ` Mcnamara, John
  2015-07-31  1:03   ` Lu, Wenzhuo
  2015-07-31  1:20 ` [dpdk-dev] [PATCH v2] " Wenzhuo Lu
  1 sibling, 1 reply; 6+ messages in thread
From: Mcnamara, John @ 2015-07-30  9:58 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Thursday, July 30, 2015 9:34 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue
> 
> Ieee1588 reads system time to set its timestamp. On 1G NICs, for example,
> i350, system time is disabled by default. It means the ieee1588 timestamp
> will always be 0.
> This patch enables system time when ieee1588 is enabled.

Looks good.


> +#define E1000_TSAUXC_DISABLE_SYSTIME 0x80000000

Probably best to move this to the top of the file with the other timesync defines.


I wonder if this would also fix the following known issue with i210 timesyncing from the release notes:

http://dpdk.org/doc/guides/rel_notes/known_issues.html#ieee1588-support-possibly-not-working-with-an-intel-ethernet-controller-i210-nic

I don't have an i210 NIC to test but perhaps someone could verify it.

John

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

* Re: [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue
  2015-07-30  9:58 ` Mcnamara, John
@ 2015-07-31  1:03   ` Lu, Wenzhuo
  0 siblings, 0 replies; 6+ messages in thread
From: Lu, Wenzhuo @ 2015-07-31  1:03 UTC (permalink / raw)
  To: Mcnamara, John, dev

Hi John,

> -----Original Message-----
> From: Mcnamara, John
> Sent: Thursday, July 30, 2015 5:59 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> > Sent: Thursday, July 30, 2015 9:34 AM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue
> >
> > Ieee1588 reads system time to set its timestamp. On 1G NICs, for
> > example, i350, system time is disabled by default. It means the
> > ieee1588 timestamp will always be 0.
> > This patch enables system time when ieee1588 is enabled.
> 
> Looks good.
> 
> 
> > +#define E1000_TSAUXC_DISABLE_SYSTIME 0x80000000
> 
> Probably best to move this to the top of the file with the other timesync defines.
Thanks for looking into this. I'll send a V2.

> 
> 
> I wonder if this would also fix the following known issue with i210 timesyncing
> from the release notes:
> 
> http://dpdk.org/doc/guides/rel_notes/known_issues.html#ieee1588-support-
> possibly-not-working-with-an-intel-ethernet-controller-i210-nic
> 
> I don't have an i210 NIC to test but perhaps someone could verify it.
> 
> John

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

* [dpdk-dev] [PATCH v2] e1000: fix ieee1588 timestamp issue
  2015-07-30  8:34 [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue Wenzhuo Lu
  2015-07-30  9:58 ` Mcnamara, John
@ 2015-07-31  1:20 ` Wenzhuo Lu
  2015-07-31  7:53   ` Mcnamara, John
  1 sibling, 1 reply; 6+ messages in thread
From: Wenzhuo Lu @ 2015-07-31  1:20 UTC (permalink / raw)
  To: dev

Ieee1588 reads system time to set its timestamp. On 1G NICs, for example,
i350, system time is disabled by default. It means the ieee1588 timestamp
will always be 0.
This patch enables system time when ieee1588 is enabled.

v2 changes:
* move the macro to the top of the file with the other timesync defines.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 56734a3..b2f57c4 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -82,6 +82,7 @@
 #define E1000_TIMINCA_INCVALUE 16000000
 #define E1000_TIMINCA_INIT     ((0x02 << E1000_TIMINCA_16NS_SHIFT) \
 				| E1000_TIMINCA_INCVALUE)
+#define E1000_TSAUXC_DISABLE_SYSTIME 0x80000000
 
 static int  eth_igb_configure(struct rte_eth_dev *dev);
 static int  eth_igb_start(struct rte_eth_dev *dev);
@@ -3903,6 +3904,12 @@ 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;
+
+	/* Enable system time for it isn't on by default. */
+	tsauxc = E1000_READ_REG(hw, E1000_TSAUXC);
+	tsauxc &= ~E1000_TSAUXC_DISABLE_SYSTIME;
+	E1000_WRITE_REG(hw, E1000_TSAUXC, tsauxc);
 
 	/* Start incrementing the register used to timestamp PTP packets. */
 	E1000_WRITE_REG(hw, E1000_TIMINCA, E1000_TIMINCA_INIT);
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH v2] e1000: fix ieee1588 timestamp issue
  2015-07-31  1:20 ` [dpdk-dev] [PATCH v2] " Wenzhuo Lu
@ 2015-07-31  7:53   ` Mcnamara, John
  2015-08-03 12:45     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Mcnamara, John @ 2015-07-31  7:53 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, July 31, 2015 2:21 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] e1000: fix ieee1588 timestamp issue
> 
> Ieee1588 reads system time to set its timestamp. On 1G NICs, for example,
> i350, system time is disabled by default. It means the ieee1588 timestamp
> will always be 0.
> This patch enables system time when ieee1588 is enabled.
> 
> v2 changes:
> * move the macro to the top of the file with the other timesync defines.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

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

* Re: [dpdk-dev] [PATCH v2] e1000: fix ieee1588 timestamp issue
  2015-07-31  7:53   ` Mcnamara, John
@ 2015-08-03 12:45     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-08-03 12:45 UTC (permalink / raw)
  To: Lu, Wenzhuo; +Cc: dev

> > Ieee1588 reads system time to set its timestamp. On 1G NICs, for example,
> > i350, system time is disabled by default. It means the ieee1588 timestamp
> > will always be 0.
> > This patch enables system time when ieee1588 is enabled.
> > 
> > v2 changes:
> > * move the macro to the top of the file with the other timesync defines.
> > 
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> 
> Acked-by: John McNamara <john.mcnamara@intel.com>

Applied, thanks

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

end of thread, other threads:[~2015-08-03 12:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30  8:34 [dpdk-dev] [PATCH] e1000: fix ieee1588 timestamp issue Wenzhuo Lu
2015-07-30  9:58 ` Mcnamara, John
2015-07-31  1:03   ` Lu, Wenzhuo
2015-07-31  1:20 ` [dpdk-dev] [PATCH v2] " Wenzhuo Lu
2015-07-31  7:53   ` Mcnamara, John
2015-08-03 12:45     ` 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).