Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp41500pxj; Tue, 1 Jun 2021 14:38:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEjH2BS7bksql0IxfIl8OZgINFQRYB0GfMKmvbRM8NFuo3yIFj9tTBAXHJjq5nSRVlwGC1 X-Received: by 2002:a05:6402:138c:: with SMTP id b12mr35094570edv.268.1622583502038; Tue, 01 Jun 2021 14:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622583502; cv=none; d=google.com; s=arc-20160816; b=t3VxcVtqYdV7fAeDAW98v4h72ZNa41/sUhi/4NACKH986me0zW7Ezwo3DVZ5o2BLo9 CNoizj1sJ6P3SdDlPeKlaIMBX7ZlfImXJgRAwrtNF0rdbWsHVHfFkjkzxq2QI3ROLAcN ZuSwhCC3/n5NebcJ4PrdjeWbdL9+0lNTrRjwjXS3ldYQPdf4RFso5pYSr1ZQBAdW9Syv BWskOllQSXKb9APHbR+h+/Y5IX/trNC8+KmAGPs7RfogW1aGuMFrsmXzwggs1L6hQbWo E6nFSp17COpq79nFkxRStRXnya8dAJ4EOykwiEhoVbJ7tkN0oS8Xiof3zqLYuG1kwZCt FuPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+0K8LqTCqfYscJQRpkf3ghpz4x/EkE1z1tcLGbPTs9M=; b=CDJSKOSEKaW7mFNVlU/Vr2RQjXMyG42nSzh+WTREfda9U33swmZdMpjb9lJw1PAJhg 0ZX/15MwnmXi32QyjOGRihrtA+7hEMIVSeTCqUIOG0dTO/3dKvAYtD4hRH4y+r5FvAq+ NKdYSTFKRJEM4vNtHaM5jvNR1UbUjYfr2hBfrLU41/tsfqZXlbnmpEpOKOYsCV6sW6NH GwcVdToTrRr6I43V6kUnRog3DCxrnEhQTctNDt1UsM7RiFIz00gqeHdL7bKUQpIeLybA +gfMFvva6BiC2jZqp0JML18rQYV8n9Vzia92HylY880VsXFr6aZDZqYJxs+R4kwxGZ4x MNNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JBz/dV0t"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si20789163eje.207.2021.06.01.14.37.58; Tue, 01 Jun 2021 14:38:22 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JBz/dV0t"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234892AbhFAVge (ORCPT + 99 others); Tue, 1 Jun 2021 17:36:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:54456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234747AbhFAVge (ORCPT ); Tue, 1 Jun 2021 17:36:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC3E0613B4; Tue, 1 Jun 2021 21:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622583292; bh=kqnuJdvqpIeAot1ffooo2UK7VmfmnWmuJOhnmB7pOHE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JBz/dV0tsA2sAWPt5ApH1k3KAicOPjy88X0j4W2Xj9ZCN6k5e+JMh6fGGyjF8Xb3Y euKnsRkdtTihdnJ0sGQUblOUqdsZ6TnN54gQuSstIzvPXuARMk4Hmq6N1uAxkAzVBD a4UxPjQOvmIzZt7T1rJE0OxdEMlQSPODBVK/XWuPmSkqH77v3bdL0HkjbM+ObfP5rH UEoenbNOS5F/cYYBy9/JE/6OKPmByrQoJYta/cHvnwv5Qb+y9NbLj0bSZa+vxNixsG i9A+JHLGJdjDc3VtEufqUEe0u5HUTCqQMF1HteCrJiKTCn8z631iUHpC0P3WfOqym0 k8WyZWizSpnOw== Date: Tue, 1 Jun 2021 14:34:51 -0700 From: Jakub Kicinski To: Yunsheng Lin 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 Subject: Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension Message-ID: <20210601143451.4b042a94@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <7c591bad-75ed-75bc-5dac-e26bdde6e615@huawei.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Jun 2021 15:33:09 +0800 Yunsheng Lin wrote: > On 2021/6/1 13:37, Jakub Kicinski wrote: > > On Mon, 31 May 2021 18:36:12 +0800 moyufeng wrote: > >> Hi, Jiri & Jakub > >> > >> Generally, a devlink instance is created for each PF/VF. This > >> facilitates the query and configuration of the settings of each > >> function. But if some common objects, like the health status of > >> the entire ASIC, the data read by those instances will be duplicate. > >> > >> So I wonder do I just need to apply a public devlink instance for the > >> entire ASIC to avoid reading the same data? If so, then I can't set > >> parameters for each function individually. Or is there a better suggestion > >> to implement it? > > > > I don't think there is a great way to solve this today. In my mind > > devlink instances should be per ASIC, but I never had to solve this > > problem for a multi-function ASIC. > > Is there a reason why it didn't have to be solved yet? > Is it because the devices currently supporting devlink do not have > this kind of problem, like single-function ASIC or multi-function > ASIC without sharing common resource? I'm not 100% sure, my guess is multi-function devices supporting devlink are simple enough for the problem not to matter all that much. > Was there a discussion how to solved it in the past? Not really, we floated an idea of creating aliases for devlink instances so a single devlink instance could answer to multiple bus identifiers. But nothing concrete. > > Can you assume all functions are in the same control domain? Can they > > trust each other? > > "same control domain" means if it is controlled by a single host, not > by multi hosts, right? > > If the PF is not passed through to a vm using VFIO and other PF is still > in the host, then I think we can say it is controlled by a single host. > > And each PF is trusted with each other right now, at least at the driver > level, but not between VF. Right, the challenge AFAIU is how to match up multiple functions into a single devlink instance, when driver has to probe them one by one. If there is no requirement that different functions are securely isolated it becomes a lot simpler (e.g. just compare device serial numbers).