Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp587477imu; Wed, 23 Jan 2019 01:57:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN7E/tJu7P/hyqk9iLN+2M+cQgIclNYWU1MxboZjML+J/wTn/qwNyX8fhzc4LMIPvgAMLbHw X-Received: by 2002:a62:e044:: with SMTP id f65mr1458104pfh.208.1548237465921; Wed, 23 Jan 2019 01:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548237465; cv=none; d=google.com; s=arc-20160816; b=PWGAwbxLGxm4BktJMSo0GLn+5Ksuogss7QQIrHmh8IgkFJ5FupsYQhtE5Mgj12l1S5 EyltmyDvN7UGA0VgaWlRhfFsYtzYpdsoRYN9GOBKVhjxliS00uS68sOyhX2qGT69n5uc 2C+LeAREH6jdvnpD+j7SZHxwIORq90gd6Tfp5cPaW/CaDflPMJzPvRt8u369mgRDNNr3 uuGOSXZDvBs9uVPv8cPfRhrf1vYuiehkoIrQaG9fRFABuMX9iCbgbH9baZGQ8c2aZznz z3z5+979m50kgeSDdWVvLfEUyLGfD9IgEqR2DjU/+D5Kx3MUOIJscFfIOFXN0UQtRDmk 8k4A== 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=fud2nCYMPSdmhq9Y3PdsWN7L9RrHkS4YupvM4sP2IzY=; b=tGrU1nyAtOgYjZFGSwCcgPXmm+uGw4jWzjUEv5vJChR2IovJWv/5DuEqEI1k7Nm3UF COnUwPtEUj/SKRTOuWkrX1dAy/gMkU5viW6YVt9KUSzTQS06bvEC066dVlUkrd9Hw6Hr B5ejc2t17sIPM+iD0hpPZBD3TrUWQGQwisleKsd38SMFYfn86N+oUwdAwmFqP6qXlz7Y 4ZTEwN+nw3YhZaFh/TUamGK7AlaxN2xWnY1j3ZwFGIF0qDqlwbegMeoOa9I2OPrjray1 Yn36Kt56HJzorQMniaGX6kcH4zZc6L9lZop6aMLCyBajaZ1PHm4MTTmefQVz27D+7qJZ jOZg== 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 j22si15061870pgj.244.2019.01.23.01.57.31; Wed, 23 Jan 2019 01:57:45 -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 S1727439AbfAWJ4T (ORCPT + 99 others); Wed, 23 Jan 2019 04:56:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44978 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbfAWJ4Q (ORCPT ); Wed, 23 Jan 2019 04:56:16 -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 4913C4E916; Wed, 23 Jan 2019 09:56:16 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-89.pek2.redhat.com [10.72.12.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDB8E600C0; Wed, 23 Jan 2019 09:56:13 +0000 (UTC) From: Jason Wang To: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jasowang@redhat.com Cc: mst@redhat.com, kvm@vger.kernel.org Subject: [PATCH net-next V4 3/5] vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch() Date: Wed, 23 Jan 2019 17:55:55 +0800 Message-Id: <20190123095557.30168-4-jasowang@redhat.com> In-Reply-To: <20190123095557.30168-1-jasowang@redhat.com> References: <20190123095557.30168-1-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.38]); Wed, 23 Jan 2019 09:56:16 +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 bca86bf7189f..9c83c1837464 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 96dd87531ba0..24c74c60c093 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1308,7 +1308,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; @@ -1327,7 +1327,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 1b675dad5e05..4e21011b6628 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -207,7 +207,7 @@ bool vhost_enable_notify(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, -- 2.17.1