[ovs-dev] [PATCH] linux: Assume it is local if no API is available.

Eelco Chaudron echaudro at redhat.com
Thu Jun 7 14:33:50 UTC 2018


On 07/06/18 16:10, Flavio Leitner wrote:
> If the 'openvswitch' kernel module is not loaded, the API is not
> available and the userspace will keep retrying. This approach is
> not ideal for the netdev datapath type.
>
> This patch disables network netns support if the error code returned
> indicates that the API is not available.
>
> Reported-by: Eelco Chaudron <echaudro at redhat.com>
> Signed-off-by: Flavio Leitner <fbl at redhat.com>
> ---
>   lib/netdev-linux.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index d2b79e569..10c1e4386 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -586,7 +586,11 @@ netdev_linux_netnsid_update__(struct netdev_linux *netdev)
>       int error;
>   
>       error = dpif_netlink_vport_get(netdev_get_name(&netdev->up), &reply, &buf);
> -    if (error) {
> +    if (error == ENOENT) {
> +        /* Assume it is local if there is no API */
> +        netnsid_set_local(&netdev->netnsid);
> +        return error;
> +    } else if (error) {
>           netnsid_unset(&netdev->netnsid);
>           return error;
>       }

Acked-by: Eelco Chaudron <echaudro at redhat.com>
Tested-by: Eelco Chaudron <echaudro at redhat.com>



More information about the dev mailing list