<div dir="ltr">Thank you for these notes. I submitted a v3 with the following changes.<div><br></div><div>1. Fixed bit allocation in the flow rule bitmap using the suggestion given.</div><div>2. Changed rte_zmalloc/rte_free for struct gve_flow to calloc/free. In making this change, I realized that the driver currently would not support flow operations from secondary processes, so I made a note of that in gve.rst.</div><div>3. Changed both verbs to "added" to match the notes from other drivers.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 3, 2026 at 7:21 AM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org" target="_blank">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 3 Mar 2026 00:58:00 +0000<br>
"Jasper Tran O'Leary" <<a href="mailto:jtranoleary@google.com" target="_blank">jtranoleary@google.com</a>> wrote:<br>
<br>
> This patch series adds flow steering support to the Google Virtual<br>
> Ethernet (gve) driver. This functionality allows traffic to be directed<br>
> to specific receive queues based on user-specified flow patterns.<br>
> <br>
> The series includes foundational support for extended admin queue<br>
> commands needed to handle flow rules, the specific adminqueue commands<br>
> for flow rule management, and the integration with the DPDK rte_flow<br>
> API. The series adds support flow matching on the following protocols:<br>
> IPv4, IPv6, TCP, UDP, SCTP, ESP, and AH.<br>
> <br>
> Patch Overview:<br>
> <br>
> 1. "net/gve: add flow steering device option" checks for and enables<br>
> the flow steering capability in the device options during<br>
> initialization.<br>
> 2. "net/gve: introduce extended adminq command" adds infrastructure<br>
> for sending extended admin queue commands. These commands use a<br>
> flexible buffer descriptor format required for flow rule management.<br>
> 3. "net/gve: add adminq commands for flow steering" implements the<br>
> specific admin queue commands to add and remove flow rules on the<br>
> device, including handling of rule IDs and parameters.<br>
> 4. "net/gve: add rte flow API integration" exposes the flow steering<br>
> functionality via the DPDK rte_flow API. This includes strict<br>
> pattern validation, rule parsing, and lifecycle management (create,<br>
> destroy, flush). It ensures thread-safe access to the flow subsystem<br>
> and proper resource cleanup during device reset.<br>
> <br>
> Jasper Tran O'Leary (2):<br>
> net/gve: add adminq commands for flow steering<br>
> net/gve: add rte flow API integration<br>
> <br>
> Vee Agarwal (2):<br>
> net/gve: add flow steering device option<br>
> net/gve: introduce extended adminq command<br>
> <br>
> doc/guides/nics/features/gve.ini | 12 +<br>
> doc/guides/nics/gve.rst | 26 +<br>
> doc/guides/rel_notes/release_26_03.rst | 1 +<br>
> drivers/net/gve/base/gve.h | 3 +-<br>
> drivers/net/gve/base/gve_adminq.c | 118 ++++-<br>
> drivers/net/gve/base/gve_adminq.h | 57 +++<br>
> drivers/net/gve/gve_ethdev.c | 83 +++-<br>
> drivers/net/gve/gve_ethdev.h | 46 ++<br>
> drivers/net/gve/gve_flow_rule.c | 656 +++++++++++++++++++++++++<br>
> drivers/net/gve/gve_flow_rule.h | 65 +++<br>
> drivers/net/gve/meson.build | 1 +<br>
> 11 files changed, 1063 insertions(+), 5 deletions(-)<br>
> create mode 100644 dpdk/drivers/net/gve/gve_flow_rule.c<br>
> create mode 100644 dpdk/drivers/net/gve/gve_flow_rule.h<br>
> <br>
<br>
Automated review spotted a few things:<br>
<br>
1. rte_bitmap_scan usage is incorrect.<br>
2. Using rte_malloc where not necessary<br>
3. Grammar in the release note.<br>
<br>
I can fix the last one when merging, the second one is not a big issue<br>
but would be good to have.<br>
<br>
---<br>
<br>
<br>
Error: Incorrect rte_bitmap_scan usage — wrong rule ID allocation (~85% confidence)<br>
<br>
In gve_create_flow_rule():<br>
c<br>
<br>
uint64_t bmp_slab __rte_unused;<br>
...<br>
if (rte_bitmap_scan(priv->avail_flow_rule_bmp, &flow->rule_id,<br>
&bmp_slab) == 1) {<br>
rte_bitmap_clear(priv->avail_flow_rule_bmp, flow->rule_id);<br>
}<br>
<br>
rte_bitmap_scan() writes the slab base position to pos and the slab bit pattern to slab. The actual bit position of the first available rule is pos + __builtin_ctzll(slab), not pos alone. The __rte_unused annotation on bmp_slab confirms the slab value is being ignored entirely.<br>
<br>
After the first rule allocation clears bit 0, a subsequent scan returns the same slab base (pos=0) with bit 0 now clear in the slab. The code would again set rule_id=0 and attempt to clear an already-clear bit, then try to create a duplicate rule on the device.<br>
<br>
Suggested fix:<br>
c<br>
<br>
uint64_t bmp_slab;<br>
uint32_t pos;<br>
...<br>
if (rte_bitmap_scan(priv->avail_flow_rule_bmp, &pos,<br>
&bmp_slab) == 1) {<br>
flow->rule_id = pos + __builtin_ctzll(bmp_slab);<br>
rte_bitmap_clear(priv->avail_flow_rule_bmp, flow->rule_id);<br>
}<br>
<br>
Warning: rte_zmalloc used for ordinary control structures<br>
<br>
Both avail_flow_rule_bmp_mem and individual gve_flow structures are allocated with rte_zmalloc, but they don't require DMA access, NUMA placement, or multi-process shared memory. Standard calloc/malloc would be more appropriate and wouldn't consume limited hugepage resources.<br>
<br>
Warning: Release notes tense inconsistency<br>
rst<br>
<br>
* Added application-initiated device reset.<br>
+ * Add support for receive flow steering.<br>
<br>
"Added" (past tense) vs "Add" (imperative). Both entries should use the same tense for consistency. The DPDK convention is imperative mood.<br>
<br>
</blockquote></div>