Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp553800pxb; Thu, 15 Apr 2021 00:33:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmBoUSu/VxsTj2PvdiUaFj6saX6OSvm74MmID1S51NdY1aGjNjSnUvavRGimj8QaDbpwQ8 X-Received: by 2002:a17:907:7631:: with SMTP id jy17mr2017521ejc.418.1618472030357; Thu, 15 Apr 2021 00:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618472030; cv=none; d=google.com; s=arc-20160816; b=ydQXJFeRfnq9//VKVy2FYsVlGy0q/17Vv7t9C00DWA6JN7i7LAzGOCDn304UQtQjoE BnmJaCc8fc2fNouxZ+FtOzLO4bcvlqBLUxXBDocdIQ4x7whlxJ/CFwpM7EfFhJKEnCbG MumlY8Jxaje/zrFYeHHOIPguFNrhxtdyKEWidtu+aLq8EghQFwFomxQoVhl5Rg2jQzti eKOlNZP8DuiEdX0oQq8E7DWG+wekHSLoWMLwow8IPoedxe+4fq2DB00rVkiLNlgWwHjs MAsAklefJFFGMe2mmF9QW1xhZ/y74/icd4Fn5YoBVNBHChQpJAn5zy6/r2w9d+joslvf M0lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=x3GwZ1zgb9EqVeYW21l457HIOUZj2XqF5DommpMrgvs=; b=eFDHHN7Q6Unt7YQfOgEXxmR90ZR6L4OeQL3gfuPAowr8WLHXC/ePPB/TuRLaGiUG8N NcGgP8z6ww87kv0O5nQdSWFiQCcj8t+dSggxE9oo4LLC6MGBFvy9WYb0gqKihCYopZUu jSWhkwgVNtVZeu1FsEf9LGzOxGbnT/Hbv/CoMFJlT1xgQKeXZBCzijvBmlnZYxP2ORRz LNO7ao3OcbnU9Vyl73UayNYSyuzuM9QflliA18Hvq5SGvJorGItKx+RjDSv6N006VRM/ yRuv67ViLrUkBHjHWYFWn5oUuajBlZwieXNsvoT3cmBArLSLfInynWFheW7oeVTLBqpW r4Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sf0ljs6s; 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 b1si1408475ejh.35.2021.04.15.00.33.27; Thu, 15 Apr 2021 00:33:50 -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=Sf0ljs6s; 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 S231441AbhDOHck (ORCPT + 99 others); Thu, 15 Apr 2021 03:32:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53759 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbhDOHch (ORCPT ); Thu, 15 Apr 2021 03:32:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618471934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=x3GwZ1zgb9EqVeYW21l457HIOUZj2XqF5DommpMrgvs=; b=Sf0ljs6sqq41ILQc9SAUT3j5CW/jrX1TB2qhwRhLNxbW1xwccw3FNa0kjNygPbs4NuhdyN crpA258DolyOJGNjSBIYL6QhrbtbEm12NMA8uT/gAMeyRoKFIwjrmaBHsmnel+1UcmSQmp 4VwdaMYcfSR3fnFBqvK2RyuD3mQcLrg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-_UaDBgr6Nd6y2k-LGK_jwg-1; Thu, 15 Apr 2021 03:32:10 -0400 X-MC-Unique: _UaDBgr6Nd6y2k-LGK_jwg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5010107ACCA; Thu, 15 Apr 2021 07:32:09 +0000 (UTC) Received: from hp-dl380pg8-01.lab.eng.pek2.redhat.com (hp-dl380pg8-01.lab.eng.pek2.redhat.com [10.73.8.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC3E769FD0; Thu, 15 Apr 2021 07:32:01 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, elic@nvidia.com Subject: [PATCH 3/7] vp_vdpa: switch to use vp_modern_map_vq_notify() Date: Thu, 15 Apr 2021 03:31:43 -0400 Message-Id: <20210415073147.19331-4-jasowang@redhat.com> In-Reply-To: <20210415073147.19331-1-jasowang@redhat.com> References: <20210415073147.19331-1-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch switches to use vp_vdpa to use vp_modern_map_notify(). Signed-off-by: Jason Wang --- drivers/vdpa/virtio_pci/vp_vdpa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c index 1321a2fcd088..2afc90645660 100644 --- a/drivers/vdpa/virtio_pci/vp_vdpa.c +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c @@ -369,7 +369,6 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct virtio_pci_modern_device *mdev; struct device *dev = &pdev->dev; struct vp_vdpa *vp_vdpa; - u16 notify_off; int ret, i; ret = pcim_enable_device(pdev); @@ -415,10 +414,12 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) } for (i = 0; i < vp_vdpa->queues; i++) { - notify_off = vp_modern_get_queue_notify_off(mdev, i); vp_vdpa->vring[i].irq = VIRTIO_MSI_NO_VECTOR; - vp_vdpa->vring[i].notify = mdev->notify_base + - notify_off * mdev->notify_offset_multiplier; + vp_vdpa->vring[i].notify = vp_modern_map_vq_notify(mdev, i); + if (!vp_vdpa->vring[i].notify) { + dev_warn(&pdev->dev, "Fail to map vq notify %d\n", i); + goto err; + } } vp_vdpa->config_irq = VIRTIO_MSI_NO_VECTOR; -- 2.18.1