Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1651358rdh; Mon, 25 Sep 2023 22:01:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCC33mhO3zpjkoMCvfqv5MpCQbW8xFW+dAZOjjBmWBKS8sAGeW7OFKaIo5RxRahJXdZMkG X-Received: by 2002:a05:6870:5b81:b0:1bb:90c3:bb09 with SMTP id em1-20020a0568705b8100b001bb90c3bb09mr10172102oab.9.1695704514290; Mon, 25 Sep 2023 22:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695704514; cv=none; d=google.com; s=arc-20160816; b=NMjjP+yBV+opiZN1qcb7cgFthxit4vEvjD9UtMP8udogD0cbvoaDbktqrBogpcyPzr mkcCqG0DMUGYo8bpvClGnx1nb5/SfO7/RPXDzI8CaNS8NFEF+STNu6E3NLhlsx9WDPsT WAr8c9v1Mrn1VKnGeLE46O8RJvw1YW7eBcNKvW3wU8LdP24JODsVAoMFeFQZdLhPQLYb upZffKYhCubzCk/7rt2I5+LD4GZS7i4NgekCapEmffK8Cv++ARiu0z2bH2Yf6m3TO1Kg EwpdBoyd4GTBm93Khi22euyKqCmWP8ugw7GuI07Rt94y9Eb9+f0KALljNYWBPV0rbrgu g0wg== 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=RLZ2Sm0jXt4JgiR3KwyVKPulSJY09nranm6CqIMSjuQ=; fh=dJp8FZn3+jiYGV+e7Ew7vHmAFoOpfPx8FCDDh6gjrPI=; b=t+3K05c6kSM8UG5xQ1/L3aXLFIsWSJNARHgxM/j/P1fjkpAk2Uru+nncTQ/MyBdKDg 7GabQfsN3IPhrZmvzGPjKZ6mVcYG6WPvNFESw72yz2P3aoN45U06tS5XfX7FceXTDg0l 8unLq6lHFuUVNQQKR6fenetRFaXbED8c7Ky7du7Ib4g0vku2QmTFTHXvYOIhbMEttux6 21gi2E8Vm7qFrQu995GGT5hMm6qUTSHDrKyEtPXQNsTeoa+Jx95+5Bcwq5C7ETiX5hf0 Je2AFzPR9+X98dPblKdDOSRr4QUxzI9gVRYFA6MnWMD0nnzVb4J8r8UHb1P268Dqr7bD n7Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QMFIavHG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x5-20020a654145000000b00578639ad1d3si9846623pgp.319.2023.09.25.22.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 22:01:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QMFIavHG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 3EDCE8067B77; Mon, 25 Sep 2023 20:35:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233434AbjIZDf1 (ORCPT + 99 others); Mon, 25 Sep 2023 23:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232376AbjIZDfY (ORCPT ); Mon, 25 Sep 2023 23:35:24 -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 C7684E5 for ; Mon, 25 Sep 2023 20:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695699273; 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=RLZ2Sm0jXt4JgiR3KwyVKPulSJY09nranm6CqIMSjuQ=; b=QMFIavHGIlU3dx2UPOtjmOwwS4qxb4ytlEuR9hC9EyzCJDNUaG4lWEGtckZlQhIkjtvE55 TIc69d+LDiyFxMhw9Wys1o1kmyKdUekVYGNuj4UUEgO859rzi0g50RnU+3OJ0PwPWVCuAx 7vwwDw4U5z1iSHMrSX7wJxU5gwa7DD4= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-5WQaugYOOGS5fSkp81tKZA-1; Mon, 25 Sep 2023 23:34:31 -0400 X-MC-Unique: 5WQaugYOOGS5fSkp81tKZA-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2c15572d8c5so63926471fa.0 for ; Mon, 25 Sep 2023 20:34:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695699269; x=1696304069; 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=RLZ2Sm0jXt4JgiR3KwyVKPulSJY09nranm6CqIMSjuQ=; b=vNSNiV00KufC/Luu5nhWAMlov/kxAVcmAJWkPTgOcrAKKdsWSmYepyF6uo6M3uQiaa JAc+9vKNpP0NwbKoh9vqtirHmJGWa7+ik2h5OOjrxVhsho0UV5oS0ZqrmW0K76cgCQic /yYEWZysIw6G0wWqYxEyU+d01bmjWacAqy2OrpmU+lmjfcuGBdWVawUiEXtdoNGbmSCB 4+KR8jMzYRKWwSs55KiWqznMHi1i5CUG1HK5qK3Oz9abF2zUwmKdZruNc6fMTNxm71im moQaLw9oww0IMv228+PEyNzVaN8j5lfKL719BlntfkCNxXCpreo9GfsdW0PTPrX+Su97 pJBg== X-Gm-Message-State: AOJu0YzkmHyj6S0CVshbzcT6a/4jaRQpolihzhkgWlIHfaJSGv942mDm wJU0bZ5S90nh5miW2610C76/7FX3gNcutpn6Eo9RmrTQtBUM1g7MBrheqg3eqx6mVR8x62tt09t S8f1jWQGt32s4Qll1IFOdajjlNUZIaKEkz1+Um5tZ X-Received: by 2002:a19:2d56:0:b0:500:9ab8:b790 with SMTP id t22-20020a192d56000000b005009ab8b790mr5797364lft.60.1695699269582; Mon, 25 Sep 2023 20:34:29 -0700 (PDT) X-Received: by 2002:a19:2d56:0:b0:500:9ab8:b790 with SMTP id t22-20020a192d56000000b005009ab8b790mr5797349lft.60.1695699269194; Mon, 25 Sep 2023 20:34:29 -0700 (PDT) MIME-Version: 1.0 References: <20230912130132.561193-1-dtatulea@nvidia.com> <20230912130132.561193-9-dtatulea@nvidia.com> In-Reply-To: <20230912130132.561193-9-dtatulea@nvidia.com> From: Jason Wang Date: Tue, 26 Sep 2023 11:34:18 +0800 Message-ID: Subject: Re: [PATCH 08/16] vdpa/mlx5: Rename mr destroy functions 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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 20:35:35 -0700 (PDT) On Tue, Sep 12, 2023 at 9:02=E2=80=AFPM Dragos Tatulea wrote: > > Make mlx5_destroy_mr symmetric to mlx5_create_mr. > > Signed-off-by: Dragos Tatulea Acked-by: Jason Wang Thanks > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 ++-- > drivers/vdpa/mlx5/core/mr.c | 6 +++--- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++++++------ > 3 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/vdpa/mlx5/core/mlx5_vdpa.h b/drivers/vdpa/mlx5/core/= mlx5_vdpa.h > index 554899a80241..e1e6e7aba50e 100644 > --- a/drivers/vdpa/mlx5/core/mlx5_vdpa.h > +++ b/drivers/vdpa/mlx5/core/mlx5_vdpa.h > @@ -118,8 +118,8 @@ int mlx5_vdpa_handle_set_map(struct mlx5_vdpa_dev *mv= dev, struct vhost_iotlb *io > bool *change_map, unsigned int asid); > int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb = *iotlb, > unsigned int asid); > -void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev); > -void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *mvdev, unsigned int= asid); > +void mlx5_vdpa_destroy_mr_resources(struct mlx5_vdpa_dev *mvdev); > +void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev, unsigned int asid= ); > int mlx5_vdpa_update_cvq_iotlb(struct mlx5_vdpa_dev *mvdev, > struct vhost_iotlb *iotlb, > unsigned int asid); > diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c > index fde00497f4ad..00dcce190a1f 100644 > --- a/drivers/vdpa/mlx5/core/mr.c > +++ b/drivers/vdpa/mlx5/core/mr.c > @@ -507,7 +507,7 @@ static void _mlx5_vdpa_destroy_mr(struct mlx5_vdpa_de= v *mvdev, unsigned int asid > mr->initialized =3D false; > } > > -void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *mvdev, unsigned int= asid) > +void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev, unsigned int asid= ) > { > struct mlx5_vdpa_mr *mr =3D &mvdev->mr; > > @@ -518,9 +518,9 @@ void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *= mvdev, unsigned int asid) > mutex_unlock(&mr->mkey_mtx); > } > > -void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev) > +void mlx5_vdpa_destroy_mr_resources(struct mlx5_vdpa_dev *mvdev) > { > - mlx5_vdpa_destroy_mr_asid(mvdev, mvdev->group2asid[MLX5_VDPA_DATA= VQ_GROUP]); > + mlx5_vdpa_destroy_mr(mvdev, mvdev->group2asid[MLX5_VDPA_DATAVQ_GR= OUP]); > prune_iotlb(mvdev); > } > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/ml= x5_vnet.c > index 061d8f7a661a..4d759ab96319 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -2644,7 +2644,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_de= v *mvdev, > goto err_mr; > > teardown_driver(ndev); > - mlx5_vdpa_destroy_mr_asid(mvdev, asid); > + mlx5_vdpa_destroy_mr(mvdev, asid); > err =3D mlx5_vdpa_create_mr(mvdev, iotlb, asid); > if (err) > goto err_mr; > @@ -2660,7 +2660,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_de= v *mvdev, > return 0; > > err_setup: > - mlx5_vdpa_destroy_mr_asid(mvdev, asid); > + mlx5_vdpa_destroy_mr(mvdev, asid); > err_mr: > return err; > } > @@ -2797,7 +2797,7 @@ static void mlx5_vdpa_set_status(struct vdpa_device= *vdev, u8 status) > err_driver: > unregister_link_notifier(ndev); > err_setup: > - mlx5_vdpa_destroy_mr(&ndev->mvdev); > + mlx5_vdpa_destroy_mr_resources(&ndev->mvdev); > ndev->mvdev.status |=3D VIRTIO_CONFIG_S_FAILED; > err_clear: > up_write(&ndev->reslock); > @@ -2824,7 +2824,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev= ) > unregister_link_notifier(ndev); > teardown_driver(ndev); > clear_vqs_ready(ndev); > - mlx5_vdpa_destroy_mr(&ndev->mvdev); > + mlx5_vdpa_destroy_mr_resources(&ndev->mvdev); > ndev->mvdev.status =3D 0; > ndev->mvdev.suspended =3D false; > ndev->cur_num_vqs =3D 0; > @@ -2944,7 +2944,7 @@ static void mlx5_vdpa_free(struct vdpa_device *vdev= ) > ndev =3D to_mlx5_vdpa_ndev(mvdev); > > free_resources(ndev); > - mlx5_vdpa_destroy_mr(mvdev); > + mlx5_vdpa_destroy_mr_resources(mvdev); > if (!is_zero_ether_addr(ndev->config.mac)) { > pfmdev =3D pci_get_drvdata(pci_physfn(mvdev->mdev->pdev))= ; > mlx5_mpfs_del_mac(pfmdev, ndev->config.mac); > @@ -3474,7 +3474,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *= v_mdev, const char *name, > err_res2: > free_resources(ndev); > err_mr: > - mlx5_vdpa_destroy_mr(mvdev); > + mlx5_vdpa_destroy_mr_resources(mvdev); > err_res: > mlx5_vdpa_free_resources(&ndev->mvdev); > err_mpfs: > -- > 2.41.0 >