Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2921896pxj; Sun, 6 Jun 2021 19:33:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNqVW/fQ5lPVysHrgQBuVMmexRh6D8S8MZc8wb90ncHinxOM8uGPlNu0b5IqZptj0rmmSE X-Received: by 2002:a17:906:a398:: with SMTP id k24mr15526017ejz.203.1623033207583; Sun, 06 Jun 2021 19:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623033207; cv=none; d=google.com; s=arc-20160816; b=Y9HHiUAdqZeNkt+T+KBkTtgJv+6KuILOcS2xiHGqmUo0Sbbya+noLFYC+cPI+AOjhx PyPjQPFPchUIiNGau9iu+46mP1AxEt4fvmTA6ugdQsOqeE0OUbylHB6qBqCt3sGXt+YX Yuk03E+EiJTurJNMttENR7TV124SiIy6lF7cnqydJ7nFDCqv87tdUaimDlD+FgUS8WSJ 5jFURCg70ZhCqKrk52MV2HpC6tcLsZbKEKNFzpLbH8bCZtezspGrvlioWh7cBtdtyj4X ExD5cZ5nXtayD0L5YY4/9TZqJg9I3Yc0mkk6cqDGaM1r0/ABFJQbJBEjrAsK25xoqyD2 QdAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=5ftWrDjAuGgns7tUZfM+YwyaEY5gWcXUeAuYMi5CEq8=; b=ynGViGEZMS/7BWJveYT+kEbXeLYaPrXrDpFRNkoWaQP/aU9MoVTEg+MJKLB5pxEiXo jhMgvfDv99DzKM8yRwwQJcpGWiHZsqS92VwSpurCXJFlDy+97uisi8dBpn6hd8PSuCmy /DQFua0OveCR1mOFYnYG/IH2Ei7b2JcgIY9Nk7y3XPCZTBsH4+vEOSiRMGbZov01Ktl1 GBtklLufrO/CAA/p+XfP16Fc6WW5zOZqJSXY9drkuCC4AEFnWljFo1bCNulB6cviwDnA D1XzCI3oaO7Zg2H5eSbSn9Up0RkzxawI/H658Q5fl0J+7CSpuo9HZK1JZdkP50yNJm9X JM+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T8RxK0R0; 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 b16si11353340ede.389.2021.06.06.19.33.05; Sun, 06 Jun 2021 19:33:27 -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=T8RxK0R0; 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 S230156AbhFGCcj (ORCPT + 99 others); Sun, 6 Jun 2021 22:32:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35780 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhFGCcj (ORCPT ); Sun, 6 Jun 2021 22:32:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623033048; 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=5ftWrDjAuGgns7tUZfM+YwyaEY5gWcXUeAuYMi5CEq8=; b=T8RxK0R0BA8Dbi/iLiBiOkZICfbo4Pl3oM8C17mGftu7sBOy4l1l9XCw7/IgYiyxrQ/+us OUURzgjucmETsL5Veo4XDh2TbCyXPopPn4iUhenD6+757yT1xOquhRcWowOsweAqbYCoCn AlCdzLuIbs3u1oBMUqJHh6XpGIZtLdI= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-wvDwjlmYNZGH-gprI30obw-1; Sun, 06 Jun 2021 22:30:48 -0400 X-MC-Unique: wvDwjlmYNZGH-gprI30obw-1 Received: by mail-pf1-f200.google.com with SMTP id g19-20020a62e3130000b02902effdaa4a3eso407630pfh.4 for ; Sun, 06 Jun 2021 19:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=5ftWrDjAuGgns7tUZfM+YwyaEY5gWcXUeAuYMi5CEq8=; b=tRCjRpIOU3oiLHjUmoK7on56ySzIUrsI6ytkwEv/5VEW6R1eCbOhX+NuRvEViqB7fu kibih6X2NJltDUK9cl45x+E29ul5gFC49IkAV3YHxk/4feKarOIMyx0frliZLWM4JroM nDLKZECJ8P5DtXzDMG1M+x+itsSd81xg+VkSAYCVPD1AiLl9kaNwfqwYMll7R5V6EIZb IJ/7l9rckrHly8x+KLQ8eEOzZz2F555zzGUXXpHF2cxzY5OCaBBCn7oCco2zAJkw38mO rcqF+LkIcdlj9mDRFbtOqAw7ucOzoh7mD0HnXStE+J5qEiiZijrTEtkYUioz0PUo/Qjp HsJQ== X-Gm-Message-State: AOAM531T55SM80bfd5XDtLE7sCECkGzWSVV8iIo2iZw/2lLh6B422Fsc /jMS8nBz2YiSqO4tP1njT98ovJ6vXxd0ootG6RV6ybW1QATexDzADUZVUMCn9O80Ij/DBselUAC Ja6Rodx8/S25ibztfHBjUNM/Xlkz8Kzeklo+SCSC1HqXqvqBzfCGxpDI9v+8WIIJ3zdm6y6mmaO +q X-Received: by 2002:a05:6a00:170c:b029:2dc:dd8f:e083 with SMTP id h12-20020a056a00170cb02902dcdd8fe083mr15154724pfc.77.1623033046703; Sun, 06 Jun 2021 19:30:46 -0700 (PDT) X-Received: by 2002:a05:6a00:170c:b029:2dc:dd8f:e083 with SMTP id h12-20020a056a00170cb02902dcdd8fe083mr15154699pfc.77.1623033046395; Sun, 06 Jun 2021 19:30:46 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id o16sm6639326pfu.75.2021.06.06.19.30.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Jun 2021 19:30:45 -0700 (PDT) Subject: Re: [PATCH] vdp/mlx5: Fix setting the correct dma_device To: Leon Romanovsky Cc: Eli Cohen , mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20210603112215.69259-1-elic@nvidia.com> <864e8d21-22d4-7735-817b-f88ec0126f87@redhat.com> From: Jason Wang Message-ID: Date: Mon, 7 Jun 2021 10:30:42 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/6/4 下午11:57, Leon Romanovsky 写道: > 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") If I read the commit log and code correctly: " With SF introduction this is no longer true. " It works before SF is introduced. Thanks > > 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