Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2320027ybl; Mon, 20 Jan 2020 00:21:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwsUIByJiHOLKd9+0KdAVKybiHlx39E+HNNN2x4ACGOu/Ehsp4q7yi4HQxxK0bJfR7PUrio X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr14206942otq.147.1579508465126; Mon, 20 Jan 2020 00:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579508465; cv=none; d=google.com; s=arc-20160816; b=NUODVpI/RdnIvJY9wGPeIVYROzbK2+lu+5RhdUemo0G+JEonmFUQHSoOVxKonXFpc2 oUtpoH5mqeYU1m3Xi5mCObQIc0AI+8RtFVnweLTMQEGggrzd527JWQL3ZIway0bD0CR1 Y2w+djVGEMGZ+XMFIcN+qZh5oRBVHOOnXNGTXevUlp6qzhkk2zK2U3ssdc12T3CM7lHP 8h/wRDJtoJmjV3uMgEwkXIcu3x8EIa+t9Inekn16pZNYKZvUeHAOrySOmhhPl7QYnpx4 MrBO1+FD9YqHjJnHGwtnYTehkY1zR8Xmstum3DI0V85xU7Ayuk6XtRUC1eyGZSp5NQ99 KwnQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=jEiSgvaAAQAeTsd3Se/ZuFf+OWr2upYmR4dY+/WXBIE=; b=NOiPU/Fy8pIBCw9b5J22n7/YRXxDq1C+Pubwu6j2e5f0McTcBBpi9RqwAhrHaBRSf3 /DUwXC7Wenyf98W8UzIwkkEt7eFfc1RZ3n1K9xD/yzZwYsJiQ8tQbBIsJS1aPmjvng7V AhMcMjMf26+3n74ml7xGgstnRELnxmNr2zr+OuLKJCfIfRLRgUKn3pJ1lPrhJon2NyFk UBvrHyUF1pkPJ4S5G3OHBPzOHwpbJYNO3KtxdihznbVc4sZp8aPVpXeScbf8CeT1Co5X n/GM7sBeKyu7NI5DCUzRhIhyjRD92T+LGzA4rFITdiqOVjoN7B7CgT8WW2briK/qg0ZO FaHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ibL7D0nY; 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=pass (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 s19si20657205otd.9.2020.01.20.00.20.53; Mon, 20 Jan 2020 00:21:05 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ibL7D0nY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgATITl (ORCPT + 99 others); Mon, 20 Jan 2020 03:19:41 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:45423 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726039AbgATITk (ORCPT ); Mon, 20 Jan 2020 03:19:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579508379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jEiSgvaAAQAeTsd3Se/ZuFf+OWr2upYmR4dY+/WXBIE=; b=ibL7D0nYBdVAuzgQi1hQ4cGrzNLdMMOedSTC7t+QjxuXTyUh3aPc/std25xZPaGIVNqn6T Lc2YbpBakfLwSdIu1X1yH7lMsEPV5HTRRFKzIBE+Lr/AlpQT2tQhTagCxhd6oi0csFDWl1 sYha7TiRS13k8k+z1EhpjfL6P40Zn/Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-P8KSRlF4PzGBmy91vGOhqQ-1; Mon, 20 Jan 2020 03:19:38 -0500 X-MC-Unique: P8KSRlF4PzGBmy91vGOhqQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E91FADB60; Mon, 20 Jan 2020 08:19:34 +0000 (UTC) Received: from [10.72.12.173] (ovpn-12-173.pek2.redhat.com [10.72.12.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 071CE2857A; Mon, 20 Jan 2020 08:19:11 +0000 (UTC) Subject: Re: [PATCH 3/5] vDPA: introduce vDPA bus To: Rob Miller Cc: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Netdev , "Bie, Tiwei" , Jason Gunthorpe , maxime.coquelin@redhat.com, "Liang, Cunming" , "Wang, Zhihong" , "Wang, Xiao W" , haotian.wang@sifive.com, "Zhu, Lingshan" , eperezma@redhat.com, lulu@redhat.com, Parav Pandit , "Tian, Kevin" , stefanha@redhat.com, rdunlap@infradead.org, hch@infradead.org, Ariel Adam , jakub.kicinski@netronome.com, Jiri Pirko , shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com References: <20200116124231.20253-1-jasowang@redhat.com> <20200116124231.20253-4-jasowang@redhat.com> <20200117070324-mutt-send-email-mst@kernel.org> <239b042c-2d9e-0eec-a1ef-b03b7e2c5419@redhat.com> From: Jason Wang Message-ID: Date: Mon, 20 Jan 2020 16:19:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/1/17 =E4=B8=8B=E5=8D=8810:12, Rob Miller wrote: > > > >> + * @get_vendor_id:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Get id for= the vendor that > provides this device > >> + *=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 @vdev: vdpa device > >> + *=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 Returns u32: virtio vendor id > > what's the idea behind this? userspace normally doesn't interact > with > > this ... debugging? > > > This allows some vendor specific driver on top of vDPA bus. If > this is > not interested, I can drop this. > > RJM>] wouldn't=C2=A0 usage of get_device_id & get_vendor_id, beyond=20 > reporting, tend to possibly leading to vendor specific code in the=20 > framework instead of leaving the framework=C2=A0agnostic and leave the=20 > vendor specific stuff to the vendor's vDPA device driver? For virtio device id, I think it is needed for kernel/userspace to know=20 which driver to load (e.g loading virtio-net for networking devic). For virtio vendor id, it was needed by kernel virtio driver, and virtio=20 bus can match driver based on virtio vendor id. So it doesn't prevent=20 3rd vendor specific driver for virtio device. Maybe we can report VIRTIO_DEV_ANY_ID as vendor id to forbid vendor=20 specific stuffs. Thanks