From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sesbmg23.ericsson.net (sesbmg23.ericsson.net [193.180.251.37]) by dpdk.org (Postfix) with ESMTP id B26EC1B762 for ; Mon, 16 Oct 2017 17:30:42 +0200 (CEST) X-AuditID: c1b4fb25-dd3ff70000000c94-b3-59e4d0a2827e Received: from ESESSHC016.ericsson.se (Unknown_Domain [153.88.183.66]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id 29.02.03220.2A0D4E95; Mon, 16 Oct 2017 17:30:42 +0200 (CEST) Received: from ESESSMB107.ericsson.se ([169.254.7.134]) by ESESSHC016.ericsson.se ([153.88.183.66]) with mapi id 14.03.0352.000; Mon, 16 Oct 2017 17:30:41 +0200 From: Jan Scheurich To: "'dev@dpdk.org'" , "'yliu@fridaylinux.org'" Thread-Topic: [dpdk-dev] [PATCH v3] vhost: Expose virtio interrupt need on rte_vhost API Thread-Index: AdNGk5syy0NShA1TQEqnCrAaNCjZLQ== Date: Mon, 16 Oct 2017 15:30:41 +0000 Message-ID: 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+NgFrrKLMWRmVeSWpSXmKPExsUyM2K7k+6iC08iDRp3iFm8+7SdyaJlyU4m ByaPXwuWsnrc+HeLLYApissmJTUnsyy1SN8ugStjxt0dbAVTeCvunN7H2MC4iauLkZNDQsBE YsWBT0xdjFwcQgJHGCUu3VzICOEsYZT4MOEYSxcjBwebgIHE7N0OIA0iAmES69b9YAYJCwtE SuxuyoYIR0lMvX8ZrFpEQE/i4iUDkDCLgKrE+7UXmEBsXgFfiS07vjKD2IwCYhLfT60BizML iEvcejKfCeIcAYkle84zQ9iiEi8f/2MFGSkhoCixvF8OolxHYsHuT2wQtrbEsoWvmSHGC0qc nPmEZQKj0CwkU2chaZmFpGUWkpYFjCyrGEWLU4uTctONjPVSizKTi4vz8/TyUks2MQID++CW 36o7GC+/cTzEKMDBqMTDq7L/SaQQa2JZcWXuIUYJDmYlEd4X54BCvCmJlVWpRfnxRaU5qcWH GKU5WJTEeR33XYgQEkhPLEnNTk0tSC2CyTJxcEo1MOasUgzJ5hMRlv3RKfIlXjQvRNvYOHHp t6mrLphrvTnY9njvEWVOzdWNeRVe2l6l5gmNOS8q3f2DOtbrLu7aqFKidzvWc9+/Y995fwT8 2naK+c0GucnLfryXWcXZ/KXCRLdx5SZOmz5HiSIB91VF0fuvhM1/I2atI/zgRFzN8jrO7MTe DW+vKbEUZyQaajEXFScCAPCEzW5oAgAA 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: Mon, 16 Oct 2017 15:30:42 -0000 Fixed the subject. > 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