On Wed, Apr 19, 2017 at 2:14 AM, Brian Brooks <brian.bro...@arm.com> wrote:

> Signed-off-by: Kevin Wang <kevin.w...@arm.com>
> ---
>  platform/linux-generic/pktio/loop.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/
> pktio/loop.c
> index e9ad22ba..cbb15179 100644
> --- a/platform/linux-generic/pktio/loop.c
> +++ b/platform/linux-generic/pktio/loop.c
> @@ -80,11 +80,13 @@ static int loopback_recv(pktio_entry_t *pktio_entry,
> int index ODP_UNUSED,
>
>         for (i = 0; i < nbr; i++) {
>                 uint32_t pkt_len;
> -
> +#ifdef ODP_SCHEDULE_SCALABLE
> +               pkt = _odp_packet_from_buffer((odp_buffer_t)(hdr_tbl[i]));
> +#else
>                 pkt = _odp_packet_from_buffer(odp_hdr_to_buf(hdr_tbl[i]));
> +#endif
>

Why is this variant form needed?


>                 pkt_len = odp_packet_len(pkt);
>
> -
>                 if (pktio_cls_enabled(pktio_entry)) {
>                         odp_packet_t new_pkt;
>                         odp_pool_t new_pool;
> @@ -163,7 +165,12 @@ static int loopback_send(pktio_entry_t *pktio_entry,
> int index ODP_UNUSED,
>                 len = QUEUE_MULTI_MAX;
>
>         for (i = 0; i < len; ++i) {
> +#ifdef ODP_SCHEDULE_SCALABLE
> +               hdr_tbl[i] = (odp_buffer_hdr_t *)(uintptr_t)
> +                       _odp_packet_to_buffer(pkt_tbl[i]);
> +#else
>                 hdr_tbl[i] = buf_hdl_to_hdr(_odp_packet_to_
> buffer(pkt_tbl[i]));
> +#endif
>

Same question here. These conversions should be independent of the
scheduler being used.


>                 bytes += odp_packet_len(pkt_tbl[i]);
>         }
>
> --
> 2.12.2
>
>

Reply via email to