From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sesbmg22.ericsson.net (sesbmg22.ericsson.net [193.180.251.48]) by dpdk.org (Postfix) with ESMTP id E67DD1B3B4 for ; Mon, 16 Oct 2017 09:47:46 +0200 (CEST) X-AuditID: c1b4fb30-ef1ff70000001b7f-38-59e4642296a9 Received: from ESESSHC009.ericsson.se (Unknown_Domain [153.88.183.45]) by sesbmg22.ericsson.net (Symantec Mail Security) with SMTP id 5C.B3.07039.22464E95; Mon, 16 Oct 2017 09:47:46 +0200 (CEST) Received: from ESESSMB107.ericsson.se ([169.254.7.134]) by ESESSHC009.ericsson.se ([153.88.183.45]) with mapi id 14.03.0352.000; Mon, 16 Oct 2017 09:47:46 +0200 From: Jan Scheurich To: "dev@dpdk.org" , "yliu@fridaylinux.org" Thread-Topic: dev Digest, Vol 164, Issue 196 Thread-Index: AQHTPm4dSJLsw5guNkSqfM+rjisfyKLmJ9jQ Date: Mon, 16 Oct 2017 07:47:45 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [153.88.183.17] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsUyM2K7rq5SypNIgytvlSzefdrOZNGyZCeT A5PHrwVLWT1u/LvFFsAUxWWTkpqTWZZapG+XwJVx+8UJtoJ/PBV/N2g3MC7i6mLk5JAQMJHo ffKUuYuRi0NI4AijxM3ebewQzhJGiUs75jN2MXJwsAkYSMze7QDSICIQJDHh9V1mEFtYQFti +7GTLBBxHYnfu5qhbCOJRavngNksAqoSe67MYQUZwyvgK7HlgjpIWEjAXOL1pCOMIDangIXE xPNNYOWMAmIS30+tYQKxmQXEJW49mc8EcaeAxJI955khbFGJl4//gY2UEFCUWN4vB1GuI7Fg 9yc2CFtbYtnC12DlvAKCEidnPmGZwCgyC8nUWUhaZiFpmYWkZQEjyypG0eLU4qTcdCMjvdSi zOTi4vw8vbzUkk2MwEg4uOW3wQ7Gl88dDzEKcDAq8fDe93kSKcSaWFZcmXuIUYKDWUmEt8YR KMSbklhZlVqUH19UmpNafIhRmoNFSZzXcd+FCCGB9MSS1OzU1ILUIpgsEwenVANjkjdL5Sx7 w6ybgcwZOzc5m+7NeSyss/Pc/q8C4kyXPisr5+1aMsNut0TvzPycrT/5Q/69b8wXU2cNUEsJ c9LS/OZ1Wrl0bqNkZfF3/tb2yM69s5Iu2ut8sfX/vNJ34TUdQ95Dap8XSGYY3O/WWzI7mO+U a4RDTUjf2klTo6w3m93JOPFb6aUSS3FGoqEWc1FxIgAv//aZgAIAAA== Subject: Re: [dpdk-dev] dev Digest, Vol 164, Issue 196 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, 16 Oct 2017 07:47:47 -0000 > Date: Fri, 6 Oct 2017 14:40:15 +0800 > From: Yuanhan Liu > To: Jan Scheurich > Cc: "'dev@dpdk.org'" > Subject: Re: [dpdk-dev] [PATCH v3] vhost: Expose virtio interrupt need > on rte_vhost API > Message-ID: <20171006064015.GD1545@yliu-home> > Content-Type: text/plain; charset=3Dus-ascii >=20 > 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 =3D get_device(vid); > > + if (dev =3D=3D NULL) > > + return 0; > > + > > + vq =3D dev->virtqueue[qid]; > > + if (vq =3D=3D NULL) > > + return 0; > > + > > + if (unlikely(vq->enabled =3D=3D 0 || vq->avail =3D=3D NULL)) > > + return 0; > > + > > + return !(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT); >=20 > Two comments here: >=20 > - 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. >=20 > 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. That is understood. > - OTOH, you might want to try "rte_vhost_get_vhost_vring" API, which > exposes the vq->avail, therefore, the interrupt flag is also exposed. Thanks for the pointer. I checked and all necessary tools to access the int= errupt flag are publicly available on the API. So the proposed new API func= tion is not needed. I will obsolete the patch.=20 Regards, Jan