Hi Petri, See comments inline
Liron -----Original Message----- From: Savolainen, Petri (Nokia - FI/Espoo) [mailto:petri.savolai...@nokia.com] Sent: Friday, November 10, 2017 13:13 To: Liron Himi <lir...@marvell.com>; Bala Manoharan <bala.manoha...@linaro.org> Cc: lng-odp@lists.linaro.org Subject: RE: [EXT] Re: [lng-odp] classifier with pktio in ODP_PKTIN_MODE_QUEUE odp_pktin_event_queue() is *not* used when classifier is enabled. odp_queue_deq(q) 1) if q has events, return an event 2) if q does not have events, poll packet input [L.H.] how do I know which is the packet input? Maybe it is expected to set the ' dequeue_multi' of the queue once it's cos was somehow assigned to PKTIO. If so, does it means a queue can only be attached to one PKTIO? * packet input poll finds a packet * classify the packet * enqueue the packet into an event queue * some later odp_queue_deq() call will find the packet from the queue (not necessary q, but the destination queue of the CoS) -Petri > -----Original Message----- > From: Liron Himi [mailto:lir...@marvell.com] > Sent: Friday, November 10, 2017 12:23 PM > To: Bala Manoharan <bala.manoha...@linaro.org>; Savolainen, Petri > (Nokia - > FI/Espoo) <petri.savolai...@nokia.com> > Cc: lng-odp@lists.linaro.org; Liron Himi <lir...@marvell.com> > Subject: RE: [EXT] Re: [lng-odp] classifier with pktio in > ODP_PKTIN_MODE_QUEUE > > Hi, > > I understand what you are saying, but I don't understand (probably I > miss something here) how classifier is working in PKTIO in a > ODP_PKTIN_MODE_QUEUE mode. > Application create its own queues, associate them to the cos and > connect them to the classifier. > In order to receive packets, application will call ' odp_queue_deq()'. > But how the packets will be enqueued to this queue? > Who will call ' odp_pktin_recv' to receive the packets, as in the > schedule mode case? > > Consider the following scenario and let me know if it is acceptable: > Application wants to configure classifier but doesn't want to use the > odp- schedule. So, > - PKTIO is configure with ' ODP_PKTIN_MODE_QUEUE' mode and classifier > enable. > - application will call ' odp_pktin_event_queue' to get all pktio's > event queues. > - application will associate those queues in the desired cos and > configure the classifier with them. > - application will call ' odp_queue_deq()' and as a result the ' > odp_pktin_recv' will be triggered (as it is a PKTIO's event queue). > Implementation should not set the 'dst_queue' in this mode and as a > result the packet will be return to originated queue. > > Liron > > -----Original Message----- > From: Bala Manoharan [mailto:bala.manoha...@linaro.org] > Sent: Friday, November 10, 2017 11:27 > To: Liron Himi <lir...@marvell.com> > Cc: lng-odp@lists.linaro.org > Subject: Re: [EXT] Re: [lng-odp] classifier with pktio in > ODP_PKTIN_MODE_QUEUE > > 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 > >>