From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by dpdk.org (Postfix) with ESMTP id 7289C1B23B for ; Fri, 6 Oct 2017 08:40:20 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id A7D7A12CD; Fri, 6 Oct 2017 02:40:19 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 06 Oct 2017 02:40:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=GCir7CwOcx9RULvfaF9X6wQ0a47MPGaw7ZKsKGXxQ UU=; b=J9hx9aU9nkxQEbeufLO2nREY214iNLzrVtvH+W+yvZZcA0Nnob/JSGkrp t/0wZXsBCSvIBPE1F10hZ5Aua6myoU4PCnztz/YX88JuSCKiehZprPXvfuH/sL3w K26/ho2Bqvgp4ofmTXBYVXcPBX9nYZtf+K6n0ngkELBS0z88tt14rqVIDDC2dLLl 7uZE7jxrA/S27QEhWntIQxgtgBjACgaiVfrRSnmAbYIxyflX1AqklUTJE+jbk7Uv l0cdPNHa1pGDp5RUjofoTStdd5WAGwh+BlehRSSZDdIuWlfBNmZCl/6r8RZVibvE t9l1doAiaqb0QI230VdeILcMLlHVQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=GCir7CwOcx9RULvfaF 9X6wQ0a47MPGaw7ZKsKGXxQUU=; b=Na64T1Q7dhrP69mMKPcSDotuRqK3ozyWWY JlhRRBkIbVoxNg9BKTe+5KA8QIa3zwtoh/GiuEjYITxUiVEAjgwCvgCHPn9IGpWq lecqRV54/mR8+FOZ1mL+LqGtnyirkbaEBkym4SOAIsUCNTMC0ePVC62LNI2cxol+ KCiydNGFSNrrxP2DJ0luhA9h8X5KX+UpDchXU5assnb2r/nZFo1P1oifB/VIurWV f1x/JXhFs53EHeBsbg8O59SXR7DWc+q/+e6yby1EcMZmZO+7ideWPVlJ2uLsjIbA aXRxqFDdcFVzRZzj6e0dQjGJmU5de06OZVU7Bjj07/3Rd4FNAiiw== X-ME-Sender: X-Sasl-enc: Wh+naMH/NhHyUb+yPxu7bO8ZLltDj7rMw3h2/WYmQlmO 1507272018 Received: from yliu-home (unknown [222.64.136.243]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A9347E65B; Fri, 6 Oct 2017 02:40:18 -0400 (EDT) Date: Fri, 6 Oct 2017 14:40:15 +0800 From: Yuanhan Liu To: Jan Scheurich Cc: "'dev@dpdk.org'" Message-ID: <20171006064015.GD1545@yliu-home> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH v3] vhost: Expose virtio interrupt need on rte_vhost API 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: Fri, 06 Oct 2017 06:40:20 -0000 On Sat, Sep 23, 2017 at 08:31:37PM +0000, Jan Scheurich wrote: ... > +int rte_vhost_tx_interrupt_requested(int vid, uint16_t qid) > +{ > + struct virtio_net *dev; > + struct vhost_virtqueue *vq; > + > + dev = get_device(vid); > + if (dev == NULL) > + return 0; > + > + vq = dev->virtqueue[qid]; > + if (vq == NULL) > + return 0; > + > + if (unlikely(vq->enabled == 0 || vq->avail == NULL)) > + return 0; > + > + return !(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT); Two comments here: - as you see, the flags is stored at vq->avail, which is stored at the shared memory. That means, the virtio driver could change the value at any time. That said, this API should not be intended to be invoked once. Then you have to invoke it repeatedly, which might be a bit costy. - OTOH, you might want to try "rte_vhost_get_vhost_vring" API, which exposes the vq->avail, therefore, the interrupt flag is also exposed. --yliu