On Tue, Oct 5, 2021 at 9:49 PM Alexander Kozyrev <akozy...@nvidia.com> wrote: > > A new, faster, queue-based flow rules management mechanism is needed for > applications offloading rules inside the datapath. This asynchronous > and lockless mechanism frees the CPU for further packet processing and > reduces the performance impact of the flow rules creation/destruction > on the datapath. Note that queues are not thread-safe and queue-based > operations can be safely invoked without any locks from a single thread. > > The rte_flow_q_flow_create() function enqueues a flow creation to the > requested queue. It benefits from already configured resources and sets > unique values on top of item and action templates. A flow rule is enqueued > on the specified flow queue and offloaded asynchronously to the hardware. > The function returns immediately to spare CPU for further packet > processing. The application must invoke the rte_flow_q_dequeue() function > to complete the flow rule operation offloading, to clear the queue, and to > receive the operation status. The rte_flow_q_flow_destroy() function > enqueues a flow destruction to the requested queue. > > Signed-off-by: Alexander Kozyrev <akozy...@nvidia.com> > Suggested-by: Ori Kam <or...@nvidia.com> > --- > lib/ethdev/rte_flow.h | 288 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 288 insertions(+) > > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index ba3204b17e..8cdffd8d2e 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -4298,6 +4298,13 @@ struct rte_flow_port_attr { > * Version of the struct layout, should be 0. > */ > uint32_t version; > + /** > + * Number of flow queues to be configured. > + * Flow queues are used for asyncronous flow rule > creation/destruction. > + * The order of operations is not guaranteed inside a queue. > + * Flow queues are not thread-safe. > + */ > + uint16_t nb_queues; Will it matter if PMD can create a smaller set of queues? Or may be just one? Should the application set this based on get_infos_get() or some other mechanism?
::::