On 12/17/21 09:04, Roi Dayan wrote:
> 
> 
> On 2021-12-17 2:05 AM, Ilya Maximets wrote:
>> netdev_set_dpif_type() can only be used with a normalized dpif type
>> as an argument, which is a constant static string derived from a type
>> of a dpif_class or a constant string "system".  Usage of a same
>> constant string allows netdev-offload module to compare types by
>> simply comparing pointers.
>>
>> OTOH, 'br->ofproto->type' is a dynamic string that:
>> a. Can be NULL.
>> b. Even if not NULL and equal, can be a different dynamically
>>     allocated string.
>>
>> Both these qualities breaks assumptions made by all other modules
>> related to HW offload, breaking the functionality.
>>
>> Fix that by moving netdev_set_dpif_type() to dpif.c and calling with
>> a correct constant string as an argument.
>>
>> The call moved from bridge.c to dpif.c, because we need to have access
>> to the dpif class, but bridge.c should not.
>>
>> Not trying to set the dpif_type inside the netdev_ports_insert(),
>> because it's used now outside the offloading context.  So, it's
>> cleaner to move the netdev_set_dpif_type() call outside of the
>> netdev-offload module.
>>
>> Additionally removed the redundant call from the netdev_ports_insert()
>> and refactored the function, since it doesn't need an extra argument
>> anymore.
>>
>> Fixes: 4f19a78a61c5 ("netdev-vport: Fix userspace tunnel ioctl(SIOCGIFINDEX) 
>> info logs.")
>> Reported-by: Roi Dayan <[email protected]>
>> Reported-at: 
>> https://mail.openvswitch.org/pipermail/ovs-dev/2021-December/390117.html
>> Signed-off-by: Ilya Maximets <[email protected]>
>> ---
>>   lib/dpif.c           | 7 +++++--
>>   lib/netdev-offload.c | 8 ++++----
>>   lib/netdev-offload.h | 3 +--
>>   vswitchd/bridge.c    | 2 --
>>   4 files changed, 10 insertions(+), 10 deletions(-)
>>
> 
> Acked-by: Roi Dayan <[email protected]>

Thanks!  Applied.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to