On Mon, Mar 30, 2015 at 12:23 PM, Petri Savolainen <
petri.savolai...@nokia.com> wrote:

> Renamed to odp_pktio_ctrl_promisc_mode(). All interface level
> control function are prefixed with odp_pktio_ctrl_ to highlight
> that these operations may not be permitted on all interfaces.
> For example, virtual functions cannot change interface
> level settings, only physical functions can.
>
> Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com>
> ---
>  include/odp/api/packet_io.h            | 30 +++++++++++++++++++-----------
>  platform/linux-generic/odp_packet_io.c |  2 +-
>  test/validation/odp_pktio.c            |  4 ++--
>  3 files changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
> index dc76270..3229d64 100644
> --- a/include/odp/api/packet_io.h
> +++ b/include/odp/api/packet_io.h
> @@ -317,17 +317,6 @@ int odp_pktio_ctrl_info(odp_pktio_t pktio,
> odp_pktio_ctrl_info_t *info);
>  int odp_pktio_mtu(odp_pktio_t pktio);
>
>  /**
> - * Enable/Disable promiscuous mode on a packet IO interface.
> - *
> - * @param[in] pktio    Packet IO handle.
> - * @param[in] enable   1 to enable, 0 to disable.
> - *
> - * @retval 0 on success
> - * @retval <0 on failure
> - */
> -int odp_pktio_promisc_mode_set(odp_pktio_t pktio, odp_bool_t enable);
> -
> -/**
>   * Determine if promiscuous mode is enabled for a packet IO interface.
>   *
>   * @param[in] pktio Packet IO handle.
> @@ -420,6 +409,25 @@ int odp_pktio_headroom_set(odp_pktio_t pktio,
> uint32_t headroom);
>   */
>  uint64_t odp_pktio_to_u64(odp_pktio_t pktio);
>
> +/*
> + * Packet IO interface control
> + * ---------------------------
> + *
> + * Some functions may not be permitted on all interfaces
> + */
> +
> +/**
> + * Enable/Disable promiscuous mode on a packet IO interface.
> + *
> + * @param[in] pktio    Packet IO handle.
> + * @param[in] enable   1 to enable, 0 to disable.
> + *
> + * @retval 0 on success
> + * @retval <0 on failure
> + */
> +int odp_pktio_ctrl_promisc_mode(odp_pktio_t pktio, odp_bool_t enable);
>

This seems inconsistent with other getters/setters used throughout ODP.
Why should these attributes have their own unique syntax instead of
odp_pktio_promisc_mode() for the getter and odp_pktio_promisc_mode_set()
for setter?


> +
> +
>  /**
>   * @}
>   */
> diff --git a/platform/linux-generic/odp_packet_io.c
> b/platform/linux-generic/odp_packet_io.c
> index a14c9df..0aa9d33 100644
> --- a/platform/linux-generic/odp_packet_io.c
> +++ b/platform/linux-generic/odp_packet_io.c
> @@ -723,7 +723,7 @@ int odp_pktio_mtu(odp_pktio_t id)
>         return ifr.ifr_mtu;
>  }
>
> -int odp_pktio_promisc_mode_set(odp_pktio_t id, odp_bool_t enable)
> +int odp_pktio_ctrl_promisc_mode(odp_pktio_t id, odp_bool_t enable)
>

See comment/question above.


>  {
>         pktio_entry_t *entry;
>         int sockfd;
> diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
> index 4eeac7c..f32ddfd 100644
> --- a/test/validation/odp_pktio.c
> +++ b/test/validation/odp_pktio.c
> @@ -534,14 +534,14 @@ static void test_odp_pktio_promisc(void)
>         int ret;
>         odp_pktio_t pktio = create_pktio(iface_name[0],
> ODP_QUEUE_TYPE_SCHED);
>
> -       ret = odp_pktio_promisc_mode_set(pktio, 1);
> +       ret = odp_pktio_ctrl_promisc_mode(pktio, 1);
>         CU_ASSERT(0 == ret);
>
>         /* Verify that promisc mode set */
>         ret = odp_pktio_promisc_mode(pktio);
>         CU_ASSERT(1 == ret);
>
> -       ret = odp_pktio_promisc_mode_set(pktio, 0);
> +       ret = odp_pktio_ctrl_promisc_mode(pktio, 0);
>         CU_ASSERT(0 == ret);
>
>         /* Verify that promisc mode is not set */
> --
> 2.3.4
>
> _______________________________________________
> 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

Reply via email to