From patchwork Thu Jul 5 11:40:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1159651 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4E7D8DFB7C for ; Thu, 5 Jul 2012 11:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755820Ab2GELkL (ORCPT ); Thu, 5 Jul 2012 07:40:11 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:47364 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755676Ab2GELkJ (ORCPT ); Thu, 5 Jul 2012 07:40:09 -0400 Received: by obbuo13 with SMTP id uo13so12905459obb.19 for ; Thu, 05 Jul 2012 04:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:content-transfer-encoding:mime-version; bh=4XwnLZibLgEK5ofMtoBxW0w0kGFXV+/uRNCnQBjIirs=; b=jFMZldRki/SYRASl/O0OGRjY8O9yRQ3L3hyFE6WjGOszRuXc71ZlCKBGShvBDKh6Mp tsHTwbtqj2fGOSlZ2gILGClmknywZVYofejE2+QI4IUqjB1fzNMirXIIPaxReqq6gxFm 6TU6scKuZwrZqSTrlSFUEqAxbAOl55LHvfyeKd3Ibsamf3sg04IiOugGxX5ofvLAMK65 Qu7ptTmGYdFFJhEz+V7HhHB/MJVEY7luYDFb1NW7Xa7BSmd2dCPcpQkWaHilyqg/wbGb k7pGK5F4emGReMMg+Cg9c717OMtM2ZuY6ZDPQeiUr2FyclWjfp3PP7pa+JqMaDGATFdK xMIQ== Received: by 10.182.112.102 with SMTP id ip6mr7661687obb.39.1341488408604; Thu, 05 Jul 2012 04:40:08 -0700 (PDT) Received: from [192.168.42.194] ([109.65.221.135]) by mx.google.com with ESMTPS id rr9sm20509753obc.8.2012.07.05.04.40.03 (version=SSLv3 cipher=OTHER); Thu, 05 Jul 2012 04:40:07 -0700 (PDT) Message-ID: <1341488454.18786.15.camel@lappy> Subject: Re: [net-next RFC V5 2/5] virtio_ring: move queue_index to vring_virtqueue From: Sasha Levin To: Jason Wang Cc: mst@redhat.com, mashirle@us.ibm.com, krkumar2@in.ibm.com, habanero@linux.vnet.ibm.com, rusty@rustcorp.com.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, edumazet@google.com, tahm@linux.vnet.ibm.com, jwhan@filewood.snu.ac.kr, davem@davemloft.net, akong@redhat.com, kvm@vger.kernel.org, sri@us.ibm.com Date: Thu, 05 Jul 2012 13:40:54 +0200 In-Reply-To: <1341484194-8108-3-git-send-email-jasowang@redhat.com> References: <1341484194-8108-1-git-send-email-jasowang@redhat.com> <1341484194-8108-3-git-send-email-jasowang@redhat.com> X-Mailer: Evolution 3.2.3 Mime-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, 2012-07-05 at 18:29 +0800, Jason Wang wrote: > Instead of storing the queue index in virtio infos, this patch moves them to > vring_virtqueue and introduces helpers to set and get the value. This would > simplify the management and tracing. > > Signed-off-by: Jason Wang This patch actually fails to compile: drivers/virtio/virtio_mmio.c: In function ‘vm_notify’: drivers/virtio/virtio_mmio.c:229:13: error: ‘struct virtio_mmio_vq_info’ has no member named ‘queue_index’ drivers/virtio/virtio_mmio.c: In function ‘vm_del_vq’: drivers/virtio/virtio_mmio.c:278:13: error: ‘struct virtio_mmio_vq_info’ has no member named ‘queue_index’ make[2]: *** [drivers/virtio/virtio_mmio.o] Error 1 It probably misses the following hunks: --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index f5432b6..12b6180 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -222,11 +222,10 @@ static void vm_reset(struct virtio_device *vdev) static void vm_notify(struct virtqueue *vq) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); - struct virtio_mmio_vq_info *info = vq->priv; /* We write the queue's selector into the notification register to * signal the other end */ - writel(info->queue_index, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY); + writel(virtqueue_get_queue_index(vq), vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY); } /* Notify all virtqueues on an interrupt. */ @@ -275,7 +274,7 @@ static void vm_del_vq(struct virtqueue *vq) vring_del_virtqueue(vq); /* Select and deactivate the queue */ - writel(info->queue_index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL); + writel(virtqueue_get_queue_index(vq), vm_dev->base + VIRTIO_MMIO_QUEUE_SEL); writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_PFN); size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));