From patchwork Thu Jun 7 14:10:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 926329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 411nXL6LSLz9s01 for ; Fri, 8 Jun 2018 00:11:30 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C441ACD3; Thu, 7 Jun 2018 14:11:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 47E64CD0 for ; Thu, 7 Jun 2018 14:11:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E43C0735 for ; Thu, 7 Jun 2018 14:11:09 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id g126-v6so6617894qke.10 for ; Thu, 07 Jun 2018 07:11:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lw1DVp7U78kMQOGRea72k4msUrBp62ifPUv53mWZJaE=; b=TCm630tWm/nZIGvre/2rdj2ST3g51CuImsppcMGvsvhjdIvl9t1/vsbKTq4ekaTxP1 yOCMLU6si5NYGX1GTtvTsZzgwWSfyG3GwnCBryYp6/PZWrz8ywcto15rB1FfJvVAP9Em jK9VSlL3gD6GytZ2HvW7mADCxiYq31MJGMcdd369AslzrS7bGcbKkDBrQ/RQHVn1neOd 7Ks85YaDlgQiEC0FSnRnthbCMGQPzwH9Ew27IjF0qgBSiuz0aSxGbWYyTDc4Esc1V2U1 /mYRpw/AK+oLkYXBLGwX8MLBV/FON7D483Lk+DiJYnmP3z1S5dygTedb+/G4RLaqJ1Jj RcRw== X-Gm-Message-State: APt69E2nZ8m5zoKBoyMRNu+VXCaS9pSDyt9BnRuYEVeR7zcVCLNwzZg1 jkLfXZePzVsCH5c1diHlqZL2rk77Nx8= X-Google-Smtp-Source: ADUXVKKssySO4eoXC/YyC8j56YF/QvEQn9IV9aaHnkEOt8QzaTSu9eo6DG0zzr1z2NKBnQpW/aV2bg== X-Received: by 2002:a37:9c89:: with SMTP id f131-v6mr1622947qke.94.1528380668899; Thu, 07 Jun 2018 07:11:08 -0700 (PDT) Received: from localhost ([177.183.215.231]) by smtp.gmail.com with ESMTPSA id y188-v6sm13601282qkb.23.2018.06.07.07.11.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jun 2018 07:11:08 -0700 (PDT) From: Flavio Leitner To: dev@openvswitch.org Date: Thu, 7 Jun 2018 11:10:52 -0300 Message-Id: <20180607141052.30002-1-fbl@redhat.com> X-Mailer: git-send-email 2.14.3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] linux: Assume it is local if no API is available. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 Signed-off-by: Flavio Leitner Acked-by: Eelco Chaudron Tested-by: Eelco Chaudron --- 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; }