On 14 Jan 2026, at 0:28, Ilya Maximets wrote:

> On 1/12/26 12:20 PM, Eelco Chaudron wrote:
>> This patch introduces new APIs in dpif-offload to allow userspace
>> datapaths to directly manage flows in the offloaded datapath,
>> providing efficient fast-path operations.
>>
>> Acked-by: Eli Britstein <elibr.nvidia.com>
>> Signed-off-by: Eelco Chaudron <[email protected]>
>> ---

[...]
>> -struct netdev *
>> -dpif_offload_get_netdev_by_port_id(struct dpif *dpif,
>> -                                   struct dpif_offload **offload,
>> -                                   odp_port_t port_no)
>> +static struct netdev *
>> +dpif_offload_get_netdev_by_port_id_(struct dp_offload *dp_offload,
>
> nit: Double underscore.

Fixed in v6.

[...]

>> diff --git a/lib/dpif-offload.h b/lib/dpif-offload.h
>> index 53569822e..f246d778b 100644
>> --- a/lib/dpif-offload.h
>> +++ b/lib/dpif-offload.h
>> @@ -141,4 +141,58 @@ bool dpif_offload_netdev_same_offload(const struct 
>> netdev *,
>>  int dpif_offload_netdev_flush_flows(struct netdev *);
>>  int dpif_offload_netdev_hw_post_process(struct netdev *, struct dp_packet 
>> *);
>>
>> +
>> +/* Flow modification callback definitions. */
>
> This mechanism of callbacks can use a some documentation in the comments,
> it is not obvious how it supposed to work.
>

Added a comment in v6.

>> +typedef void dpif_offload_flow_op_cb(void *aux_dp, void *aux_flow,
>> +                                     struct dpif_flow_stats *stats,
>> +                                     uint32_t flow_mark, int error);
>> +
>> +/* Supporting structures for flow modification functions. */
>> +struct dpif_offload_flow_cb_data {
>> +    dpif_offload_flow_op_cb *callback;
>> +    void *callback_aux_dp;
>> +    void *callback_aux_flow;
>> +};
>> +
>> +struct dpif_offload_flow_put {
>> +    bool modify;
>> +    odp_port_t in_port;
>> +    odp_port_t orig_in_port;  /* Originating in_port for tunneled packets. 
>> */
>> +    const ovs_u128 *ufid;
>> +    struct match *match;
>> +    const struct nlattr *actions;
>> +    size_t actions_len;
>> +    struct dpif_flow_stats *stats;
>> +    struct dpif_offload_flow_cb_data cb_data;
>> +};
>> +
>> +struct dpif_offload_flow_del {
>> +    odp_port_t in_port;
>> +    const ovs_u128 *ufid;
>> +    struct dpif_flow_stats *stats;
>> +    struct dpif_offload_flow_cb_data cb_data;
>> +};
>> +
>> +/* Flow modification functions, which can be used in the fast path. */
>
> Do these need 'datapath' in their names?

I added _datapath_ so it’s clear that these functions should be called from the 
datapath (dpif-netdev), and not be confused with the general flow API. So my 
preference is to keep it.

>> +int dpif_offload_datapath_flow_put(const char *dpif_name,
>> +                                   struct dpif_offload_flow_put *,
>> +                                   uint32_t *flow_mark);
>> +int dpif_offload_datapath_flow_del(const char *dpif_name,
>> +                                   struct dpif_offload_flow_del *,
>> +                                   uint32_t *flow_mark);
>> +bool dpif_offload_datapath_flow_stats(const char *dpif_name,
>> +                                      odp_port_t in_port, const ovs_u128 
>> *ufid,
>> +                                      struct dpif_flow_stats *,
>> +                                      struct dpif_flow_attrs *);
>> +

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to