From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id A80C11B347 for ; Mon, 29 Jan 2018 15:11:56 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D756C0568DE; Mon, 29 Jan 2018 14:11:56 +0000 (UTC) Received: from localhost (dhcp-192-241.str.redhat.com [10.33.192.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 76FE217AD5; Mon, 29 Jan 2018 14:11:55 +0000 (UTC) From: Jens Freimann To: dev@dpdk.org Cc: tiwei.bie@intel.com, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com Date: Mon, 29 Jan 2018 15:11:31 +0100 Message-Id: <20180129141143.13437-3-jfreimann@redhat.com> In-Reply-To: <20180129141143.13437-1-jfreimann@redhat.com> References: <20180129141143.13437-1-jfreimann@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 29 Jan 2018 14:11:56 +0000 (UTC) Subject: [dpdk-dev] [PATCH 02/14] net/virtio: don't call virtio_disable_intr() for packed queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2018 14:11:56 -0000 When VIRTIO_F_PACKED_RING is set, don't call virtio_disable_intr(). This function accesses data structures which are not available when packed virtqueues are enabled. Signed-off-by: Jens Freimann --- drivers/net/virtio/virtio_ethdev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 825b6c303..76879d87f 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -324,12 +324,11 @@ virtio_init_vring(struct virtqueue *vq) vq->vq_desc_tail_idx = (uint16_t)(vq->vq_nentries - 1); vring_desc_init(vr->desc, size); + /* + * Disable device(host) interrupting guest + */ + virtqueue_disable_intr(vq); } - - /* - * Disable device(host) interrupting guest - */ - virtqueue_disable_intr(vq); } static int @@ -747,7 +746,8 @@ virtio_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) struct virtnet_rx *rxvq = dev->data->rx_queues[queue_id]; struct virtqueue *vq = rxvq->vq; - virtqueue_disable_intr(vq); + if (!vtpci_packed_queue(vq->hw)) + virtqueue_disable_intr(vq); return 0; } -- 2.14.3