From owner-freebsd-arch@freebsd.org Wed Apr 27 17:59:19 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C15B1E1A8 for ; Wed, 27 Apr 2016 17:59:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A21E1F35 for ; Wed, 27 Apr 2016 17:59:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3EA97B93A; Wed, 27 Apr 2016 13:59:18 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Cc: Christian Peron , dayanidhi sreenivasan Subject: Re: FIONBIO support in freebsd for bpf Date: Wed, 27 Apr 2016 10:59:04 -0700 Message-ID: <2277475.FAchkNOHDZ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <5DCCBADE-B367-46DA-9B48-9393F7A3C2AD@sqrt.ca> References: <20160427013155.GA3880@xor.gateway.mts.net> <5DCCBADE-B367-46DA-9B48-9393F7A3C2AD@sqrt.ca> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 27 Apr 2016 13:59:18 -0400 (EDT) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:59:19 -0000 On Tuesday, April 26, 2016 08:49:50 PM Christian Peron wrote: > Actually, upon inspection of the code, it appears that ioctl(fd, FION= BIO, ..); works as expected. This ioctl cmd appears to be handled furth= er up the stack=E2=80=A6 Yes, it's a bit odd, but when F_SETFL tries to set O_NONBLOCK, the kern= el passes FIONBIO down to the device to "ask" if it's ok to use the desire= d setting (in *(int *)data) of non-blocking. In this case bpf is just sa= ying it supports either setting by returning 0 regardless of the value in da= ta. > > On Apr 26, 2016, at 8:31 PM, Christian Peron wrote: > >=20 > > It is supported. If you want to put the descriptor into non-blockin= g mode, open it up with > > the device with the O_NONBLOCK flag specified. It probably wouldn'= t be too difficult to implement > > this via ioctl(FIONBIO) but I would need to look at it. Not certai= n why it can't be done using this > > method. > >=20 > > Hope this helps. > >=20 > > On Tue, Apr 26, 2016 at 07:22:20PM -0400, dayanidhi sreenivasan wro= te: > >> Hi Guys, > >> Can somebody tell me why there is no support for non blocking IO f= or bpf yet? > >>=20 > >> static int > >> bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, > >> struct thread *td) > >> { > >>=20 > >> ...... > >>=20 > >> case FIONBIO: /* Non-blocking I/O */ > >> break; > >>=20 > >> } > >>=20 > >> Thanks > >> Daya > >> _______________________________________________ > >> freebsd-arch@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/freebsd-arch > >> To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd= .org" >=20 > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.or= g" --=20 John Baldwin