Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp450520pxk; Thu, 1 Oct 2020 06:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhvHflB16tQ0oe+Cbn9nsnVXRcZoyv+F5KF2WsGK8zd1p7C56zqk8/HvSdKJ4Shr9q0wcm X-Received: by 2002:a17:906:7cb:: with SMTP id m11mr8334132ejc.41.1601559089842; Thu, 01 Oct 2020 06:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601559089; cv=none; d=google.com; s=arc-20160816; b=XgLC4S/rEAsxOK01O9jcrXkUSrrWxY3W+mZejwLxXXDk2BPfAR+rSnKEm+D+VpoQlN B3FjAK0MzwCIUe7lwkuPRMZd6iotLrqd2ryHyYhGAR2iefwIc8RyyUyxkaND8zC6NwQW 1npl41oqQyOuMe0Dtsry+gH0XAqNWotjQOXcJmhygDYYIy7cqfpD2tlqNYja6qhXtTyj XW2a49UGmBMFYCCn3bFNLy7ntE4APOfZ0dFIQHypoeip/ZEfiNsOcIhQn6Uwx/g6Al7h iwoEEgVPzZ6/NbdtPzUkI6FEbeuG5b4ogYPtohAGGNABVTLbwqdDrHSvCOXGds/WCTwO 1evg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=6rUIYxTqLpEGk7XTShhqnq3D5EFt6vSHTg69vpLWGeQ=; b=DHvr6Vm1RSqd1FpM61tnm+Ese/gotp20rLNfBh/M1/iq6DnoEqtxn6eS6N1aoT+Dss 0JToNONRdcADgb0i0Hit3uOpn9maOjI8SKmF0HSTpUgkq/VkHKtTW0HGrbaTdu3aOhQA gaxCF/HAF8W84K68nnpdFhypvKAXr+aWQ9Msk1OjoPdojHK0SBzwfcTPexiuJLLvcTkC nGloi4VG9aOtvb2fOkdqEirF21Vni3dvEVDwdfk551s8uZ1b/wDXENKmmV9KBg7Lqupm N0IVzpnCbXdHOIWIQYx2ok++9nF3NsU1yU3ThzUtP2nwClNz/x7EYiwYp5FbuniLMe9y 5BTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=GpLRXZyh; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si3688332ejr.4.2020.10.01.06.31.05; Thu, 01 Oct 2020 06:31:29 -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=@nvidia.com header.s=n1 header.b=GpLRXZyh; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732341AbgJAN3o (ORCPT + 99 others); Thu, 1 Oct 2020 09:29:44 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:9518 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731993AbgJAN3o (ORCPT ); Thu, 1 Oct 2020 09:29:44 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 06:28:00 -0700 Received: from mtl-vdi-166.wap.labs.mlnx (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 13:29:30 +0000 Date: Thu, 1 Oct 2020 16:29:27 +0300 From: Eli Cohen To: Jason Wang CC: , , , , , , , , , , , , , , , Subject: Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group Message-ID: <20201001132927.GC32363@mtl-vdi-166.wap.labs.mlnx> References: <20200924032125.18619-1-jasowang@redhat.com> <20200924032125.18619-11-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200924032125.18619-11-jasowang@redhat.com> User-Agent: Mutt/1.9.5 (bf161cf53efb) (2018-04-13) X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601558880; bh=6rUIYxTqLpEGk7XTShhqnq3D5EFt6vSHTg69vpLWGeQ=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent: X-Originating-IP:X-ClientProxiedBy; b=GpLRXZyhptnP7rVs6yQIvxud1J5ga64TktlPBlbPCV7p5QPTxdlQXEvfCafEvlWad qKC7u7mWIk7+eStjB5Qtpgl6iJw6Ow4YEQacgYTlKj5rI+2uQ9cSQaASN2TR47dpoH NEYWJtXg41UvbPhmVg0Px+EDuq/y9nd5t7PzIf/KEZLCMmujay0TS1g6Mpf++ttnWZ gyT0b8ZZwxFKXkluCAar0+bqcJxS8ZD9jpf+gQlcrig+DZcySjRDZ4U6xg1RLTwJLg fdTXTh5iSg4JRRyG0M1diaxcN3UoPfdotMNi1aGDEZ1oA+69y5iR+kySog9WcZso68 UV5kdLPfA6FtQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 11:21:11AM +0800, Jason Wang wrote: > This patch introduces a new bus operation to allow the vDPA bus driver > to associate an ASID to a virtqueue group. > So in case of virtio_net, I would expect that all the data virtqueues will be associated with the same address space identifier. Moreover, this assignment should be provided before the set_map call that provides the iotlb for the address space, correct? > Signed-off-by: Jason Wang > --- > include/linux/vdpa.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h > index 1e1163daa352..e2394995a3cd 100644 > --- a/include/linux/vdpa.h > +++ b/include/linux/vdpa.h > @@ -160,6 +160,12 @@ struct vdpa_device { > * @get_generation: Get device config generation (optional) > * @vdev: vdpa device > * Returns u32: device generation > + * @set_group_asid: Set address space identifier for a > + * virtqueue group > + * @vdev: vdpa device > + * @group: virtqueue group > + * @asid: address space id for this group > + * Returns integer: success (0) or error (< 0) > * @set_map: Set device memory mapping (optional) > * Needed for device that using device > * specific DMA translation (on-chip IOMMU) > @@ -237,6 +243,10 @@ struct vdpa_config_ops { > u64 iova, u64 size, u64 pa, u32 perm); > int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid, > u64 iova, u64 size); > + int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group, > + unsigned int asid); > + > + Extra space > > /* Free device resources */ > void (*free)(struct vdpa_device *vdev); > -- > 2.20.1 >