Re: [lng-odp] [PATCH] api: pktio link status

2015-12-16 Thread Maxim Uvarov

Merged,

with requested change.

Maxim.

On 12/11/2015 15:52, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Mail subject should be: [API-NEXT PATCH] api: pktio: added link status

Otherwise OK. Could you update the git log entry before merging: "api: pktio: added 
link status"

Reviewed-by: Petri Savolainen <petri.savolai...@nokia.com>



-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
Maxim Uvarov
Sent: Friday, December 11, 2015 2:45 PM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] [PATCH] api: pktio link status

Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
---
  v1 was link_state(), now it's link_status().

  include/odp/api/packet_io.h | 11 +++
  1 file changed, 11 insertions(+)

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 443841e..8999b2c 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -673,6 +673,17 @@ void
odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t *param);
  void odp_pktio_print(odp_pktio_t pktio);

  /**
+ * Determine pktio link is up or down for a packet IO interface.
+ *
+ * @param pktio Packet IO handle.
+ *
+ * @retval  1 link is up
+ * @retval  0 link is down
+ * @retval <0 on failure
+*/
+int odp_pktio_link_status(odp_pktio_t pktio);
+
+/**
   * @}
   */

--
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] api: pktio link status

2015-12-14 Thread Savolainen, Petri (Nokia - FI/Espoo)
A specific "is_up()" would not help if the call can fail (return <0). User 
would still need to check against 1 vs. 0 vs. <0. I think the current 
specification is logical in the way that "1" means (up and) OK, "0" (down and) 
try again later, "<0" (failure) no point to try again before something else is 
changed in system config. Additional down states can be added later with the 
same logic:


/**
 * Determine pktio link status.
 *
 * @param pktio Packet IO handle.
 *
 * @retval  1 link is up
 * @retval  0 link is down
 * @retval  -1 A HW component is not present
 * @retval  -2 Lower layer down
 * @retval <-2 on other failures
 */
 int odp_pktio_link_status(odp_pktio_t pktio); 


-Petri



> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Maxim Uvarov
> Sent: Monday, December 14, 2015 10:43 AM
> To: Alexandru Badicioiu
> Cc: LNG ODP Mailman List
> Subject: Re: [lng-odp] [PATCH] api: pktio link status
> 
> 
> 
> _link_up() might be confused with setting command. Not with getting
> status command.
> 
> How about:
> odp_pktio_status_link_up()?
> 
> There might be some other statuses for pktio which we can extend later
> and use the same prefix odp_pktio_status_
> 
> Maxim.
> 
> 
> On 12/11/2015 15:53, Alexandru Badicioiu wrote:
> > Wouldn't be the application code more clear if the function is renamed
> > to _link_up()?
> > Return values clearly suggest this. The application has to remember
> > that 1 means link up and 0 means link down.
> >
> > Alex
> >
> >
> > On 11 December 2015 at 14:44, Maxim Uvarov <maxim.uva...@linaro.org
> > <mailto:maxim.uva...@linaro.org>> wrote:
> >
> > Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org
> > <mailto:maxim.uva...@linaro.org>>
> > ---
> >  v1 was link_state(), now it's link_status().
> >
> >  include/odp/api/packet_io.h | 11 +++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/include/odp/api/packet_io.h
> b/include/odp/api/packet_io.h
> > index 443841e..8999b2c 100644
> > --- a/include/odp/api/packet_io.h
> > +++ b/include/odp/api/packet_io.h
> > @@ -673,6 +673,17 @@ void
> > odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t
> > *param);
> >  void odp_pktio_print(odp_pktio_t pktio);
> >
> >  /**
> > + * Determine pktio link is up or down for a packet IO interface.
> > + *
> > + * @param pktio Packet IO handle.
> > + *
> > + * @retval  1 link is up
> > + * @retval  0 link is down
> > + * @retval <0 on failure
> > +*/
> > +int odp_pktio_link_status(odp_pktio_t pktio);
> > +
> > +/**
> >   * @}
> >   */
> >
> > --
> > 1.9.1
> >
> > ___
> > lng-odp mailing list
> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> > https://lists.linaro.org/mailman/listinfo/lng-odp
> >
> >
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] api: pktio link status

2015-12-14 Thread Alexandru Badicioiu
_link_up() looks consistent with ODP naming convention - setting the link
up would be named _link_up_set().

Alex

On 14 December 2015 at 10:42, Maxim Uvarov  wrote:

