Comments inline...

On 10 November 2017 at 12:01, Liron Himi <lir...@marvell.com> wrote:
> Hi Bala,
>
> According to the documentation, classifier can be operate with 
> PKTIN_QUEUE_MODE.
>         /** Enable classifier
>           *
>           * * 0: Classifier is disabled (default)
>           * * 1: Classifier is enabled. Use classifier to direct incoming
>           *      packets into pktin event queues. Classifier can be enabled
>           *      only in ODP_PKTIN_MODE_SCHED and ODP_PKTIN_MODE_QUEUE modes.
>           *      Both classifier and hashing cannot be enabled simultaneously
>           *      ('hash_enable' must be 0). */
>         odp_bool_t classifier_enable;
>
> So, Is there a mistake in the documentation or this combination should be 
> supported?

odp_pktin_event_queue() can only be used when hashing is enabled since
when you connect more than one queue to pktio you need some mechanism
to spread the traffic. This configuration is given using
odp_pktin_hash_proto_t which is valid only when hashing is enabled.

Since classifier and hashing are orthogonal you cannot use
classification and get packets using event queues configured using
odp_pktin_event_queue().
Packets delivered after classification can be received by application
either using odp_queue_deq() or odp_schedule() function depending upon
the dst_queue configured with CoS.

Regards,
Bala

>
> Liron
>
> -----Original Message-----
> From: Bala Manoharan [mailto:bala.manoha...@linaro.org]
> Sent: Friday, November 10, 2017 07:18
> To: Liron Himi <lir...@marvell.com>
> Cc: lng-odp@lists.linaro.org
> Subject: [EXT] Re: [lng-odp] classifier with pktio in ODP_PKTIN_MODE_QUEUE
>
> External Email
>
> ----------------------------------------------------------------------
> Hi,
>
> Both these modes cannot co-exist.
>
> There is a parameter 'classifier_enable' and 'hash_enable' as part of 
> odp_pktin_queue_param_t which is used to identify whether classifier or 
> hashing is enabled for a particular pktio interface.
> Both classifier and hash configuration are orthogonal and only one of the two 
> can be enabled at any time. When you configure classification on the pktio 
> interface then the packets will be routed only through classifier 'dst_queue' 
> and not through event queues configured with the pktio interface and vice 
> versa for 'hash_enable'.
>
> odp_pktin_event_queue() API is useful only for platforms which do not support 
> classifier system. This is mainly targetted for HWs which only have RSS 
> configured on the pktio and does not support flow-based classification. The 
> same is documented in odp_pktin_queue_param_t structure pls check the 
> documentation and let us know if you find any discrepancy.
>
> Hope this clarifies,
> Bala
>
>
> On 9 November 2017 at 23:04, Liron Himi <lir...@marvell.com> wrote:
>> Hi,
>>
>> I'm trying to understand how odp-classifier can work with PKTIO in 
>> ODP_PKTIN_MODE_QUEUE mode, as this combination is allow in the API.
>> When configuring PKTIO in ODP_PKTIN_MODE_QUEUE then application should call 
>> 'odp_pktin_event_queue' to retrieve the odp-queues.
>> When application create a cos, to be used for classification, does it needs 
>> to create new odp-queue or used the pktio's ones?
>> When application wants to receive packets from this PKTIO, it needs to call 
>> 'odp_queue_deq_multi' on one of the PKTIO's queues,right?
>> As a result of a received packet, the matched cos is being selected and it's 
>> queue is being set as the dst_queue of the packet.
>> Then the 'pktin_recv_buf' function will enqueuer this packet to the 
>> 'dst_queue' if it was set.
>> So finally the packet will be located at the cos's queue and not at
>> the PKTIO's queue and the application will get zero packets from 
>> 'odp_queue_deq_multi'.
>> So, either this mode isn't supported with classifier or if this mode is set 
>> then the 'dst_queue' shouldn't be set and the packets will be located at the 
>> PKTIO's queue.
>>
>> Regards,
>> Liron
>>

Reply via email to