Anything with an initial underscore (like _odp_cast_scalar()) is an implementation-internal API (in this case, linux-generic) and is most definitely neither portable nor subject to any release-to-release compatibility guarantees, so I'd highly discourage trying to use them.
If I understand your use case correctly, you want to create a queue but (perhaps temporarily) put it into a state where other queue operations on it are rejected? We've previously talked about defining an odp_queue_quiesce() API that would prohibit further enqueues to a queue while still permitting existing elements to be dequeued from it. This to support graceful termination where you want to drain a queue before destroying it. A corresponding odp_queue_resume() call would return a quiesced queue to normal operation. Would such a capability suffice for your use case or are you also looking to reject dequeue and/or destroy operations on the queue while it is "invalid"? Also, wouldn't you need a odp_queue_revalidate() API to bookend odp_queue_invalidate()? On Thu, Feb 25, 2016 at 11:17 AM, José Pekkarinen <[email protected] > wrote: > On Thursday 25 February 2016 18:57:47 EXT Bala Manoharan wrote: > > > On 22 February 2016 at 18:04, José Pekkarinen <[email protected] > > > > > > > > wrote: > > > > To provide support of different definitions of odp_queue_t > > > > it's good to have a proper mechanism to set the queue invalid > > > > in case any error during the transmission happen. > > > > > > What is the expectation from the implementation when an application > > > invalidates a queue? > > > The linux-generic implementation does not actually do anything. > > > > > > Regards, > > > Bala > > > > > > > Hi, > > > > If the queue in question is in a bigger structure, like, for instance, an > interface, and we fail during the initialization of it, even if the queue > is ok, we want to ensure that the queue is not used until we are able to > cleanup the rest of the structure from memory. > > > > For this purpose, ofp sets the queue to invalid almost immediately, by > direct assignation. Unfortunately, for unions, direct assignation from a > member of the union doesn't work if you don't name the member you want to > use. And here it should be when we want to provide a platform function that > defines this assignation, using the member of the union. > > > > There is a workaround though, which is to define ODP_QUEUE_INVALID symbol > using _odp_cast_scalar in odp. With this, the assignation works right away, > but we need to compare through odp_queue_to_u64. > > > > Best regards. > > > > José. > > _______________________________________________ > lng-odp mailing list > [email protected] > https://lists.linaro.org/mailman/listinfo/lng-odp > >
_______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