>
>
> _link_up() might be confused with setting command. Not with getting status
> command.
>
> How about:
> odp_pktio_status_link_up()?
>
> There might be some other statuses for pktio which we can extend later and
> use the same prefix odp_pktio_status_
>
> Maxim.
>
>
> On 12/11/2015 15:53, Alexandru Badicioiu wrote:
>
>> Wouldn't be the application code more clear if the function is renamed to
>> _link_up()?
>> Return values clearly suggest this. The application has to remember that
>> 1 means link up and 0 means link down.
>>
>> Alex
>>
>>
>> On 11 December 2015 at 14:44, Maxim Uvarov > > wrote:
>>
>> Signed-off-by: Maxim Uvarov > >
>>
>> ---
>>  v1 was link_state(), now it's link_status().
>>
>>  include/odp/api/packet_io.h | 11 +++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
>> index 443841e..8999b2c 100644
>> --- a/include/odp/api/packet_io.h
>> +++ b/include/odp/api/packet_io.h
>> @@ -673,6 +673,17 @@ void
>> odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t
>> *param);
>>  void odp_pktio_print(odp_pktio_t pktio);
>>
>>  /**
>> + * Determine pktio link is up or down for a packet IO interface.
>> + *
>> + * @param pktio Packet IO handle.
>> + *
>> + * @retval  1 link is up
>> + * @retval  0 link is down
>> + * @retval <0 on failure
>> +*/
>> +int odp_pktio_link_status(odp_pktio_t pktio);
>> +
>> +/**
>>   * @}
>>   */
>>
>> --
>> 1.9.1
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org 
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] api: pktio link status

2015-12-14 Thread Maxim Uvarov



_link_up() might be confused with setting command. Not with getting 
status command.


How about:
odp_pktio_status_link_up()?

There might be some other statuses for pktio which we can extend later 
and use the same prefix odp_pktio_status_


Maxim.


On 12/11/2015 15:53, Alexandru Badicioiu wrote:
Wouldn't be the application code more clear if the function is renamed 
to _link_up()?
Return values clearly suggest this. The application has to remember 
that 1 means link up and 0 means link down.


Alex


On 11 December 2015 at 14:44, Maxim Uvarov > wrote:


Signed-off-by: Maxim Uvarov >
---
 v1 was link_state(), now it's link_status().

 include/odp/api/packet_io.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 443841e..8999b2c 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -673,6 +673,17 @@ void
odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t
*param);
 void odp_pktio_print(odp_pktio_t pktio);

 /**
+ * Determine pktio link is up or down for a packet IO interface.
+ *
+ * @param pktio Packet IO handle.
+ *
+ * @retval  1 link is up
+ * @retval  0 link is down
+ * @retval <0 on failure
+*/
+int odp_pktio_link_status(odp_pktio_t pktio);
+
+/**
  * @}
  */

--
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org 
https://lists.linaro.org/mailman/listinfo/lng-odp




___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] api: pktio link status

2015-12-11 Thread Alexandru Badicioiu
Wouldn't be the application code more clear if the function is renamed to
_link_up()?
Return values clearly suggest this. The application has to remember that 1
means link up and 0 means link down.

Alex


On 11 December 2015 at 14:44, Maxim Uvarov  wrote:

> Signed-off-by: Maxim Uvarov 
> ---
>  v1 was link_state(), now it's link_status().
>
>  include/odp/api/packet_io.h | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
> index 443841e..8999b2c 100644
> --- a/include/odp/api/packet_io.h
> +++ b/include/odp/api/packet_io.h
> @@ -673,6 +673,17 @@ void
> odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t *param);
>  void odp_pktio_print(odp_pktio_t pktio);
>
>  /**
> + * Determine pktio link is up or down for a packet IO interface.
> + *
> + * @param pktio Packet IO handle.
> + *
> + * @retval  1 link is up
> + * @retval  0 link is down
> + * @retval <0 on failure
> +*/
> +int odp_pktio_link_status(odp_pktio_t pktio);
> +
> +/**
>   * @}
>   */
>
> --
> 1.9.1
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] api: pktio link status

2015-12-11 Thread Savolainen, Petri (Nokia - FI/Espoo)
Mail subject should be: [API-NEXT PATCH] api: pktio: added link status

Otherwise OK. Could you update the git log entry before merging: "api: pktio: 
added link status"

Reviewed-by: Petri Savolainen <petri.savolai...@nokia.com>


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Maxim Uvarov
> Sent: Friday, December 11, 2015 2:45 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH] api: pktio link status
> 
> Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
> ---
>  v1 was link_state(), now it's link_status().
> 
>  include/odp/api/packet_io.h | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
> index 443841e..8999b2c 100644
> --- a/include/odp/api/packet_io.h
> +++ b/include/odp/api/packet_io.h
> @@ -673,6 +673,17 @@ void
> odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t *param);
>  void odp_pktio_print(odp_pktio_t pktio);
> 
>  /**
> + * Determine pktio link is up or down for a packet IO interface.
> + *
> + * @param pktio Packet IO handle.
> + *
> + * @retval  1 link is up
> + * @retval  0 link is down
> + * @retval <0 on failure
> +*/
> +int odp_pktio_link_status(odp_pktio_t pktio);
> +
> +/**
>   * @}
>   */
> 
> --
> 1.9.1
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] api: pktio link status

2015-12-11 Thread Maxim Uvarov
Signed-off-by: Maxim Uvarov 
---
 v1 was link_state(), now it's link_status().

 include/odp/api/packet_io.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 443841e..8999b2c 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -673,6 +673,17 @@ void 
odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t *param);
 void odp_pktio_print(odp_pktio_t pktio);
 
 /**
+ * Determine pktio link is up or down for a packet IO interface.
+ *
+ * @param pktio Packet IO handle.
+ *
+ * @retval  1 link is up
+ * @retval  0 link is down
+ * @retval <0 on failure
+*/
+int odp_pktio_link_status(odp_pktio_t pktio);
+
+/**
  * @}
  */
 
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp