Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1248690rdb; Sat, 7 Oct 2023 21:26:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE71GHAXphxgIaAmf7V+6856XXJSlfWmJ3aShLOyoqc6xY6L0+Py8wHJXQXF4u1J0oD2+xN X-Received: by 2002:a05:6e02:11a7:b0:34f:70ec:d4cf with SMTP id 7-20020a056e0211a700b0034f70ecd4cfmr10539122ilj.8.1696739182704; Sat, 07 Oct 2023 21:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696739182; cv=none; d=google.com; s=arc-20160816; b=RPwgotRGXkSsHjT4nbWHAmvBaU5n08Eex9Y/TdgBx5CoAg2JR1Zfr2nipc9lGfv3hC hm+uJX1XljDXfn9wW1lEPBd12a5nbeI9KWxxaY2nqWZfEn5bilmwhSMGVbGwu+YzRyiQ 5qhkXH5JqUaFn1RvqYNaoDXX3/4OL6aOMtxsEwkXJbg9hlSRL6kjlIhmxyunT+NvrAEh FjdyKlKL5uxLQKqk/s8GXDvYec5axzNzuJbcXCA657SXJF1+cINu7qg3ZGD14Jw7ATc2 AqA61O+wG5qzGyEtgADNpVH5pDULBgYrTaVcIGvp+GgI9cvd7zTKN8r8SUcvgGrcTB0W zW4w== 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=YgXIUrST4qjfww2McuDOJwKPPpWN2yjtSeM4PuxFqTo=; fh=w83sDthegnKDZYiPdbbNiE0hzYA8r+PX+SCDP0A7EUI=; b=VdMTN2cD2aXbXbYbyKSzymkufR1DJdWJE8PX/TkVR+1qDOiywZGTn9/eH5m8S+RfVa buBgI0lTvR3Zs5d9SXmYO7vcUfa0owqqrXAh5pzCH4fiiFPtyXJddyuKayqq+ouF9cHT Gavml5m7hG/haspMZRWnZjLK+9HcnlvnttBM7Gu9gqv/ASZBx2bqT6nJzPmlPrkL6Qef 1QYetefKrVcD2WirlKXvV+v/zrNNZbFQywv63IBmz/K088ZeXK56wqKmV3+FNoLtdmWL uxvAWIw3SyNkGmxbDc87q2K6Tf2r+arojsmrkNDMrDUbxWXxF3/jLO6tR2t7PZSaw+Mk sjbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QtbY/H+6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x11-20020a170902a38b00b001c71eb782b0si6866190pla.94.2023.10.07.21.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 21:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QtbY/H+6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 4F92B80C2479; Sat, 7 Oct 2023 21:26:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344340AbjJHE0Q (ORCPT + 99 others); Sun, 8 Oct 2023 00:26:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344270AbjJHE0P (ORCPT ); Sun, 8 Oct 2023 00:26:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55FECBF for ; Sat, 7 Oct 2023 21:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696739127; 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=YgXIUrST4qjfww2McuDOJwKPPpWN2yjtSeM4PuxFqTo=; b=QtbY/H+6ajcAJFXUGNJzsL1Q9AhVXRS7uu6rNuhQembwJl/KMblp7gnPipJmr5JJarxTSV y51Yi7JED90QAheT7TdvaQe6vWoeTQLBVOT+rQCkjMwX/QSV1NWl9ekj4Uy0TwshuCJbzn EChDVRCx8jNyJ1XLrFAGsT1ZYie3s1A= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-bEXNor6lOzaHlhr0jtUtwA-1; Sun, 08 Oct 2023 00:25:25 -0400 X-MC-Unique: bEXNor6lOzaHlhr0jtUtwA-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5068bf0b443so1348531e87.0 for ; Sat, 07 Oct 2023 21:25:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696739124; x=1697343924; 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=YgXIUrST4qjfww2McuDOJwKPPpWN2yjtSeM4PuxFqTo=; b=fu1KDn8x4eMTTPClM3aiv+T+SvaPLleuiAC1Vspp5yV0ubGRKX9SVRa6ZJB2OT/4E9 qqmks2vmZeIsgxckRpanOiaexpmUDVJyQihxGqy/3tfaGXv3hMzYC4acpHZH+l8dtq0g iZwWFX2LaUlCcLPP7Ud7QWM2zE55y1S1D0co7Lm9jSkHpjVQboQaLLZtGtq1kiWo507e vW3/lTsuoOx9We0Mt6ekcF/qr7/w5+B4wv/USPZGu06PwhIPTQjaLGIFGGzDKdeHnmFD K6XxmVgFedI80/bFHqNtO8AgvIaPw3NfC7qZBUe2XpLXj68JXLDX3rWCM0T/g4aLJsxE ombg== X-Gm-Message-State: AOJu0YyRGTBdKXVj7zRi4LSnxufEmVkGHVLCKM+uKuNSK36BxnAbWsMW 2iyj3nd8eF1PBiZL/D2IB0JyLap+jnzP8/5oaTvO3GSLiPutpu/x7j+7BOZP68Txoh4yACG0waI JiWcysouMjXdtwsrl7b+ma8BIffnUHWmlgz8OfnBD X-Received: by 2002:a05:6512:3095:b0:503:2a53:7480 with SMTP id z21-20020a056512309500b005032a537480mr12004270lfd.49.1696739124087; Sat, 07 Oct 2023 21:25:24 -0700 (PDT) X-Received: by 2002:a05:6512:3095:b0:503:2a53:7480 with SMTP id z21-20020a056512309500b005032a537480mr12004263lfd.49.1696739123775; Sat, 07 Oct 2023 21:25:23 -0700 (PDT) MIME-Version: 1.0 References: <20230912130132.561193-1-dtatulea@nvidia.com> <20230912130132.561193-10-dtatulea@nvidia.com> In-Reply-To: From: Jason Wang Date: Sun, 8 Oct 2023 12:25:12 +0800 Message-ID: Subject: Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct To: Dragos Tatulea Cc: "xuanzhuo@linux.alibaba.com" , Parav Pandit , "virtualization@lists.linux-foundation.org" , "eperezma@redhat.com" , "linux-kernel@vger.kernel.org" , "si-wei.liu@oracle.com" , "mst@redhat.com" , "kvm@vger.kernel.org" , Saeed Mahameed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sat, 07 Oct 2023 21:26:21 -0700 (PDT) On Tue, Sep 26, 2023 at 3:21=E2=80=AFPM Dragos Tatulea wrote: > > On Tue, 2023-09-26 at 12:44 +0800, Jason Wang wrote: > > 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 wi= th > > > any given mr struct pointer. All the APIs are adapted to take an extr= a > > > 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. > > > This scenario could indeed work. Especially if you look at the 13'th patc= h [0] > where hw support is added. Are you wondering if this should work at all o= r if it > should be blocked? It would be great if it can work with the following patches. But at least for this patch, it seems not: For example, what happens if we switch back to group 0 for dvq? set_group_asid(dvq_group, 0) set_map(0) set_group_asid(dvq_group, 1) set_map(1) // here we destroy the mr created for asid 0 set_group_asid(dvq_group, 0) Btw, if this is a new issue, I haven't checked whether or not it exists before this series (if yes, we can fix on top). > > > 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. > That's what this patch series dowes. Good to know this, I will review the series. Thanks > > Thanks, > Dragos > > [0]https://lore.kernel.org/virtualization/20230912130132.561193-14-dtatul= ea@nvidia.com/T/#u