Message ID | 1449837881-3330-1-git-send-email-maxim.uvarov@linaro.org |
---|---|
State | Accepted |
Commit | c240dd16c5f267374533cbdd3323635fe3ed0428 |
Headers | show |
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.uvarov@linaro.org> wrote: > Signed-off-by: Maxim Uvarov <maxim.uvarov@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 >
_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.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> wrote: > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@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 > >
_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 <maxim.uvarov@linaro.org> 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 <maxim.uvarov@linaro.org >> <mailto:maxim.uvarov@linaro.org>> wrote: >> >> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org >> <mailto:maxim.uvarov@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 >> >> >> >
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.savolainen@nokia.com> > > >> -----Original Message----- >> From: lng-odp [mailto:lng-odp-bounces@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.uvarov@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
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); + +/** * @} */
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- v1 was link_state(), now it's link_status(). include/odp/api/packet_io.h | 11 +++++++++++ 1 file changed, 11 insertions(+)