On 28 November 2014 at 14:41, Alexandru Badicioiu
<[email protected]> wrote:
> One reason to allow enqueue to pktin would be for debugging and testing
> packet applications without using external traffic.
Would this be portable?

Couldn't we define some concept of loopback mode or interface (pktio
instance) where transmitted packets are returned in the input queue?

Just trying to explore the design space.


>
> On 28 November 2014 at 13:47, Stuart Haslam <[email protected]> wrote:
>>
>> On Fri, Nov 28, 2014 at 09:48:29AM +0000, Alexandru Badicioiu wrote:
>> >
>> >
>> > On 27 November 2014 at 18:56, Stuart Haslam
>> > <[email protected]<mailto:[email protected]>> wrote:
>> > Attempts to enq to a pktin queue or deq from a pktout queue are
>> > programming errors, so abort.
>> > [Alex] Is this an ODP convention valid for all implementations? I f we
>> > talk about HW I think these are debatable and SoC dependent.
>> > In the most general case a queue may have multiple producers and
>> > multiple consumers. For example FSL DPAA does not impose any restriction on
>> > enqueue - any accelerator(port) or core can enqueue on any queue by placing
>> > commands to Queue manager block.  However, on dequeue, for pktout queues
>> > (assumed to be consumed by a  singleTx port) only the port can dequeue.
>> >
>>
>> Behaviour needs to be consistent across implementations so if there are
>> valid use cases for enqueue to a pktio inq, and they can be supported,
>> we need to define the semantics as it's currently not clear.
>>
>> Taras, I see the keystone implementation currently doesn't support
>> enqueue to a pktio inq, is that because the platform doesn't support it
>> or it's just not implemented?
>>
>> --
>> Stuart.
>>
>> >
>> > Signed-off-by: Stuart Haslam
>> > <[email protected]<mailto:[email protected]>>
>> > ---
>> > (This code contribution is provided under the terms of agreement
>> > LES-LTM-21309)
>> >
>> >  platform/linux-generic/odp_packet_io.c | 22 ++++++++++++++++++----
>> >  1 file changed, 18 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/platform/linux-generic/odp_packet_io.c
>> > b/platform/linux-generic/odp_packet_io.c
>> > index f527e45..161f2ce 100644
>> > --- a/platform/linux-generic/odp_packet_io.c
>> > +++ b/platform/linux-generic/odp_packet_io.c
>> > @@ -384,6 +384,9 @@ int pktout_enqueue(queue_entry_t *qentry,
>> > odp_buffer_hdr_t *buf_hdr)
>> >  odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *qentry)
>> >  {
>> >         (void)qentry;
>> > +
>> > +       ODP_ABORT("attempted dequeue from a pktout queue");
>> > +
>> >         return NULL;
>> >  }
>> >
>> > @@ -408,13 +411,19 @@ int pktout_deq_multi(queue_entry_t *qentry,
>> > odp_buffer_hdr_t *buf_hdr[],
>> >         (void)buf_hdr;
>> >         (void)num;
>> >
>> > +       ODP_ABORT("attempted dequeue from a pktout queue");
>> > +
>> >         return 0;
>> >  }
>> >
>> >  int pktin_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr)
>> >  {
>> > -       /* Use default action */
>> > -       return queue_enq(qentry, buf_hdr);
>> > +       (void)qentry;
>> > +       (void)buf_hdr;
>> > +
>> > +       ODP_ABORT("attempted enqueue to a pktin queue");
>> > +
>> > +       return -1;
>> >  }
>> >
>> >  odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry)
>> > @@ -445,8 +454,13 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t
>> > *qentry)
>> >
>> >  int pktin_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[],
>> > int num)
>> >  {
>> > -       /* Use default action */
>> > -       return queue_enq_multi(qentry, buf_hdr, num);
>> > +       (void)qentry;
>> > +       (void)buf_hdr;
>> > +       (void)num;
>> > +
>> > +       ODP_ABORT("attempted enqueue to a pktin queue");
>> > +
>> > +       return 0;
>> >  }
>> >
>> >  int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[],
>> > int num)
>> > --
>> > 2.1.1
>>
>> --
>> Stuart.
>>
>
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp
>

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to