Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1223050pxj; Fri, 4 Jun 2021 08:59:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtBF3YAk0J3wMYpxN0STYNsgUOox5neC6wQ8au32xYoT8ZvdjVa81IW/Pf8LioVZb1+n9l X-Received: by 2002:a17:906:489:: with SMTP id f9mr4651104eja.508.1622822364504; Fri, 04 Jun 2021 08:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622822364; cv=none; d=google.com; s=arc-20160816; b=i+d6UIOcVEBkVrk8+8CfLLshFZMndPIQILOqYJ4xAwiRfA0NMmke+xCUgQrczx8zkV G8XcX7iUGSLgraytCZpkInruN6DGCzVz6LMi9AVH/IUfZPmeOc2FKW67C9ozsmOwtoR1 VyqFMpGINrqb6h5gTC5jmiJO39Kjpq9U1yFjaPeoSXfun+lemxSNhC4JqLvejVm+vvKT FOitZdFnnA4W5n6vNWl1Xe+M+2AHQBT/jo9WCAUtKSzVpMzWHqubrq3qvpK3+zOuW8nc zNcVFaeyjFi51Kw8dtFwerfG6eedVJCP6DmTFiSXduLFLG3QsCQq81qBRt/kosS7+MLu kW4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nNdX6ix+pf3fF8lYFb2K9ClgOZf7Xp9MwZCeB5XYGvs=; b=EGw4r0yfXVycvcM1Xu3kg4skV4kUixD14R86uY3DdkKl3iZw5kP1sctw9T2E3yGSlb 4l+IFv/XMpfIbBF8TfZIw83A7p7fDON6drfVZYjR0blLKPXisM/Yddh1Hp0Ul90e+AM8 GngtIuKQWuEuEek71FHDICUb8jnZ5JX6ZHdgSPQcLr8qXQWTEkP+tEho1oG5aN+vhkhZ qwXog30BQJzcXnyyYpGYDIbU2CgSY98sK2UrKCHb58KxiJh3q/ZXbo8XzAsFjo8BZT9F 2x7b1CmsOwj1uBVwL35vWPah/12aIogtb4dFqa44YrgpLYTQoQiF7+zIGTQmPBHodC+N YVwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aWCz92Y+; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c27si1628619ejj.341.2021.06.04.08.59.01; Fri, 04 Jun 2021 08:59:24 -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=@kernel.org header.s=k20201202 header.b=aWCz92Y+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbhFDP73 (ORCPT + 99 others); Fri, 4 Jun 2021 11:59:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:49870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbhFDP73 (ORCPT ); Fri, 4 Jun 2021 11:59:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 96C7C613E9; Fri, 4 Jun 2021 15:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622822263; bh=bjEw7NHq2+Hk4VLi51FDyLk7BzMQaucHh9l2IATcS2A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aWCz92Y+JBBa0BBlRcfk84/ngxemMP7HF1zCIdL8rKpEFJ5yF2fdGvW1e9VQhXs2Q zmWWAGeoZWh/wucqxZYQBsyWSJUxhdkBfFvwlIscik82L7x09vxMzw2GRnaPpZTEyJ K2lPrx4uAhWH4VlxpTGLHKsCQ7gfFKXgCf9LwejQfPYCrJGxT2g98YsOoGq8kVxvRy H2VCo00UbpqHfn5cg5+MwJhOwYowveb6YUFQb5UC0iW0NZbXZrGMI6TtYNUM6awvnt p3Io3JZHjuBe7NWYBHNyD34JwCcorrL9KCrKsO8XSVOmFBRPtNl3KRlQ8NQtuDBr9R 2TJo6+6/Dtcxw== Date: Fri, 4 Jun 2021 18:57:39 +0300 From: Leon Romanovsky To: Jason Wang Cc: Eli Cohen , mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vdp/mlx5: Fix setting the correct dma_device Message-ID: References: <20210603112215.69259-1-elic@nvidia.com> <864e8d21-22d4-7735-817b-f88ec0126f87@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <864e8d21-22d4-7735-817b-f88ec0126f87@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 10:35:59AM +0800, Jason Wang wrote: > > 在 2021/6/3 下午7:22, Eli Cohen 写道: > > Before SF support was introduced, the DMA device was equal to > > mdev->device which was in essence equal to pdev->dev; > > With SF introduction this is no longer true. It has already been > > handled for vhost_vdpa since the reference to the dma device can from > > within mlx5_vdpa. With virtio_vdpa this broke. To fix this we set the > > real dma device when initializing the device. > > > > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") > > > Note sure this is correct, according to the commit log it should be the > patch that introduces the SF or aux bus support for vDPA. Where did you see that? git log -p drivers/vdpa/mlx5/net/mlx5_vnet.c ... + mvdev->vdev.dma_dev = mdev->device; + err = mlx5_vdpa_alloc_resources(&ndev->mvdev); ... comes from commit 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Thanks > > > > Signed-off-by: Eli Cohen > > > Patch looks correct. > > Thanks > > > > --- > > drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > > index bc33f2c523d3..a4ff158181e0 100644 > > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > > @@ -2046,7 +2046,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name) > > if (err) > > goto err_mtu; > > - mvdev->vdev.dma_dev = mdev->device; > > + mvdev->vdev.dma_dev = &mdev->pdev->dev; > > err = mlx5_vdpa_alloc_resources(&ndev->mvdev); > > if (err) > > goto err_mtu; > > _______________________________________________ > Virtualization mailing list > Virtualization@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/virtualization