Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp717049pxj; Thu, 3 Jun 2021 18:20:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2JRiYxAqfsrpjKrunP9e7lgqZqRRFk5GYLq8OhfBq+W3+B6QWOckscdSF7Qb2C5nOnhwN X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr1868857ejh.8.1622769608922; Thu, 03 Jun 2021 18:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622769608; cv=none; d=google.com; s=arc-20160816; b=sJUZ/NAH9e1gtgjjO+L2qwUnn8Spq6VTbL1g0+BzKE1RBsz3yeB4025Cd9NieEtfSH P2kYPllefcDAl6TkBG0CXqVC4Db7oYanfFRbna10+/mzwU5h+V2drHZRVvtrGhEW2WuZ vntb4243WuPdnTygP8LS0LRWRcr5GJorqFbGrYlQw8RwSZuY+yHwRXSngHzrc+PV8TMZ fLvV4EG4SKz8iNtmOio+8xW99AU3G9WQilayjrq0E2CzADsuNJVl8PEu7XhcE0guvTj3 52rxjEAHAxAr5Ekl4wJTcsdUoFLTao7wpQIcbveBlPwWYKl5yyqMDR+VqYEDi4wfj9ET C4FQ== 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=nTL665YWyehuv/OOgep76lneKPz92U/aJj2qVeUHgiE=; b=xBpYkd/TPdnSbhglEWYP+aWiO11zBmjePXSW1ElikdWkNLk1DsEVKgq82we7b13AuH tYgG2nlRmtVxd9wj9d+CRSTj58XgNLStVGQLtUEqjGYv3KRf65zyzLSKXLIa25vGaqI1 +BsDov+2ah3ON0Z5InTPlZPpxZhx//NR9tMVg6Qg6/IP+U0uu/MjMuH9rGM/ONvdwu3c O5NXm8YeExJcnWCBBBy5knEi1saV1yqeekv9J6y7ZGpnS/N1Dw0JB/jy3dUi3GPp+IBl 9CJNVAPNGDqwuJkyUfP08YnKMl27HdFl5YyQdNfNwWsFN5gFv7hFOrZEKB8ht+TZfh4l Y6uw== 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 m19si3452431edq.272.2021.06.03.18.19.45; Thu, 03 Jun 2021 18:20:08 -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 S229928AbhFDBTy (ORCPT + 99 others); Thu, 3 Jun 2021 21:19:54 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:4294 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFDBTx (ORCPT ); Thu, 3 Jun 2021 21:19:53 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Fx4X13qdWz1BHn7; Fri, 4 Jun 2021 09:13:21 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 09:18:06 +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; Fri, 4 Jun 2021 09:18:05 +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> From: Yunsheng Lin Message-ID: Date: Fri, 4 Jun 2021 09:18:04 +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: <20210603105311.27bb0c4d@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: dggeme714-chm.china.huawei.com (10.1.199.110) 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/4 1:53, Jakub Kicinski wrote: > On Thu, 3 Jun 2021 11:46:43 +0800 Yunsheng Lin wrote: >>>> can devlink port be used to indicate different PF in the same ASIC, >>>> which already has the bus identifiers in it? It seems we need a >>>> extra identifier to indicate the ASIC? >>>> >>>> $ devlink port show >>>> ... >>>> pci/0000:03:00.0/61: type eth netdev sw1p1s0 split_group 0 >>> >>> Ports can obviously be used, but which PCI device will you use to >>> register the devlink instance? Perhaps using just one doesn't matter >>> if there is only one NIC in the system, but may be confusing with >>> multiple NICs, no? >> >> 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, which may change too if the device is pluged into different pci slot on every boot? > >>>> Does it make sense if the PF first probed creates a auxiliary device, >>>> and the auxiliary device driver creates the devlink instance? And >>>> the PF probed later can connect/register to that devlink instance? >>> >>> I would say no, that just adds another layer of complication and >>> doesn't link the functions in any way. >> >> 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. 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? > > . >