DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
@ 2014-11-07 17:31 Jia Yu
  2014-11-07 17:31 ` [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Jia Yu
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jia Yu @ 2014-11-07 17:31 UTC (permalink / raw)
  To: dev

This patch series include a fix and an improvement to rte_ethdev lib.

Jia Yu (2):
  rte_ethdev: update link status (speed, duplex, link_up) after
    rte_eth_dev_start
  rte_ethdev: add return status for rte_eth_stats_get

 lib/librte_ether/rte_ethdev.c | 11 ++++++++---
 lib/librte_ether/rte_ethdev.h |  4 +++-
 2 files changed, 11 insertions(+), 4 deletions(-)

-- 
1.9.1

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

* [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2014-11-07 17:31 [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Jia Yu
@ 2014-11-07 17:31 ` Jia Yu
  2014-11-12  3:57   ` Zhang, Helin
  2014-11-07 17:31 ` [dpdk-dev] [PATCH 2/2] rte_ethdev: add return status for rte_eth_stats_get Jia Yu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Jia Yu @ 2014-11-07 17:31 UTC (permalink / raw)
  To: dev

Since LSR interrupt is disabled by pmd drivers, link status in rte_eth_device is always down.
Bond slave_configure() enables LSR interrupt on devices to get notification if link status
changes. However, the LSC interrupt at device start time is still lost.

In this fix, call link_update to read link status from hardware
register at device start time.

Issue:
Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
Signed-off-by: Jia Yu <jyu@vmware.com>
---
 lib/librte_ether/rte_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ff1c769..6c01b02 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
 
 	rte_eth_dev_config_restore(port_id);
 
+	if (dev->data->dev_conf.intr_conf.lsc != 0) {
+		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP);
+		(*dev->dev_ops->link_update)(dev, 0);
+	}
 	return 0;
 }
 
-- 
1.9.1

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

* [dpdk-dev] [PATCH 2/2] rte_ethdev: add return status for rte_eth_stats_get
  2014-11-07 17:31 [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Jia Yu
  2014-11-07 17:31 ` [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Jia Yu
@ 2014-11-07 17:31 ` Jia Yu
  2014-11-10  9:40 ` [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Thomas Monjalon
  2015-02-11  3:20 ` Zhang, Helin
  3 siblings, 0 replies; 14+ messages in thread
From: Jia Yu @ 2014-11-07 17:31 UTC (permalink / raw)
  To: dev

rte_eth_stats_get is to get physical device statistics. Without
return status, caller does not know whether function fails or not
(i.e. invalid port_id, driver has no stats_get callback). Caller
cannot differiente normal 0 stats or error case. This fix adds
a return status to the function.

Signed-off-by: Jia Yu <jyu@vmware.com>
---
 lib/librte_ether/rte_ethdev.c | 7 ++++---
 lib/librte_ether/rte_ethdev.h | 4 +++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 6c01b02..4ec9ca6 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1226,21 +1226,22 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link)
 	}
 }
 
