Hello Nikhil,

ipsec example can work with polling queues and with scheduler:

#ifdef IPSEC_POLL_QUEUES
#define QUEUE_CREATE(n, t, p) polled_odp_queue_create(n, t, p)
#define SCHEDULE(q, w)        polled_odp_schedule(q, w)

#else

#define QUEUE_CREATE(n, t, p) odp_queue_create(n, t, p)
#define SCHEDULE(q, w)        odp_schedule(q, w)

#endif

So that in one case there is dequeue in other odp_schedule(). I do not see
problem here.

Thanks,
Maxim


On 12 March 2015 at 18:11, [email protected] <
[email protected]> wrote:

>  Hi All,
>
>
>
> ODP API reference manual states that API odp_queue_deq cannot be used with
> queue of type ODP_QUEUE_TYPE_SCHED, Which is logical as queue is already
> scheduled so we need to call odp_schedule for these type of queues.
>
>
>
> In contrast with above statement ODP IPSEC example application creates
> completion queue\device default in queue in schedule mode and later in the
> pktio thread calls odp_queue_deq for those queues.
>
>
>
> Following is the code snippet from ODP IPSEC application:
>
>
>
> Main()
>
> {
>
> ………
>
> ………
>
>         completionq = QUEUE_CREATE("completion",
>
>                                    ODP_QUEUE_TYPE_SCHED,
>
>                                    &qparam);
>
> ………
>
> }
>
>
>
> QUEUE_CREATE()
>
> {
>
> ……….
>
> ……….
>
>         if ((ODP_QUEUE_TYPE_SCHED == type) || (ODP_QUEUE_TYPE_PKTIN ==
> type)) {
>
>                 poll_queues[num_polled_queues++] = my_queue;
>
>                 printf("%s: adding %d\n", __func__, my_queue);
>
>         }
>
> ……….
>
> }
>
> Polled_odp_schedule()
>
> {
>
> ………………….
>
> ………………..
>
>                 for (idx = 0; idx < num_polled_queues; idx++) {
>
>                         odp_queue_t queue = poll_queues[idx];
>
>                         odp_buffer_t buf;
>
>
>
>                         buf = odp_queue_deq(queue);
>
> ……………….
>
> ……………....
>
>
>
> }
>
>
>
>
>
> Please clarify.
>
>
>
> Regards
>
> Nikhil
>
> _______________________________________________
> 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