From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C059A7F00 for ; Wed, 17 Dec 2014 19:01:42 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 17 Dec 2014 09:50:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="500325178" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga003.jf.intel.com with ESMTP; 17 Dec 2014 09:47:37 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 18 Dec 2014 01:51:52 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.182]) with mapi id 14.03.0195.001; Thu, 18 Dec 2014 01:51:51 +0800 From: "Xie, Huawei" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [PATCH RFC v2 07/12] lib/librte_vhost: async event and callback Thread-Index: AQHQGCbbRgcuknV9B0qVGicY4y5CzJyUEgAQ Date: Wed, 17 Dec 2014 17:51:51 +0000 Message-ID: References: <1418247477-13920-1-git-send-email-huawei.xie@intel.com> <1418247477-13920-8-git-send-email-huawei.xie@intel.com> <548E6F9C.1000807@igel.co.jp> In-Reply-To: <548E6F9C.1000807@igel.co.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH RFC v2 07/12] lib/librte_vhost: async event and callback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 18:01:43 -0000 >=20 > I got error from checkpatch.pl like followings. >=20 > ERROR: trailing statements should be on next line > #74: FILE: lib/librte_vhost/vhost_user/fd_man.c:61: > + for (i =3D 0; i < pfdset->num && pfdset->fd[i].fd !=3D fd; i++); Thanks. This is RFC, so maybe it is far from perfection, :). > > + int num =3D MAX_FDS; >=20 > Is it possible to use pfdset->num? >=20 Had considered this. It is not performance critical code, and it is easier to use MAX_FDS. We could improve this after we have processed all the critical things. > > + > > + int added =3D 0; >=20 > Need a line? Thanks! >=20 > > + if (pfdentry->rcb && rfset) { > > + FD_SET(pfdentry->fd, rfset); > > + added =3D 1; > > + =09 > > + fd_set rfds,wfds; >=20 > Need a space between rfds and wfds. Agree. >=20 > > + int i, maxfds; > > + struct fdentry *pfdentry; > > + int num =3D MAX_FDS; >=20 > Is it possible to use pfdset->num? > > > + > > + if (pfdset =3D=3D NULL) > > + return; > > + > > + while (1) { > > + FD_ZERO(&rfds); > > + FD_ZERO(&wfds); > > + maxfds =3D fdset_fill(&rfds, &wfds, pfdset); > > + if (maxfds =3D=3D -1) { > > + return; > > + } > > + > > + select(maxfds + 1, &rfds, &wfds, NULL, NULL); > > + > > + for (i =3D 0; i < num; i++) { > > + pfdentry =3D &pfdset->fd[i]; > > + if (FD_ISSET(pfdentry->fd, &rfds) && pfdentry->rcb) > > + pfdentry->rcb(pfdentry->fd, pfdentry->dat); > > + if (FD_ISSET(pfdentry->fd, &wfds) && pfdentry->wcb) > > + pfdentry->wcb(pfdentry->fd, pfdentry->dat); > > + } > > + } > > +}