On 10 Dec 2025, at 8:53, Eli Britstein wrote:

>> -----Original Message-----
>> From: dev <[email protected]> On Behalf Of Eelco Chaudron
>> Sent: Tuesday, 2 December 2025 16:05
>> To: [email protected]
>> Subject: [ovs-dev] [PATCH v2 10/41] dpif-offload: Validate mandatory port 
>> class
>> callbacks on registration.
>>
>> Now that all providers have implemented the port APIs, validate them on
>> registration.
>>
>> Signed-off-by: Eelco Chaudron <[email protected]>
>> ---
>> lib/dpif-offload.c | 16 ++++------------
>> 1 file changed, 4 insertions(+), 12 deletions(-)
>>
>> diff --git a/lib/dpif-offload.c b/lib/dpif-offload.c index 
>> 43258dd55..5c6b827c3
>> 100644
>> --- a/lib/dpif-offload.c
>> +++ b/lib/dpif-offload.c
>> @@ -151,7 +151,9 @@ dp_offload_initialize(void)
>>     for (int i = 0; i < ARRAY_SIZE(base_dpif_offload_classes); i++) {
>>         ovs_assert(base_dpif_offload_classes[i]->open
>>                    && base_dpif_offload_classes[i]->close
>> -                   && base_dpif_offload_classes[i]->can_offload);
>> +                   && base_dpif_offload_classes[i]->can_offload
>> +                   && base_dpif_offload_classes[i]->port_add
>> +                   && base_dpif_offload_classes[i]->port_del);
>>
>>         dpif_offload_register_provider(base_dpif_offload_classes[i]);
>>     }
>> @@ -438,10 +440,6 @@ dpif_offload_port_add(struct dpif *dpif, struct netdev
>> *netdev,
>>     }
>>
>>     LIST_FOR_EACH (offload, dpif_list_node, &dp_offload->offload_providers) {
>> -        if (!offload->class->port_add) {
>> -            continue;
>> -        }
>> -
>>         if (offload->class->can_offload(offload, netdev)) {
>>             int err = offload->class->port_add(offload, netdev, port_no);
>>             if (!err) {
>> @@ -473,13 +471,7 @@ dpif_offload_port_del(struct dpif *dpif, odp_port_t
>> port_no)
>>     }
>>
>>     LIST_FOR_EACH (offload, dpif_list_node, &dp_offload->offload_providers) {
>> -        int err;
>> -
>> -        if (!offload->class->port_del) {
>> -            continue;
>> -        }
>> -
>> -        err = offload->class->port_del(offload, port_no);
>> +        int err = offload->class->port_del(offload, port_no);
> Blank line

Thanks, will add it.

>>         if (err) {
>>             VLOG_ERR("Failed deleting port_no %d from dpif-offload provider "
>>                      "%s, error %s", port_no, dpif_offload_name(offload),

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

Reply via email to