Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3885139imb; Tue, 5 Mar 2019 23:19:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwY8jqmZYaE6tbahQrGwHgiPcEmex2RaeQY62qx9LxMOg5F6ZxbN18fyJJXkS4tmN1bNq98 X-Received: by 2002:a17:902:6804:: with SMTP id h4mr5485805plk.115.1551856770314; Tue, 05 Mar 2019 23:19:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551856770; cv=none; d=google.com; s=arc-20160816; b=sU3j5rMNvomh+flhYueiro2GBuJG9h4KGg5AEqs9qcS5jYJQezgDh/6KpOp4tmLTMM 6sACQpsqt2e37NVoiYlpaoTB+/wmnNXtHi9mIVcxcbAgeDQSeTH18nEUieihT6VmpqlW 8OxTZ1DAeBq5sCiWNSSInMIVCtFW/LC29vmllsyOsR9aokm0rqWVAe3X15tZlD5vKK+p uiwUoAVSYZgwG79erXUvx5yvXaCe2/zp3fffxHr+aNEPCKlxNF8vzLn+vCAMGwJo2ml/ W2kla31P02o0xlCICyDFbXRMptVDR2tGKlfg16teS75VUQ/y7ln6pmOUC8wq5FJe5j0h NJnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=OYPBbA6eAG3catNtSF1xNYKBcVS8MMZS2S/FHZ1OqKw=; b=c4DLfSn9Thv1KKX+ocAHZAOjurg6ZNxmNyZ3pGLdGr4h9MgWmm64n9yk9+HWBn4zSY rwcIEScG86ukRjDJaDnxB6fTTTByCi4/k/6ie3ra0C948z8blXeAorXQWNm7lad8jfvm R38tmageMEQg1o8B1mmEpshTPwlE4EZpzU719WD/V6Ugq1HmlUZpGgjZXuRiNb2+UxIw WrLePJvqyWZvrM8N+hEDoyIlxws+8bA7DgYKO339db+ZlE999w+e/F/3bCu+Pon/43+b VmREgv2opmk7rtv7Gpi9oBTekfWqq9ZTWNqZq95mAlN/wlajGmrvZReq5xcAlSXdp8WN /Qpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i39si796913plb.210.2019.03.05.23.19.15; Tue, 05 Mar 2019 23:19:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729321AbfCFHSi (ORCPT + 99 others); Wed, 6 Mar 2019 02:18:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37334 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbfCFHSe (ORCPT ); Wed, 6 Mar 2019 02:18:34 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 3FE76300B915; Wed, 6 Mar 2019 07:18:34 +0000 (UTC) Received: from hp-dl380pg8-02.lab.eng.pek2.redhat.com (hp-dl380pg8-02.lab.eng.pek2.redhat.com [10.73.8.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFFAE600C5; Wed, 6 Mar 2019 07:18:28 +0000 (UTC) From: Jason Wang To: jasowang@redhat.com, mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: peterx@redhat.com, linux-mm@kvack.org, aarcange@redhat.com Subject: [RFC PATCH V2 3/5] vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch() Date: Wed, 6 Mar 2019 02:18:10 -0500 Message-Id: <1551856692-3384-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1551856692-3384-1-git-send-email-jasowang@redhat.com> References: <1551856692-3384-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 06 Mar 2019 07:18:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename the function to be more accurate since it actually tries to prefetch vq metadata address in IOTLB. And this will be used by following patch to prefetch metadata virtual addresses. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 4 ++-- drivers/vhost/vhost.c | 4 ++-- drivers/vhost/vhost.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index df51a35..bf55f99 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -971,7 +971,7 @@ static void handle_tx(struct vhost_net *net) if (!sock) goto out; - if (!vq_iotlb_prefetch(vq)) + if (!vq_meta_prefetch(vq)) goto out; vhost_disable_notify(&net->dev, vq); @@ -1140,7 +1140,7 @@ static void handle_rx(struct vhost_net *net) if (!sock) goto out; - if (!vq_iotlb_prefetch(vq)) + if (!vq_meta_prefetch(vq)) goto out; vhost_disable_notify(&net->dev, vq); diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 29709e7..2025543 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1309,7 +1309,7 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, return true; } -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) +int vq_meta_prefetch(struct vhost_virtqueue *vq) { size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; unsigned int num = vq->num; @@ -1328,7 +1328,7 @@ int vq_iotlb_prefetch(struct vhost_virtqueue *vq) num * sizeof(*vq->used->ring) + s, VHOST_ADDR_USED); } -EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); +EXPORT_SYMBOL_GPL(vq_meta_prefetch); /* Can we log writes? */ /* Caller should have device mutex but not vq mutex */ diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 9490e7d..7a7fc00 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -209,7 +209,7 @@ void vhost_add_used_and_signal_n(struct vhost_dev *, struct vhost_virtqueue *, int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, unsigned int log_num, u64 len, struct iovec *iov, int count); -int vq_iotlb_prefetch(struct vhost_virtqueue *vq); +int vq_meta_prefetch(struct vhost_virtqueue *vq); struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type); void vhost_enqueue_msg(struct vhost_dev *dev, -- 1.8.3.1