> >>> + * Check the status of a Rx descriptor in the queue > >> I think it would be useful to highlight caller context. > >> Should it be the same CPU which receives packets from the queue? > > Yes, you are right it would be useful. I suggest the following sentences: > > > > This function should be called on a dataplane core like the > > Rx function. They should not be called concurrently on the same > > queue. > > The first sentence looks fine. "They" (functions?, dataplane cores?) is > unclear for me in the second. May be the first one is simply sufficient.
Ok, I'll keep the first one at least, and see if I can reword the second one to make it clear. > >>> + * > >>> + * @param port_id > >>> + * The port identifier of the Ethernet device. > >>> + * @param queue_id > >>> + * The Rx queue identifier on this port. > >>> + * @param offset > >>> + * The offset of the descriptor starting from tail (0 is the next > >>> + * packet to be received by the driver). > >>> + * @return > >>> + * - (RTE_ETH_DESC_AVAIL): Descriptor is available for the hardware to > >>> + * receive a packet. > >>> + * - (RTE_ETH_DESC_DONE): Descriptor is done, it is filled by hw, but > >>> + * not yet processed by the driver (i.e. in the receive queue). > >>> + * - (RTE_ETH_DESC_USED): Descriptor is unavailable (hold by driver, > >>> + * not yet returned to hw). > >> It looks like it is the most suitable for descriptors which are reserved > >> and never used. > > Can you give some more details about what is a reserved but never > > used descriptor? (same question for Tx) > > Our HW has a requirement to keep few descriptors always unused (i.e. > some gap between tail and head). It is just a few descriptors, but > invalid descriptor status may misguide application. E.g. if Rx queue > size is 512 and offset 510, it will always be unused (since it is > reserved). It is not an indication that core is too slow and can't keep > the pace. Understood. I can change _USED into _UNAVAIL (add it for Tx), with the following description: - (RTE_ETH_DESC_UNAVAIL): Descriptor is unavailable: either hold by driver and not yet returned to hw, or reserved by the hardware.