Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp10887pxk; Wed, 23 Sep 2020 20:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7KrYfkN9o6B1duX/8OFIPRXxzN7bcH1rVVrt4ZSNlB0iASEGftBYlzlP2UoOeFaicbqx9 X-Received: by 2002:a17:906:c7d9:: with SMTP id dc25mr2550245ejb.452.1600918070198; Wed, 23 Sep 2020 20:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600918070; cv=none; d=google.com; s=arc-20160816; b=ZQghm5iizTXOitUxEy0uWnysgrMBu4qVEM1P6kI/3pB602k8CdNTYYLiiMXI174fvk EPJTVPFCrbNpIi/Cdc+/tWfALLKC8mzZCMRFIZVY2VTPzqjGuJRnoGnt19jrmpmXye4X 4r2sLlbP0zg1n9D/MlwKJfytMtc1bBE0kU4/OGmLfYUCfWOCpGebYdKredNI//XH3L9U 5D+VLagBIm52bKJypIgQBFwHyei25Q2LtpcFXY25Ecbnws2b9pQ1YUi/PoS1Oem3k/1w sMUbtrhPsQ0s0+fBq2ISI0pyg9pMSLuFZczeRefTlADtyzOoh0L/6MsF/PUYfC1UON2n fSeA== 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:date:subject:cc:to:from :dkim-signature; bh=9g8dUxowjtsIBqRQgFTrTNkGNYlQerILKb8HbmSTNbI=; b=ShG7P3eOZdpr46ZEwVKWNaEcqwNme18TKGcP9uoR687DlXxQmeionaeatZquQLlBFB RyqeLEdk/lszr60AtuLOXkuF6ozLUa8MeG9oVBmkGiC/vjw5ETTaDfIgm2n+HN1vXt+N lJaQS+i2PIgrljkrTPFOHMIXfRs3eYPIjasWf5b3CKi/90E6X+8tizRHJT6UJAyJhVgd ky3SAryawHIL13h6DZi9UgIXtttFitRQlmGOR5ksqw5aC3MIaRf6AqC7x5lioJHV2OZn tRxp0KxObmAb8xGu9nwZXof8URWrjlNSrXsT/zvQUgZncp/MoZkjSMjCWfaZJOdLVFYy m9WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ILKFs1F5; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy18si1413039edb.148.2020.09.23.20.27.26; Wed, 23 Sep 2020 20:27:50 -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=@redhat.com header.s=mimecast20190719 header.b=ILKFs1F5; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbgIXDXs (ORCPT + 99 others); Wed, 23 Sep 2020 23:23:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25548 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbgIXDXs (ORCPT ); Wed, 23 Sep 2020 23:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600917826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9g8dUxowjtsIBqRQgFTrTNkGNYlQerILKb8HbmSTNbI=; b=ILKFs1F5RdF2fMkEtWi4vvcwaVxxI6wO5PA7QtkwEgQKmff1SlTlvLCTlY8b6WCKOmZQPF i3iKDK9U4g/3xc3+606S+6D1cZV3Ls78RRGSmJ8xaynCY/QOzF/Rjs0StJCog5ddy9lOjG N2CEMzPk1hj+DjBoJQwqvboAmy2JqWI= 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-371-24y2e25GO8ijICAsU0WX4g-1; Wed, 23 Sep 2020 23:23:41 -0400 X-MC-Unique: 24y2e25GO8ijICAsU0WX4g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F8A2186DD5A; Thu, 24 Sep 2020 03:23:40 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-193.pek2.redhat.com [10.72.13.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEB7F5577D; Thu, 24 Sep 2020 03:23:21 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: lulu@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rob.miller@broadcom.com, lingshan.zhu@intel.com, eperezma@redhat.com, hanand@xilinx.com, mhabets@solarflare.com, eli@mellanox.com, amorenoz@redhat.com, maxime.coquelin@redhat.com, stefanha@redhat.com, sgarzare@redhat.com Subject: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group Date: Thu, 24 Sep 2020 11:21:11 +0800 Message-Id: <20200924032125.18619-11-jasowang@redhat.com> In-Reply-To: <20200924032125.18619-1-jasowang@redhat.com> References: <20200924032125.18619-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduces a new bus operation to allow the vDPA bus driver to associate an ASID to a virtqueue group. 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); + + /* Free device resources */ void (*free)(struct vdpa_device *vdev); -- 2.20.1