-void
+int
 rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
 {
 	struct rte_eth_dev *dev;
 
 	if (port_id >= nb_ports) {
 		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return;
+		return (-ENODEV);
 	}
 	dev = &rte_eth_devices[port_id];
 	memset(stats, 0, sizeof(*stats));
 
-	FUNC_PTR_OR_RET(*dev->dev_ops->stats_get);
+	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
 	(*dev->dev_ops->stats_get)(dev, stats);
 	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
+        return 0;
 }
 
 void
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8bf274d..e29e9be 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2054,8 +2054,10 @@ extern void rte_eth_link_get_nowait(uint8_t port_id,
  *   - *obytes*   with the total of successfully transmitted bytes.
  *   - *ierrors*  with the total of erroneous received packets.
  *   - *oerrors*  with the total of failed transmitted packets.
+ * @return
+ *   Zero if successful. Non-zero otherwise.
  */
-extern void rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
+extern int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
 
 /**
  * Reset the general I/O statistics of an Ethernet device.
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
  2014-11-07 17:31 [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Jia Yu
  2014-11-07 17:31 ` [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Jia Yu
  2014-11-07 17:31 ` [dpdk-dev] [PATCH 2/2] rte_ethdev: add return status for rte_eth_stats_get Jia Yu
@ 2014-11-10  9:40 ` Thomas Monjalon
  2014-11-11 23:48   ` Jia Yu
  2015-02-11  3:20 ` Zhang, Helin
  3 siblings, 1 reply; 14+ messages in thread
From: Thomas Monjalon @ 2014-11-10  9:40 UTC (permalink / raw)
  To: Jia Yu; +Cc: dev

Hi Jia,

2014-11-07 09:31, Jia Yu:
> This patch series include a fix and an improvement to rte_ethdev lib.

New enhancements won't be integrated in release 1.8.
But fixes are welcome.
The problem is that it's not easy to track partially applies patchset.
So it would be simpler if you send your fix separately.

Thanks
-- 
Thomas

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

* Re: [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
  2014-11-10  9:40 ` [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Thomas Monjalon
@ 2014-11-11 23:48   ` Jia Yu
  2014-11-12  9:35     ` Thomas Monjalon
  0 siblings, 1 reply; 14+ messages in thread
From: Jia Yu @ 2014-11-11 23:48 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

Thanks, Thomas.

The two patches are minor fixes. No new API is introduced. I will revise
the description.

Thanks,
Jia

On 11/10/14, 1:40 AM, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote:

>Hi Jia,
>
>2014-11-07 09:31, Jia Yu:
>> This patch series include a fix and an improvement to rte_ethdev lib.
>
>New enhancements won't be integrated in release 1.8.
>But fixes are welcome.
>The problem is that it's not easy to track partially applies patchset.
>So it would be simpler if you send your fix separately.
>
>Thanks
>-- 
>Thomas

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

* Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2014-11-07 17:31 ` [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Jia Yu
@ 2014-11-12  3:57   ` Zhang, Helin
  2015-01-30 10:28     ` Thomas Monjalon
  0 siblings, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2014-11-12  3:57 UTC (permalink / raw)
  To: Jia Yu, dev

Hi Jia

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
> Sent: Saturday, November 8, 2014 1:32 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex,
> link_up) after rte_eth_dev_start
> 
> Since LSR interrupt is disabled by pmd drivers, link status in rte_eth_device is
> always down.
If LSC interrupt is disabled by default, it will poll the link status during the initialization
or in dev_start, and then the link status should he correct. If I am not wrong.

> Bond slave_configure() enables LSR interrupt on devices to get notification if link
> status changes. However, the LSC interrupt at device start time is still lost.
Before enabling interrupt for LSC, the link status should be polled. So after the port
startup, the link status should be there.

> 
> In this fix, call link_update to read link status from hardware register at device
> start time.
Could you help to explain this code changes a bit more? Why we need it?

> 
> Issue:
> Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
> Signed-off-by: Jia Yu <jyu@vmware.com>
> ---
>  lib/librte_ether/rte_ethdev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index
> ff1c769..6c01b02 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
> 
>  	rte_eth_dev_config_restore(port_id);
> 
> +	if (dev->data->dev_conf.intr_conf.lsc != 0) {
> +		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP);
> +		(*dev->dev_ops->link_update)(dev, 0);
> +	}
>  	return 0;
>  }
> 
> --
> 1.9.1

Regards,
Helin

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

* Re: [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
  2014-11-11 23:48   ` Jia Yu
@ 2014-11-12  9:35     ` Thomas Monjalon
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Monjalon @ 2014-11-12  9:35 UTC (permalink / raw)
  To: Jia Yu; +Cc: dev

2014-11-11 23:48, Jia Yu:
> The two patches are minor fixes. No new API is introduced.

You are changing the API of rte_eth_stats_get().
It's a tricky corner case because it's a light change which should have
no impact. Anyone against changing the void return into int? Impact in mind?
I can integrate it if someone else vote for.

-- 
Thomas

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

* Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2014-11-12  3:57   ` Zhang, Helin
@ 2015-01-30 10:28     ` Thomas Monjalon
  2015-02-03  8:00       ` Jia Yu
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Monjalon @ 2015-01-30 10:28 UTC (permalink / raw)
  To: Jia Yu; +Cc: dev

Jia, any news on this patchset?

2014-11-12 03:57, Zhang, Helin:
> Hi Jia
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
> > Sent: Saturday, November 8, 2014 1:32 AM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex,
> > link_up) after rte_eth_dev_start
> > 
> > Since LSR interrupt is disabled by pmd drivers, link status in rte_eth_device is
> > always down.
> If LSC interrupt is disabled by default, it will poll the link status during the initialization
> or in dev_start, and then the link status should he correct. If I am not wrong.
> 
> > Bond slave_configure() enables LSR interrupt on devices to get notification if link
> > status changes. However, the LSC interrupt at device start time is still lost.
> Before enabling interrupt for LSC, the link status should be polled. So after the port
> startup, the link status should be there.
> 
> > 
> > In this fix, call link_update to read link status from hardware register at device
> > start time.
> Could you help to explain this code changes a bit more? Why we need it?
> 
> > 
> > Issue:
> > Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
> > Signed-off-by: Jia Yu <jyu@vmware.com>
> > ---
> >  lib/librte_ether/rte_ethdev.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index
> > ff1c769..6c01b02 100644
> > --- a/lib/librte_ether/rte_ethdev.c
> > +++ b/lib/librte_ether/rte_ethdev.c
> > @@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
> > 
> >  	rte_eth_dev_config_restore(port_id);
> > 
> > +	if (dev->data->dev_conf.intr_conf.lsc != 0) {
> > +		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP);
> > +		(*dev->dev_ops->link_update)(dev, 0);
> > +	}
> >  	return 0;
> >  }
> > 
> > --
> > 1.9.1
> 
> Regards,
> Helin

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

* Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2015-01-30 10:28     ` Thomas Monjalon
@ 2015-02-03  8:00       ` Jia Yu
  2015-02-03  8:35         ` Zhang, Helin
  0 siblings, 1 reply; 14+ messages in thread
From: Jia Yu @ 2015-02-03  8:00 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

My answer to Helin¹s comments:

This patch is needed for bond slave devices or other devices, when LSC
interrupt is enabled.
 1. slave_configure()  -> slave_eth_dev->Š.lsc = 1

 2. rte_eth_link_get() reads dev_link from eth_dev, when lsc interrupt is
enabled. However, the dev_link on eth_dev has not be initialized and
showed link down state. This patch initializes the device¹s dev_link at
rte_eth_dev_start time.

Please let me know if you have further questions/comments.

Thanks,
Jia

On 1/30/15, 2:28 AM, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote:

>Jia, any news on this patchset?
>
>2014-11-12 03:57, Zhang, Helin:
>> Hi Jia
>> 
>> > -----Original Message-----
>> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
>> > Sent: Saturday, November 8, 2014 1:32 AM
>> > To: dev@dpdk.org
>> > Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status
>>(speed, duplex,
>> > link_up) after rte_eth_dev_start
>> > 
>> > Since LSR interrupt is disabled by pmd drivers, link status in
>>rte_eth_device is
>> > always down.
>> If LSC interrupt is disabled by default, it will poll the link status
>>during the initialization
>> or in dev_start, and then the link status should he correct. If I am
>>not wrong.
>> 
>> > Bond slave_configure() enables LSR interrupt on devices to get
>>notification if link
>> > status changes. However, the LSC interrupt at device start time is
>>still lost.
>> Before enabling interrupt for LSC, the link status should be polled. So
>>after the port
>> startup, the link status should be there.
>> 
>> > 
>> > In this fix, call link_update to read link status from hardware
>>register at device
>> > start time.
>> Could you help to explain this code changes a bit more? Why we need it?
>> 
>> > 
>> > Issue:
>> > Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
>> > Signed-off-by: Jia Yu <jyu@vmware.com>
>> > ---
>> >  lib/librte_ether/rte_ethdev.c | 4 ++++
>> >  1 file changed, 4 insertions(+)
>> > 
>> > diff --git a/lib/librte_ether/rte_ethdev.c
>>b/lib/librte_ether/rte_ethdev.c index
>> > ff1c769..6c01b02 100644
>> > --- a/lib/librte_ether/rte_ethdev.c
>> > +++ b/lib/librte_ether/rte_ethdev.c
>> > @@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
>> > 
>> >  	rte_eth_dev_config_restore(port_id);
>> > 
>> > +	if (dev->data->dev_conf.intr_conf.lsc != 0) {
>> > +		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP);
>> > +		(*dev->dev_ops->link_update)(dev, 0);
>> > +	}
>> >  	return 0;
>> >  }
>> > 
>> > --
>> > 1.9.1
>> 
>> Regards,
>> Helin
>

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

* Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2015-02-03  8:00       ` Jia Yu
@ 2015-02-03  8:35         ` Zhang, Helin
  2015-02-03 18:53           ` Jia Yu
  0 siblings, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2015-02-03  8:35 UTC (permalink / raw)
  To: Jia Yu; +Cc: dev



> -----Original Message-----
> From: Jia Yu [mailto:jyu@vmware.com]
> Sent: Tuesday, February 3, 2015 4:00 PM
> To: Zhang, Helin
> Cc: dev@dpdk.org; Thomas Monjalon
> Subject: Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed,
> duplex, link_up) after rte_eth_dev_start
> 
> My answer to Helin¹s comments:
> 
> This patch is needed for bond slave devices or other devices, when LSC
> interrupt is enabled.
>  1. slave_configure()  -> slave_eth_dev->Š.lsc = 1
> 
>  2. rte_eth_link_get() reads dev_link from eth_dev, when lsc interrupt is
> enabled. However, the dev_link on eth_dev has not be initialized and showed
> link down state. This patch initializes the device¹s dev_link at
> rte_eth_dev_start time.
So the link update is for bond only? But your code changes is in rte_ethdev, it will
be used for all PMDs. For hardware NIC (e.g. 82599), this link update is not needed
at all. It just need to wait the link status change event. So can those code changes
be put in librte_pmd_bond, but not in librte_ether?

Regards,
Helin

> 
> Please let me know if you have further questions/comments.
> 
> Thanks,
> Jia
> 
> On 1/30/15, 2:28 AM, "Thomas Monjalon" <thomas.monjalon@6wind.com>
> wrote:
> 
> >Jia, any news on this patchset?
> >
> >2014-11-12 03:57, Zhang, Helin:
> >> Hi Jia
> >>
> >> > -----Original Message-----
> >> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
> >> > Sent: Saturday, November 8, 2014 1:32 AM
> >> > To: dev@dpdk.org
> >> > Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status
> >>(speed, duplex,
> >> > link_up) after rte_eth_dev_start
> >> >
> >> > Since LSR interrupt is disabled by pmd drivers, link status in
> >>rte_eth_device is
> >> > always down.
> >> If LSC interrupt is disabled by default, it will poll the link status
> >>during the initialization  or in dev_start, and then the link status
> >>should he correct. If I am not wrong.
> >>
> >> > Bond slave_configure() enables LSR interrupt on devices to get
> >>notification if link
> >> > status changes. However, the LSC interrupt at device start time is
> >>still lost.
> >> Before enabling interrupt for LSC, the link status should be polled.
> >>So after the port  startup, the link status should be there.
> >>
> >> >
> >> > In this fix, call link_update to read link status from hardware
> >>register at device
> >> > start time.
> >> Could you help to explain this code changes a bit more? Why we need it?
> >>
> >> >
> >> > Issue:
> >> > Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
> >> > Signed-off-by: Jia Yu <jyu@vmware.com>
> >> > ---
> >> >  lib/librte_ether/rte_ethdev.c | 4 ++++
> >> >  1 file changed, 4 insertions(+)
> >> >
> >> > diff --git a/lib/librte_ether/rte_ethdev.c
> >>b/lib/librte_ether/rte_ethdev.c index
> >> > ff1c769..6c01b02 100644
> >> > --- a/lib/librte_ether/rte_ethdev.c
> >> > +++ b/lib/librte_ether/rte_ethdev.c
> >> > @@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
> >> >
> >> >  	rte_eth_dev_config_restore(port_id);
> >> >
> >> > +	if (dev->data->dev_conf.intr_conf.lsc != 0) {
> >> > +		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update,
> -ENOTSUP);
> >> > +		(*dev->dev_ops->link_update)(dev, 0);
> >> > +	}
> >> >  	return 0;
> >> >  }
> >> >
> >> > --
> >> > 1.9.1
> >>
> >> Regards,
> >> Helin
> >

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

* Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2015-02-03  8:35         ` Zhang, Helin
@ 2015-02-03 18:53           ` Jia Yu
  2015-02-04  0:37             ` Zhang, Helin
  0 siblings, 1 reply; 14+ messages in thread
From: Jia Yu @ 2015-02-03 18:53 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

Helin,

Thanks for comment. Any device that enabled LSC needs this fix, otherwise
they all need to call link_update separately. We cannot assume that only
Bond enables LSC interrupt.

The fix will not be used for all PMDs, as it explicitly checks if
(dev->data->dev_conf.intr_conf.lsc != 0). Therefore, for hardware NIC
(e.g. 82599) that disabled lsc by default, the link_update callback will
not be executed. Please let me know if you have other concerns.

Thanks,
Jia

On 2/3/15, 12:35 AM, "Zhang, Helin" <helin.zhang@intel.com> wrote:

>
>
>> -----Original Message-----
>> From: Jia Yu [mailto:jyu@vmware.com]
>> Sent: Tuesday, February 3, 2015 4:00 PM
>> To: Zhang, Helin
>> Cc: dev@dpdk.org; Thomas Monjalon
>> Subject: Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status
>>(speed,
>> duplex, link_up) after rte_eth_dev_start
>> 
>> My answer to Helin¹s comments:
>> 
>> This patch is needed for bond slave devices or other devices, when LSC
>> interrupt is enabled.
>>  1. slave_configure()  -> slave_eth_dev->Š.lsc = 1
>> 
>>  2. rte_eth_link_get() reads dev_link from eth_dev, when lsc interrupt
>>is
>> enabled. However, the dev_link on eth_dev has not be initialized and
>>showed
>> link down state. This patch initializes the device¹s dev_link at
>> rte_eth_dev_start time.
>So the link update is for bond only? But your code changes is in
>rte_ethdev, it will
>be used for all PMDs. For hardware NIC (e.g. 82599), this link update is
>not needed
>at all. It just need to wait the link status change event. So can those
>code changes
>be put in librte_pmd_bond, but not in librte_ether?
>
>Regards,
>Helin
>
>> 
>> Please let me know if you have further questions/comments.
>> 
>> Thanks,
>> Jia
>> 
>> On 1/30/15, 2:28 AM, "Thomas Monjalon" <thomas.monjalon@6wind.com>
>> wrote:
>> 
>> >Jia, any news on this patchset?
>> >
>> >2014-11-12 03:57, Zhang, Helin:
>> >> Hi Jia
>> >>
>> >> > -----Original Message-----
>> >> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
>> >> > Sent: Saturday, November 8, 2014 1:32 AM
>> >> > To: dev@dpdk.org
>> >> > Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status
>> >>(speed, duplex,
>> >> > link_up) after rte_eth_dev_start
>> >> >
>> >> > Since LSR interrupt is disabled by pmd drivers, link status in
>> >>rte_eth_device is
>> >> > always down.
>> >> If LSC interrupt is disabled by default, it will poll the link status
>> >>during the initialization  or in dev_start, and then the link status
>> >>should he correct. If I am not wrong.
>> >>
>> >> > Bond slave_configure() enables LSR interrupt on devices to get
>> >>notification if link
>> >> > status changes. However, the LSC interrupt at device start time is
>> >>still lost.
>> >> Before enabling interrupt for LSC, the link status should be polled.
>> >>So after the port  startup, the link status should be there.
>> >>
>> >> >
>> >> > In this fix, call link_update to read link status from hardware
>> >>register at device
>> >> > start time.
>> >> Could you help to explain this code changes a bit more? Why we need
>>it?
>> >>
>> >> >
>> >> > Issue:
>> >> > Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
>> >> > Signed-off-by: Jia Yu <jyu@vmware.com>
>> >> > ---
>> >> >  lib/librte_ether/rte_ethdev.c | 4 ++++
>> >> >  1 file changed, 4 insertions(+)
>> >> >
>> >> > diff --git a/lib/librte_ether/rte_ethdev.c
>> >>b/lib/librte_ether/rte_ethdev.c index
>> >> > ff1c769..6c01b02 100644
>> >> > --- a/lib/librte_ether/rte_ethdev.c
>> >> > +++ b/lib/librte_ether/rte_ethdev.c
>> >> > @@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
>> >> >
>> >> >  	rte_eth_dev_config_restore(port_id);
>> >> >
>> >> > +	if (dev->data->dev_conf.intr_conf.lsc != 0) {
>> >> > +		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update,
>> -ENOTSUP);
>> >> > +		(*dev->dev_ops->link_update)(dev, 0);
>> >> > +	}
>> >> >  	return 0;
>> >> >  }
>> >> >
>> >> > --
>> >> > 1.9.1
>> >>
>> >> Regards,
>> >> Helin
>> >
>


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

* Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start
  2015-02-03 18:53           ` Jia Yu
@ 2015-02-04  0:37             ` Zhang, Helin
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang, Helin @ 2015-02-04  0:37 UTC (permalink / raw)
  To: Jia Yu; +Cc: dev

Hi Jia

> -----Original Message-----
> From: Jia Yu [mailto:jyu@vmware.com]
> Sent: Wednesday, February 4, 2015 2:53 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org; Thomas Monjalon
> Subject: Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed,
> duplex, link_up) after rte_eth_dev_start
> 
> Helin,
> 
> Thanks for comment. Any device that enabled LSC needs this fix, otherwise
> they all need to call link_update separately. We cannot assume that only Bond
> enables LSC interrupt.
> 
> The fix will not be used for all PMDs, as it explicitly checks if
> (dev->data->dev_conf.intr_conf.lsc != 0). Therefore, for hardware NIC (e.g.
> 82599) that disabled lsc by default, the link_update callback will not be
> executed. Please let me know if you have other concerns.
I understood. I mean if (lsc == 1), for 82599, it can report lsc event correctly after startup.
But if a manually link update is executed, no link change can be found when a lsc
event is received in application.
Your fix is to solve the problem in bond only, am I correct? My comment is that can we
avoid doing that for 82599, Fortville, etc? As some of DPDK customers may not want it if
lsc is enabled.

Regards,
Helin

> 
> Thanks,
> Jia
> 
> On 2/3/15, 12:35 AM, "Zhang, Helin" <helin.zhang@intel.com> wrote:
> 
> >
> >
> >> -----Original Message-----
> >> From: Jia Yu [mailto:jyu@vmware.com]
> >> Sent: Tuesday, February 3, 2015 4:00 PM
> >> To: Zhang, Helin
> >> Cc: dev@dpdk.org; Thomas Monjalon
> >> Subject: Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status
> >>(speed,  duplex, link_up) after rte_eth_dev_start
> >>
> >> My answer to Helin¹s comments:
> >>
> >> This patch is needed for bond slave devices or other devices, when
> >> LSC interrupt is enabled.
> >>  1. slave_configure()  -> slave_eth_dev->Š.lsc = 1
> >>
> >>  2. rte_eth_link_get() reads dev_link from eth_dev, when lsc
> >>interrupt is  enabled. However, the dev_link on eth_dev has not be
> >>initialized and showed  link down state. This patch initializes the
> >>device¹s dev_link at  rte_eth_dev_start time.
> >So the link update is for bond only? But your code changes is in
> >rte_ethdev, it will be used for all PMDs. For hardware NIC (e.g.
> >82599), this link update is not needed at all. It just need to wait the
> >link status change event. So can those code changes be put in
> >librte_pmd_bond, but not in librte_ether?
> >
> >Regards,
> >Helin
> >
> >>
> >> Please let me know if you have further questions/comments.
> >>
> >> Thanks,
> >> Jia
> >>
> >> On 1/30/15, 2:28 AM, "Thomas Monjalon" <thomas.monjalon@6wind.com>
> >> wrote:
> >>
> >> >Jia, any news on this patchset?
> >> >
> >> >2014-11-12 03:57, Zhang, Helin:
> >> >> Hi Jia
> >> >>
> >> >> > -----Original Message-----
> >> >> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
> >> >> > Sent: Saturday, November 8, 2014 1:32 AM
> >> >> > To: dev@dpdk.org
> >> >> > Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status
> >> >>(speed, duplex,
> >> >> > link_up) after rte_eth_dev_start
> >> >> >
> >> >> > Since LSR interrupt is disabled by pmd drivers, link status in
> >> >>rte_eth_device is
> >> >> > always down.
> >> >> If LSC interrupt is disabled by default, it will poll the link
> >> >>status during the initialization  or in dev_start, and then the
> >> >>link status should he correct. If I am not wrong.
> >> >>
> >> >> > Bond slave_configure() enables LSR interrupt on devices to get
> >> >>notification if link
> >> >> > status changes. However, the LSC interrupt at device start time
> >> >> > is
> >> >>still lost.
> >> >> Before enabling interrupt for LSC, the link status should be polled.
> >> >>So after the port  startup, the link status should be there.
> >> >>
> >> >> >
> >> >> > In this fix, call link_update to read link status from hardware
> >> >>register at device
> >> >> > start time.
> >> >> Could you help to explain this code changes a bit more? Why we
> >> >> need
> >>it?
> >> >>
> >> >> >
> >> >> > Issue:
> >> >> > Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
> >> >> > Signed-off-by: Jia Yu <jyu@vmware.com>
> >> >> > ---
> >> >> >  lib/librte_ether/rte_ethdev.c | 4 ++++
> >> >> >  1 file changed, 4 insertions(+)
> >> >> >
> >> >> > diff --git a/lib/librte_ether/rte_ethdev.c
> >> >>b/lib/librte_ether/rte_ethdev.c index
> >> >> > ff1c769..6c01b02 100644
> >> >> > --- a/lib/librte_ether/rte_ethdev.c
> >> >> > +++ b/lib/librte_ether/rte_ethdev.c
> >> >> > @@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
> >> >> >
> >> >> >  	rte_eth_dev_config_restore(port_id);
> >> >> >
> >> >> > +	if (dev->data->dev_conf.intr_conf.lsc != 0) {
> >> >> > +		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update,
> >> -ENOTSUP);
> >> >> > +		(*dev->dev_ops->link_update)(dev, 0);
> >> >> > +	}
> >> >> >  	return 0;
> >> >> >  }
> >> >> >
> >> >> > --
> >> >> > 1.9.1
> >> >>
> >> >> Regards,
> >> >> Helin
> >> >
> >


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

* Re: [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
  2014-11-07 17:31 [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Jia Yu
                   ` (2 preceding siblings ...)
  2014-11-10  9:40 ` [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Thomas Monjalon
@ 2015-02-11  3:20 ` Zhang, Helin
  2015-02-18 16:51   ` Thomas Monjalon
  3 siblings, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2015-02-11  3:20 UTC (permalink / raw)
  To: Jia Yu, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu
> Sent: Saturday, November 8, 2014 1:32 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
> 
> This patch series include a fix and an improvement to rte_ethdev lib.
> 
> Jia Yu (2):
>   rte_ethdev: update link status (speed, duplex, link_up) after
>     rte_eth_dev_start
>   rte_ethdev: add return status for rte_eth_stats_get
> 
>  lib/librte_ether/rte_ethdev.c | 11 ++++++++---  lib/librte_ether/rte_ethdev.h
> |  4 +++-
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> --
> 1.9.1

Acked-by: Helin Zhang <helin.zhang@intel.com>

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

* Re: [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement
  2015-02-11  3:20 ` Zhang, Helin
@ 2015-02-18 16:51   ` Thomas Monjalon
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Monjalon @ 2015-02-18 16:51 UTC (permalink / raw)
  To: Jia Yu; +Cc: dev

> > This patch series include a fix and an improvement to rte_ethdev lib.
> > 
> > Jia Yu (2):
> >   rte_ethdev: update link status (speed, duplex, link_up) after
> >     rte_eth_dev_start
> >   rte_ethdev: add return status for rte_eth_stats_get
> 
> Acked-by: Helin Zhang <helin.zhang@intel.com>

Applied, thanks

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

end of thread, other threads:[~2015-02-18 16:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-07 17:31 [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Jia Yu
2014-11-07 17:31 ` [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Jia Yu
2014-11-12  3:57   ` Zhang, Helin
2015-01-30 10:28     ` Thomas Monjalon
2015-02-03  8:00       ` Jia Yu
2015-02-03  8:35         ` Zhang, Helin
2015-02-03 18:53           ` Jia Yu
2015-02-04  0:37             ` Zhang, Helin
2014-11-07 17:31 ` [dpdk-dev] [PATCH 2/2] rte_ethdev: add return status for rte_eth_stats_get Jia Yu
2014-11-10  9:40 ` [dpdk-dev] [PATCH 0/2] rte_ethdev fix/improvement Thomas Monjalon
2014-11-11 23:48   ` Jia Yu
2014-11-12  9:35     ` Thomas Monjalon
2015-02-11  3:20 ` Zhang, Helin
2015-02-18 16:51   ` 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).