DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks
@ 2017-03-31 13:57 Andriy Berestovskyy
  2017-03-31 13:57 ` [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update Andriy Berestovskyy
  2017-04-03 15:13 ` [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Jerin Jacob
  0 siblings, 2 replies; 7+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:57 UTC (permalink / raw)
  To: Jerin Jacob, Maciej Czekaj; +Cc: dev

Some applications and DPDK examples expect link up/down
functionality to be provided.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 drivers/net/thunderx/nicvf_ethdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 1060319..984c218 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1924,11 +1924,25 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 	return 0;
 }
 
+static int
+nicvf_dev_set_link_up(struct rte_eth_dev *dev __rte_unused)
+{
+	return 0;
+}
+
+static int
+nicvf_dev_set_link_down(struct rte_eth_dev *dev __rte_unused)
+{
+	return 0;
+}
+
 /* Initialize and register driver with DPDK Application */
 static const struct eth_dev_ops nicvf_eth_dev_ops = {
 	.dev_configure            = nicvf_dev_configure,
 	.dev_start                = nicvf_dev_start,
 	.dev_stop                 = nicvf_dev_stop,
+	.dev_set_link_up          = nicvf_dev_set_link_up,
+	.dev_set_link_down        = nicvf_dev_set_link_down,
 	.link_update              = nicvf_dev_link_update,
 	.dev_close                = nicvf_dev_close,
 	.stats_get                = nicvf_dev_stats_get,
-- 
2.7.4

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

* [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update
  2017-03-31 13:57 [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Andriy Berestovskyy
@ 2017-03-31 13:57 ` Andriy Berestovskyy
  2017-04-03 14:55   ` Jerin Jacob
  2017-04-03 15:13 ` [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Jerin Jacob
  1 sibling, 1 reply; 7+ messages in thread
From: Andriy Berestovskyy @ 2017-03-31 13:57 UTC (permalink / raw)
  To: Jerin Jacob, Maciej Czekaj; +Cc: dev

Some DPDK applications/examples check link status on their
start. NICVF does not wait for the link, so those apps fail.

Wait up to 9 seconds for the link as other PMDs do in order
to fix those apps/examples.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 drivers/net/thunderx/nicvf_ethdev.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 984c218..2fe653a 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -145,16 +145,29 @@ nicvf_periodic_alarm_stop(void (fn)(void *), void *arg)
  * Return 0 means link status changed, -1 means not changed
  */
 static int
-nicvf_dev_link_update(struct rte_eth_dev *dev,
-		      int wait_to_complete __rte_unused)
+nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 {
+#define CHECK_INTERVAL 100  /* 100ms */
+#define MAX_CHECK_TIME 90   /* 9s (90 * 100ms) in total */
 	struct rte_eth_link link;
 	struct nicvf *nic = nicvf_pmd_priv(dev);
+	int i;
 
 	PMD_INIT_FUNC_TRACE();
 
-	memset(&link, 0, sizeof(link));
-	nicvf_set_eth_link_status(nic, &link);
+	if (wait_to_complete) {
+		/* rte_eth_link_get() might need to wait up to 9 seconds */
+		for (i = 0; i < MAX_CHECK_TIME; i++) {
+			memset(&link, 0, sizeof(link));
+			nicvf_set_eth_link_status(nic, &link);
+			if (link.link_status)
+				break;
+			rte_delay_ms(CHECK_INTERVAL);
+		}
+	} else {
+		memset(&link, 0, sizeof(link));
+		nicvf_set_eth_link_status(nic, &link);
+	}
 	return nicvf_atomic_write_link_status(dev, &link);
 }
 
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update
  2017-03-31 13:57 ` [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update Andriy Berestovskyy
@ 2017-04-03 14:55   ` Jerin Jacob
  2017-04-03 15:35     ` Ferruh Yigit
  0 siblings, 1 reply; 7+ messages in thread
From: Jerin Jacob @ 2017-04-03 14:55 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: Maciej Czekaj, dev

On Fri, Mar 31, 2017 at 03:57:49PM +0200, Andriy Berestovskyy wrote:
> Some DPDK applications/examples check link status on their
> start. NICVF does not wait for the link, so those apps fail.
> 
> Wait up to 9 seconds for the link as other PMDs do in order
> to fix those apps/examples.
> 
> Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> ---
>  drivers/net/thunderx/nicvf_ethdev.c | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> index 984c218..2fe653a 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -145,16 +145,29 @@ nicvf_periodic_alarm_stop(void (fn)(void *), void *arg)
>   * Return 0 means link status changed, -1 means not changed
>   */
>  static int
> -nicvf_dev_link_update(struct rte_eth_dev *dev,
> -		      int wait_to_complete __rte_unused)
> +nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
>  {
> +#define CHECK_INTERVAL 100  /* 100ms */
> +#define MAX_CHECK_TIME 90   /* 9s (90 * 100ms) in total */
>  	struct rte_eth_link link;
>  	struct nicvf *nic = nicvf_pmd_priv(dev);
> +	int i;
>  
>  	PMD_INIT_FUNC_TRACE();
>  
> -	memset(&link, 0, sizeof(link));
> -	nicvf_set_eth_link_status(nic, &link);
> +	if (wait_to_complete) {
> +		/* rte_eth_link_get() might need to wait up to 9 seconds */
> +		for (i = 0; i < MAX_CHECK_TIME; i++) {
> +			memset(&link, 0, sizeof(link));
> +			nicvf_set_eth_link_status(nic, &link);
> +			if (link.link_status)
> +				break;
> +			rte_delay_ms(CHECK_INTERVAL);
> +		}
> +	} else {
> +		memset(&link, 0, sizeof(link));
> +		nicvf_set_eth_link_status(nic, &link);
> +	}
>  	return nicvf_atomic_write_link_status(dev, &link);
>  }
>  
> -- 
> 2.7.4
> 

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

* Re: [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks
  2017-03-31 13:57 [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Andriy Berestovskyy
  2017-03-31 13:57 ` [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update Andriy Berestovskyy
@ 2017-04-03 15:13 ` Jerin Jacob
  2017-04-13 11:04   ` Ferruh Yigit
  1 sibling, 1 reply; 7+ messages in thread
From: Jerin Jacob @ 2017-04-03 15:13 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: Maciej Czekaj, dev

On Fri, Mar 31, 2017 at 03:57:48PM +0200, Andriy Berestovskyy wrote:
> Some applications and DPDK examples expect link up/down
> functionality to be provided.
> 
> Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
> ---
>  drivers/net/thunderx/nicvf_ethdev.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> index 1060319..984c218 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -1924,11 +1924,25 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
>  	return 0;
>  }
>  
> +static int
> +nicvf_dev_set_link_up(struct rte_eth_dev *dev __rte_unused)
> +{
> +	return 0;
> +}
> +
> +static int
> +nicvf_dev_set_link_down(struct rte_eth_dev *dev __rte_unused)
> +{
> +	return 0;
> +}


Since the VF drivers can't really initiate link_up and link_down and
other VF drivers like i40e VF is not setting this callback. I think, it is
OK keep it as -ENOSUP(which is default).

Since Christain Acked on the fix on the usage of examples/ip_pipeline
application. Probably we are OK without this change.

http://dpdk.org/ml/archives/dev/2017-March/062704.html

Any thought from ethdev maintainers?

> +
>  /* Initialize and register driver with DPDK Application */
>  static const struct eth_dev_ops nicvf_eth_dev_ops = {
>  	.dev_configure            = nicvf_dev_configure,
>  	.dev_start                = nicvf_dev_start,
>  	.dev_stop                 = nicvf_dev_stop,
> +	.dev_set_link_up          = nicvf_dev_set_link_up,
> +	.dev_set_link_down        = nicvf_dev_set_link_down,
>  	.link_update              = nicvf_dev_link_update,
>  	.dev_close                = nicvf_dev_close,
>  	.stats_get                = nicvf_dev_stats_get,
> -- 
> 2.7.4
> 

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

* Re: [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update
  2017-04-03 14:55   ` Jerin Jacob
@ 2017-04-03 15:35     ` Ferruh Yigit
  0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2017-04-03 15:35 UTC (permalink / raw)
  To: Jerin Jacob, Andriy Berestovskyy; +Cc: Maciej Czekaj, dev

On 4/3/2017 3:55 PM, Jerin Jacob wrote:
> On Fri, Mar 31, 2017 at 03:57:49PM +0200, Andriy Berestovskyy wrote:
>> Some DPDK applications/examples check link status on their
>> start. NICVF does not wait for the link, so those apps fail.
>>
>> Wait up to 9 seconds for the link as other PMDs do in order
>> to fix those apps/examples.
>>
>> Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
> 
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied to dpdk-next-net/master, thanks.

(not patchset, only this patch applied.)

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

* Re: [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks
  2017-04-03 15:13 ` [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Jerin Jacob
@ 2017-04-13 11:04   ` Ferruh Yigit
  2017-04-14 12:37     ` Jerin Jacob
  0 siblings, 1 reply; 7+ messages in thread
From: Ferruh Yigit @ 2017-04-13 11:04 UTC (permalink / raw)
  To: Jerin Jacob, Andriy Berestovskyy; +Cc: Maciej Czekaj, dev

On 4/3/2017 4:13 PM, Jerin Jacob wrote:
> On Fri, Mar 31, 2017 at 03:57:48PM +0200, Andriy Berestovskyy wrote:
>> Some applications and DPDK examples expect link up/down
>> functionality to be provided.
>>
>> Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
>> ---
>>  drivers/net/thunderx/nicvf_ethdev.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
>> index 1060319..984c218 100644
>> --- a/drivers/net/thunderx/nicvf_ethdev.c
>> +++ b/drivers/net/thunderx/nicvf_ethdev.c
>> @@ -1924,11 +1924,25 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
>>  	return 0;
>>  }
>>  
>> +static int
>> +nicvf_dev_set_link_up(struct rte_eth_dev *dev __rte_unused)
>> +{
>> +	return 0;
>> +}
>> +
>> +static int
>> +nicvf_dev_set_link_down(struct rte_eth_dev *dev __rte_unused)
>> +{
>> +	return 0;
>> +}
> 
> 
> Since the VF drivers can't really initiate link_up and link_down and
> other VF drivers like i40e VF is not setting this callback. I think, it is
> OK keep it as -ENOSUP(which is default).
> 
> Since Christain Acked on the fix on the usage of examples/ip_pipeline
> application. Probably we are OK without this change.

Any update planned to this patch? Should I update this as nack?

> 
> http://dpdk.org/ml/archives/dev/2017-March/062704.html
> 
> Any thought from ethdev maintainers?
> 
>> +
>>  /* Initialize and register driver with DPDK Application */
>>  static const struct eth_dev_ops nicvf_eth_dev_ops = {
>>  	.dev_configure            = nicvf_dev_configure,
>>  	.dev_start                = nicvf_dev_start,
>>  	.dev_stop                 = nicvf_dev_stop,
>> +	.dev_set_link_up          = nicvf_dev_set_link_up,
>> +	.dev_set_link_down        = nicvf_dev_set_link_down,
>>  	.link_update              = nicvf_dev_link_update,
>>  	.dev_close                = nicvf_dev_close,
>>  	.stats_get                = nicvf_dev_stats_get,
>> -- 
>> 2.7.4
>>

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

* Re: [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks
  2017-04-13 11:04   ` Ferruh Yigit
@ 2017-04-14 12:37     ` Jerin Jacob
  0 siblings, 0 replies; 7+ messages in thread
From: Jerin Jacob @ 2017-04-14 12:37 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Andriy Berestovskyy, Maciej Czekaj, dev

-----Original Message-----
> Date: Thu, 13 Apr 2017 12:04:51 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Andriy Berestovskyy
>  <Andriy.Berestovskyy@caviumnetworks.com>
> CC: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>, dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down
>  callbacks
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.0
> 
> On 4/3/2017 4:13 PM, Jerin Jacob wrote:
> > On Fri, Mar 31, 2017 at 03:57:48PM +0200, Andriy Berestovskyy wrote:
> >> Some applications and DPDK examples expect link up/down
> >> functionality to be provided.
> >>
> >> Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
> >> ---
> >>  drivers/net/thunderx/nicvf_ethdev.c | 14 ++++++++++++++
> >>  1 file changed, 14 insertions(+)
> >>
> >> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> >> index 1060319..984c218 100644
> >> --- a/drivers/net/thunderx/nicvf_ethdev.c
> >> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> >> @@ -1924,11 +1924,25 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
> >>  	return 0;
> >>  }
> >>  
> >> +static int
> >> +nicvf_dev_set_link_up(struct rte_eth_dev *dev __rte_unused)
> >> +{
> >> +	return 0;
> >> +}
> >> +
> >> +static int
> >> +nicvf_dev_set_link_down(struct rte_eth_dev *dev __rte_unused)
> >> +{
> >> +	return 0;
> >> +}
> > 
> > 
> > Since the VF drivers can't really initiate link_up and link_down and
> > other VF drivers like i40e VF is not setting this callback. I think, it is
> > OK keep it as -ENOSUP(which is default).
> > 
> > Since Christain Acked on the fix on the usage of examples/ip_pipeline
> > application. Probably we are OK without this change.
> 
> Any update planned to this patch? Should I update this as nack?
> 

You can mark as "Not applicable" in patchwork.
Thanks

> > 
> > http://dpdk.org/ml/archives/dev/2017-March/062704.html
> > 
> > Any thought from ethdev maintainers?
> > 
> >> +
> >>  /* Initialize and register driver with DPDK Application */
> >>  static const struct eth_dev_ops nicvf_eth_dev_ops = {
> >>  	.dev_configure            = nicvf_dev_configure,
> >>  	.dev_start                = nicvf_dev_start,
> >>  	.dev_stop                 = nicvf_dev_stop,
> >> +	.dev_set_link_up          = nicvf_dev_set_link_up,
> >> +	.dev_set_link_down        = nicvf_dev_set_link_down,
> >>  	.link_update              = nicvf_dev_link_update,
> >>  	.dev_close                = nicvf_dev_close,
> >>  	.stats_get                = nicvf_dev_stats_get,
> >> -- 
> >> 2.7.4
> >>
> 

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

end of thread, other threads:[~2017-04-14 12:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 13:57 [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Andriy Berestovskyy
2017-03-31 13:57 ` [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update Andriy Berestovskyy
2017-04-03 14:55   ` Jerin Jacob
2017-04-03 15:35     ` Ferruh Yigit
2017-04-03 15:13 ` [dpdk-dev] [PATCH 1/2] net/thunderx: add empty link up/down callbacks Jerin Jacob
2017-04-13 11:04   ` Ferruh Yigit
2017-04-14 12:37     ` Jerin Jacob

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