From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6 04/13] vhost: rxtx: prepare work for multiple queue support Date: Tue, 20 Oct 2015 08:57:52 +0200 Message-ID: <3814429.n33jvMuIcb@xps13> References: <1444369572-1157-1-git-send-email-yuanhan.liu@linux.intel.com> <1444369572-1157-5-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, marcel@redhat.com, "Michael S. Tsirkin" To: Yuanhan Liu Return-path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by dpdk.org (Postfix) with ESMTP id 5B47A8E8F for ; Tue, 20 Oct 2015 08:59:31 +0200 (CEST) Received: by wicll6 with SMTP id ll6so13372915wic.1 for ; Mon, 19 Oct 2015 23:59:31 -0700 (PDT) In-Reply-To: <1444369572-1157-5-git-send-email-yuanhan.liu@linux.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-10-09 13:46, Yuanhan Liu: > From: Changchun Ouyang > > Do not use VIRTIO_RXQ or VIRTIO_TXQ anymore; use the queue_id, > instead, which will be set to a proper value for a specific queue > when we have multiple queue support enabled. > > For now, queue_id is still set with VIRTIO_RXQ or VIRTIO_TXQ, > so it should not break anything. The title may be more informative. Example: vhost: use queue id instead of constant ring index > - if (unlikely(queue_id != VIRTIO_RXQ)) { > - LOG_DEBUG(VHOST_DATA, "mq isn't supported in this version.\n"); > + if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->virt_qp_nb))) { > + RTE_LOG(ERR, VHOST_DATA, > + "%s (%"PRIu64"): virtqueue idx:%d invalid.\n", > + __func__, dev->device_fh, queue_id); [...] > - if (unlikely(queue_id != VIRTIO_RXQ)) { > - LOG_DEBUG(VHOST_DATA, "mq isn't supported in this version.\n"); > + if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->virt_qp_nb))) { > + RTE_LOG(ERR, VHOST_DATA, > + "%s (%"PRIu64"): virtqueue idx:%d invalid.\n", > + __func__, dev->device_fh, queue_id); > + return 0; [...] > - if (unlikely(queue_id != VIRTIO_TXQ)) { > - LOG_DEBUG(VHOST_DATA, "mq isn't supported in this version.\n"); > + if (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->virt_qp_nb))) { > + RTE_LOG(ERR, VHOST_DATA, > + "%s (%"PRIu64"): virtqueue idx:%d invalid.\n", > + __func__, dev->device_fh, queue_id); Why not use the log macros in drivers/net/virtio/virtio_logs.h? If you don't like the current log format, it would deserve a separate patch to change them consistently.