DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [PATCH v2 03/10] ethdev: bring in async queue-based flow rules
@ 2022-01-25  0:00 Ivan Malov
  2022-01-26  5:03 ` Alexander Kozyrev
  0 siblings, 1 reply; 8+ messages in thread
From: Ivan Malov @ 2022-01-25  0:00 UTC (permalink / raw)
  To: Alexander Kozyrev
  Cc: dpdk-dev, Ori Kam, Thomas Monjalon, Andrew Rybchenko,
	Ferruh Yigit, mohammad.abdul.awal, Qi Zhang, Jerin Jacob,
	Ajit Khaparde

Hi Alexander,

This series is very helpful as it draws attention to
the problem of making flow API efficient. That said,
there is much room for improvement, especially in
what comes to keeping things clear and concise.

In example, the following APIs

- rte_flow_q_flow_create()
- rte_flow_q_flow_destroy()
- rte_flow_q_action_handle_create()
- rte_flow_q_action_handle_destroy()
- rte_flow_q_action_handle_update()

should probably be transformed into a unified one

int
rte_flow_q_submit_task(uint16_t                          port_id,
                        uint32_t                          queue_id,
                        const struct rte_flow_q_ops_attr *q_ops_attr,
                        enum rte_flow_q_task_type         task_type,
                        const void                       *task_data,
                        rte_flow_q_task_cookie_t          cookie,
                        struct rte_flow_error            *error);

with a handful of corresponding enum defines and data structures
for these 5 operations. Also, I suggest that the attribute "drain"
be replaced by "postpone" (invert the meaning).

By the way, shouldn't this variety of operation types cover such
from the tunnel offload model? Getting PMD's opaque "tunnel
match" items and "tunnel set" actions - things like that.

rte_flow_q_drain() should then be renamed to rte_flow_q_push_postponed().

The rationale behind my suggestion is that "drain" tricks readers into
thinking that the enqueued operations are going to be completely purged,
whilst the true intention of the API is to "push" them to the hardware.

rte_flow_q_dequeue() also needs to be revisited. The name suggests that
some "tasks" be cancelled, whereas in reality this API implies "poll"
semantics. So why not name it "rte_flow_q_poll"?

I believe this function should return an array of completions, just
like it does in the current version, but provide a "cookie" (can be
represented by a uintptr_t value) for each completion entry.

The rationale behind choosing "cookie" over "user_data" is clarity.
Term "user_data" sounds like "flow action conf" or "counter data",
whilst in reality it likely stands for something normally called
a cookie. Please correct me if I've got that wrong.


Well, the short of it: submit_task(), push_postponed() and poll().
Having a unified "submit_task()" API should allow to reduce the
amount of comment duplication.


In what comes to RST commentary, please consider a bullet-formatted
description for improved readability:

- Flow rule management is done via special flow management queues
- The queue operations are asynchronous and not thread-safe
- The operations can thus be invoked by the app's datapath
- The queue count is configured at initialisation stage
- Available operation types: submit_task, push_postponed and poll
- Polling provides completions for submitted tasks
- The completions can be reordered withing a queue
- Polling must be done on time to avoid overflows


Please note that the above review notes are just a quick primer,
nothing more. I may be mistaken with regard to some aspects.

I humbly request that we agree on the API sketch and naming
before going to the next review cycle.

Thank you.

--
Ivan M.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-02 12:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25  0:00 [PATCH v2 03/10] ethdev: bring in async queue-based flow rules Ivan Malov
2022-01-26  5:03 ` Alexander Kozyrev
2022-01-26 18:54   ` Ajit Khaparde
2022-01-27 21:55     ` Alexander Kozyrev
2022-02-01  0:17       ` Ivan Malov
2022-02-01 17:50         ` Ori Kam
2022-02-01 23:24           ` Ivan Malov
2022-02-02 12:39             ` Ori Kam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).