Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2898426pxj; Sun, 6 Jun 2021 18:39:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi+m6IR08xc3CFfXNHBfzR8r+13g1fBY7/X3rqEjcMpfMB5MVN63w6tM8PmuC0XxLiJBo/ X-Received: by 2002:a17:906:af85:: with SMTP id mj5mr16192734ejb.352.1623029943490; Sun, 06 Jun 2021 18:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623029943; cv=none; d=google.com; s=arc-20160816; b=ZPxPTtX1U4E2cHRJb61emIgFZaFO2X4iOIuWuw/FhMJgjsmY3NGQOMNfIduejDNTKS mmqZGv+813Ohp+MI4NLzpt75tCxEn3oU6ophnmHH+ECsyyamcRoaNRbhramicYQOi2e5 Enzv+RTF9znauAEhB1YyxjTjUL5mm8ps4RhI6Y4u1qirgqlBbv4Bb3cs/VJVjZvIh/3a XuL0sHTJGyLgFk3CD3uvXC4PZAm5r5sCRDzMiybLPyELhyT30eOjP5cZMI9B55JTVQuT Wy096vINE5tAm7bI8bqwQRhTmC0iSHkK8UIAAX5DWvQpuznAMLT6xq/3u7hw6p/lmgd8 a9TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=1qvYXbGigsgPhoemyVCPunB0k9kNcD0/4JNRHmZVmi4=; b=LjmqFKpRfsQhqq5tTEyTCjMvnKdDJPQkFjFT/7IEbGYhSuZYzAPVD80ZzPPL6rH91/ De2gSYvOEaopyEqlNal13qLKj3byfkQ9YBrIISlop38q6fZ11rnnoW4GaR12b56ZkyGg gsXnVnEEXNm/wkPJbQckozBv/XgvKLjvzg+T5tsRY3zC2X+nRywZoDT1ilH71s/Pegj0 A7wX5rHO/n861cSbsfACWyJ4Y8pa6SVNqjV7HN332VZ6qCt8qxqs8uFtIHVK8EctZ0V7 X6esAVbu4Y3FDhE+Lu6U/iFDHqPyspO7Q4eHUgR1l1b2SfORG8ua7SmrD+fW6fLcxodp +7yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn22si11365003edb.132.2021.06.06.18.38.40; Sun, 06 Jun 2021 18:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbhFGBid (ORCPT + 99 others); Sun, 6 Jun 2021 21:38:33 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:7120 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbhFGBic (ORCPT ); Sun, 6 Jun 2021 21:38:32 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FywrH66jJzYrW0; Mon, 7 Jun 2021 09:33:51 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 7 Jun 2021 09:36:39 +0800 Received: from [127.0.0.1] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 7 Jun 2021 09:36:39 +0800 Subject: Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension To: Jakub Kicinski CC: moyufeng , Jakub Kicinski , Jiri Pirko , Parav Pandit , Or Gerlitz , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "michal.lkml@markovi.net" , "davem@davemloft.net" , "gregkh@linuxfoundation.org" , Jiri Pirko , Salil Mehta , "lipeng (Y)" , Guangbin Huang , , "chenhao (DY)" , Jiaran Zhang References: <1551418672-12822-1-git-send-email-parav@mellanox.com> <20190301120358.7970f0ad@cakuba.netronome.com> <20190304174551.2300b7bc@cakuba.netronome.com> <76785913-b1bf-f126-a41e-14cd0f922100@huawei.com> <20210531223711.19359b9a@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> <7c591bad-75ed-75bc-5dac-e26bdde6e615@huawei.com> <20210601143451.4b042a94@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> <20210602093440.15dc5713@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> <857e7a19-1559-b929-fd15-05e8f38e9d45@huawei.com> <20210603105311.27bb0c4d@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> <20210604114109.3a7ada85@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> From: Yunsheng Lin Message-ID: <4e7a41ed-3f4d-d55d-8302-df3bc42dedd4@huawei.com> Date: Mon, 7 Jun 2021 09:36:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20210604114109.3a7ada85@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggeme702-chm.china.huawei.com (10.1.199.98) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/6/5 2:41, Jakub Kicinski wrote: > On Fri, 4 Jun 2021 09:18:04 +0800 Yunsheng Lin wrote: >>>> Yes, it is confusing, how about using the controler_id to indicate >>>> different NIC? we can make sure controler_id is unqiue in the same >>>> host, a controler_id corresponds to a devlink instance, vendor info >>>> or serial num for the devlink instance can further indicate more info >>>> to the system user? >>>> >>>> pci/controler_id/0000:03:00.0/61 >>> >>> What is a "controller id" in concrete terms? Another abstract ID which >>> may change on every boot? >> >> My initial thinking is a id from a global IDA pool, which indeed may >> change on every boot. >> >> I am not really thinking much deeper about the controller id, just >> mirroring the bus identifiers for pcie device and ifindex for netdev, > > devlink instance id seems fine, but there's already a controller > concept in devlink so please steer clear of that naming. I am not sure if controller concept already existed is reusable for the devlink instance representing problem for multi-function which shares common resource in the same ASIC. If not, we do need to pick up other name. Another thing I am not really think throught is how is the VF represented by the devlink instance when VF is passed through to a VM. I was thinking about VF is represented as devlink port, just like PF(with different port flavour), and VF devlink port only exist on the same host as PF(which assumes PF is never passed through to a VM), so it may means the PF is responsible for creating the devlink port for VF when VF is passed through to a VM? Or do we need to create a devlink instance for VF in the VM too when the VF is passed through to a VM? Or more specificly, does user need to query or configure devlink info or configuration in a VM? If not, then devlink instance in VM seems unnecessary? > >> which may change too if the device is pluged into different pci slot >> on every boot? > > Heh. What is someone reflashes the part to change it's serial number? :) > pci slot is reasonably stable, as proven by years of experience trying > to find stable naming for netdevs. I suppose that requires a booting to take effect and a vendor tool to reflash the serial number, it seems reasonable the vendor/user will try their best to not mess the serial number, otherwise service and maintenance based on serial number will not work? I was thinking about adding the vendor name besides the serial number to indicate a devlink instance, to avoid that case that two hw from different vendor having the same serial number accidentally. > >>>> How about: >>>> The PF first probed creates the devlink instance? PF probed later can >>>> connect/register to that devlink instance created by the PF first probed. >>>> It seems some locking need to ensure the above happens as intended too. >>>> >>>> About linking, the PF provide vendor info/serial number(or whatever is >>>> unqiue between different vendor) of a controller it belong to, if the >>>> controller does not exist yet, create one and connect/register to that >>>> devlink instance, otherwise just do the connecting/registering. >>> >>> Sounds about right, but I don't understand why another ID is >>> necessary. Why not allow devlink instances to have multiple names, >>> like we allow aliases for netdevs these days? >> >> We could still allow devlink instances to have multiple names, >> which seems to be more like devlink tool problem? >> >> For example, devlink tool could use the id or the vendor_info/ >> serial_number to indicate a devlink instance according to user's >> request. > > Typing serial numbers seems pretty painful. > >> Aliase could be allowed too as long as devlink core provide a >> field and ops to set/get the field mirroring the ifalias for >> netdevice? > > I don't understand. I meant we could still allow the user to provide a more meaningful name to indicate a devlink instance besides the id. > > . >