Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1681981imm; Mon, 3 Sep 2018 06:51:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYS3K0dNbJK6tBXLlbnpqexS/mGOoQyY6aAfYXDufN7jIpoi33bwGnQawRVhQIdqXtAF8cO X-Received: by 2002:a63:986:: with SMTP id 128-v6mr5974155pgj.153.1535982712498; Mon, 03 Sep 2018 06:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535982712; cv=none; d=google.com; s=arc-20160816; b=rtwmqKySRCOiNPNbzFNbf1bZYsSZw7SkZaEjUoyAabWtBfQftA2ni0pIAb8ggnj3pw w7YtXESCXGJZ+5nWtMO+1NwvR7GSN7DeCcmBPoXOxTtJvulxn/X62/udDwE4Pjb96CpG Mv1lsxavh1cDdx+uIKY9v8aMCCSEi6bVK1Lzphz7tYrNUgb+AvT4H/09eNp7RU5feBey Y60GOxBCavXcEstBiWyY3FdZI4aQfAZuTHQ5ENWdX0CC40mQM0jOTQYW6SeNmmnbFf0x 7u+7dQn+phD5y+ahu24snQiX9L9oNrvQSFtHYTedwea/ve21x24XEr9yoleOpyDJ4jbo Xqvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=4xUhdK1QROZbOlBGoCdtKYo47DvMwnvfB+2m4vok4aE=; b=f8gsSd4bskDTJkmoy8xacQl/hDJXDvCUMETekfSm3AynvFXm3SjNIkri1ste9Cv+ca IiicAIx9H5OqgUE3ibgiKxYJb8P3skaeCo8Iu6rvQX5fc+UCB08pdLZv8mxGGnzpz+rG JCVUoK+bWvrGkvoyf/UJgkaEhJBO0QmJ9oWvoL1ysUOJ2Jq9dxoVelZ1KIjOnN9Xe+gL X+tnYzvrPMnWlqDZVBpvJyHVtgdPD3tFLeF0q0OPhBSsLo5hnrgu07kkoMQvSzhasLhV VE6LFDw0c8hG0h7s6P5UBdLy49hQFMGni6zl26GFSP5R3wWE414yjQ34E9Pm/aM68ZHZ 4Npg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si19274491plb.387.2018.09.03.06.51.37; Mon, 03 Sep 2018 06:51:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727552AbeICSKn (ORCPT + 99 others); Mon, 3 Sep 2018 14:10:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45536 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727057AbeICSKn (ORCPT ); Mon, 3 Sep 2018 14:10:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EEF78185331; Mon, 3 Sep 2018 13:50:26 +0000 (UTC) Received: from localhost (ovpn-204-244.brq.redhat.com [10.40.204.244]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF78210EE789; Mon, 3 Sep 2018 13:50:21 +0000 (UTC) Date: Mon, 3 Sep 2018 15:50:20 +0200 From: Jiri Benc To: Kirill Tkhai Cc: Christian Brauner , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, pombredanne@nexb.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, dsahern@gmail.com, fw@strlen.de, lucien.xin@gmail.com, jakub.kicinski@netronome.com, nicolas.dichtel@6wind.com Subject: Re: [PATCH net-next 0/5] rtnetlink: add IFA_IF_NETNSID for RTM_GETADDR Message-ID: <20180903155020.6112f773@redhat.com> In-Reply-To: <2319a029-7aca-b7aa-2e8f-4dfdeedcb6df@virtuozzo.com> References: <20180828231859.29758-1-christian@brauner.io> <20180829181303.4sacopk7y3p5xyou@gmail.com> <81379a4f-7149-10ff-2453-886314d0b0c4@virtuozzo.com> <20180830144544.tpross4jd6awou4u@gmail.com> <20180901013427.tj3t2mlik4t7hlt5@gmail.com> <2319a029-7aca-b7aa-2e8f-4dfdeedcb6df@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 03 Sep 2018 13:50:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 03 Sep 2018 13:50:26 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jbenc@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Sep 2018 16:41:45 +0300, Kirill Tkhai wrote: > But this is a synthetic test, while I asked about real workflow. > Is this real problem for lxd, and there is observed performance > decrease? It's actually not as much a performance problem but rather the only way to get the data in some situations. Namely, when you have only netnsid. This happens e.g. when you want to query a veth peer in another netns. setns() requires a file descriptor which you don't have. Nor there is a way to convert netnsid to a fd. While developing the IFLA_IF_NETNSID patch, I was first thinking about implementing an API doing the conversion. The problem is there's no good place to put this into. It can't be done over netlink: netlink is unreliable and you can't have the kernel open a fd for you and lose it. There's no ioctl to use. So we'd be left with a procfs/sysfs or a syscall. Using netnsid to refer to the target netns seems to be a nice solution - after all, netnsid is the identifier to use in netlink. Jiri