Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1843568rdh; Tue, 26 Sep 2023 05:27:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXytTWSYmOV6SERTtxZ6Vut+SZF1njEX/FaRYtE8bj/eOm/iFgys/U/K+SmUHQZkACrygJ X-Received: by 2002:a54:448d:0:b0:3a7:30cb:c092 with SMTP id v13-20020a54448d000000b003a730cbc092mr11010242oiv.48.1695731243025; Tue, 26 Sep 2023 05:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695731242; cv=none; d=google.com; s=arc-20160816; b=fdLc/sQOWVz7E7L3IPVRPncbfCjxv8157rWfnHixTSFYSGnKduTIPY9o5apG4g9hJh OoGKyHNcniPoElKZ9/L4k2tjcSgaTVLf8CjajjmbFFSRUqWGhV/MgzlzWa8pcnJfVCk7 kY/LPCW5FZohFUBfJUnwr1wnN3wNLPQzbtcmwsUqZAxRrRu2CAPm3qwXWU7+SwgfoQzF yVgfWXf7cj73hGhzua0a1BN1cyiu5VFYEjz/EneBVQu40d8VFcpU3oUW/jaMM7MK+lAm MtRbtNDxyt8SYqwZWQXkrrNMidcPTaTbk10zlLeCZG/fdl6ilQObwnW1cln8HsoRatdv hrRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=lKd9lX9BKAg4Mb3Rgphudf1CD/sMa9gnwnekBt6buI8=; fh=dJp8FZn3+jiYGV+e7Ew7vHmAFoOpfPx8FCDDh6gjrPI=; b=GmUbr2jLMR9UEdAVcexwrkysoPsKD0TVF2eXesX0h62UX7BEC1et5F2hEOnI2RJxAY 4GVm0wFk74uVx5wh6WcvM4ZDQfykdzP2ShVsLKZze1BnrPqJvzV3y+8COzbNhqV5ozaP 73qtqCxaROP+1M0Cz+d7e5QH/TgWUvYjoE+KkMcf1YYNO5HUqT5CIund7p0owRuRtIrN n6IAKftNJDipteuzSPBB5PIlMHesEreoIfWZnka0psz6lPLVdxoXiNg4+GJwVbWi57Fi hQOctvymVPPCTAE86d8T+HGBmYqRcovaALZscIOO4fHxg17v1VA0Su5qWEM+kq7n8qov 7CTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="dYb/qY4n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k195-20020a636fcc000000b00569374c7c71si5517409pgc.857.2023.09.26.05.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 05:27:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="dYb/qY4n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AC16480FF287; Mon, 25 Sep 2023 21:46:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233617AbjIZEpw (ORCPT + 99 others); Tue, 26 Sep 2023 00:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjIZEpu (ORCPT ); Tue, 26 Sep 2023 00:45:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BE9D6 for ; Mon, 25 Sep 2023 21:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695703497; 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=lKd9lX9BKAg4Mb3Rgphudf1CD/sMa9gnwnekBt6buI8=; b=dYb/qY4nn6TiAVL/gtNkKWz4IYjLtCJOpB4HKd219x9NpIOoXwqSL0gi1J4TbW1FodMK5F 8jb5MDjJH8vgD+e2q8jVThjPN4ILk5s8zfERsbpeeYdnVQPPZ4YvSLqaN5wRAmwogU4PP8 XReG3ajoGWFeTgebdnodu5KPtmJtwWc= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-ImWaDquEPpq_-NQpMCsP8Q-1; Tue, 26 Sep 2023 00:44:56 -0400 X-MC-Unique: ImWaDquEPpq_-NQpMCsP8Q-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-50433961a36so10105149e87.3 for ; Mon, 25 Sep 2023 21:44:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695703494; x=1696308294; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lKd9lX9BKAg4Mb3Rgphudf1CD/sMa9gnwnekBt6buI8=; b=K7EqBIQFEmfDd6QYEUJhR0MYKgBQ5cfF1wiTXpnNERX5SvNciyqgBdb2Dcv9CLr1k7 ENcWHv2HdZGIzMbYWLlNEf0mIBqIB97nb3WekHfB8vfFY3tSTdGPJILYlWhGEOf+GBRA /HTPkoKCcuSOxzOAzoRXiEZxVMb/V0fcsxijHoji94XjUvtXW//vBUbe2vj5HbOp7PW+ Kdbpi5bTXmNlFc+kh/OyBE1SKD9mR9haaFZYsKp7y559p7xeJ5LLf7nSNoeyVZBQBtt2 m/sy78ryYA389oRUNvGvXvPGSg8pWVsLsGVW0fFWFRkytFSNBPXRbDN6ZIQqKTwqGX35 YJLQ== X-Gm-Message-State: AOJu0Yz+HS8R7fkissuePKsZFc8h4dzOcsLjnByEHyHuDzphuTy/MCRL AINQq/9VOn48EDBBvdtSX4sXFZsQDeerpEpnq7cbWRcRqVggFTlq10S+w7om1o2yWVpl0U6w5/D zFOXNuKPMZ2t6fqe1N8btm2zWqpaV94BwvfNk3FQn2DoCJutRVgaXfw== X-Received: by 2002:ac2:5298:0:b0:500:9a45:63b with SMTP id q24-20020ac25298000000b005009a45063bmr6461820lfm.13.1695703494185; Mon, 25 Sep 2023 21:44:54 -0700 (PDT) X-Received: by 2002:ac2:5298:0:b0:500:9a45:63b with SMTP id q24-20020ac25298000000b005009a45063bmr6461810lfm.13.1695703493888; Mon, 25 Sep 2023 21:44:53 -0700 (PDT) MIME-Version: 1.0 References: <20230912130132.561193-1-dtatulea@nvidia.com> <20230912130132.561193-10-dtatulea@nvidia.com> In-Reply-To: <20230912130132.561193-10-dtatulea@nvidia.com> From: Jason Wang Date: Tue, 26 Sep 2023 12:44:43 +0800 Message-ID: Subject: Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct To: Dragos Tatulea Cc: =?UTF-8?Q?Eugenio_P=C3=A9rez?= , Si-Wei Liu , "Michael S . Tsirkin" , Saeed Mahameed , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Parav Pandit , Xuan Zhuo , kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 21:46:09 -0700 (PDT) On Tue, Sep 12, 2023 at 9:02=E2=80=AFPM Dragos Tatulea wrote: > > This patch adapts the mr creation/deletion code to be able to work with > any given mr struct pointer. All the APIs are adapted to take an extra > parameter for the mr. > > mlx5_vdpa_create/delete_mr doesn't need a ASID parameter anymore. The > check is done in the caller instead (mlx5_set_map). > > This change is needed for a followup patch which will introduce an > additional mr for the vq descriptor data. > > Signed-off-by: Dragos Tatulea > --- Thinking of this decoupling I think I have a question. We advertise 2 address spaces and 2 groups. So we actually don't know for example which address spaces will be used by dvq. And actually we allow the user space to do something like set_group_asid(dvq_group, 0) set_map(0) set_group_asid(dvq_group, 1) set_map(1) I wonder if the decoupling like this patch can work and why. It looks to me the most easy way is to let each AS be backed by an MR. Then we don't even need to care about the dvq, cvq. Thanks