From owner-freebsd-hackers Tue Jun 12 6: 8:47 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ip.eth.net (mail.ip.eth.net [202.9.128.18]) by hub.freebsd.org (Postfix) with ESMTP id DADE137B403 for ; Tue, 12 Jun 2001 06:08:35 -0700 (PDT) (envelope-from anjali@indranetworks.com) Received: (apparently) from anjali ([202.9.130.19]) by ip.eth.net with Microsoft SMTPSVC(5.5.1877.117.11); Tue, 12 Jun 2001 18:38:27 +0530 Message-ID: <043f01c0f340$dbf95160$0a64a8c0@indranetworks.com> From: "Anjali Kulkarni" To: "Josh Osborne" Cc: References: <200106121221.FAA16567@smtpout.mac.com> Subject: Re: User-Level upcalls Date: Tue, 12 Jun 2001 18:39:03 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_043A_01C0F36E.F3F648D0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. ------=_NextPart_000_043A_01C0F36E.F3F648D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Thanks a lot for the info. But how can I use poll and select to make the = kernel call the user-upcall? Poll and select will run in user-mode and = will take processor cycles in busy waiting. I want an event-driven = mechanism in which kernel will automatically call the upcall(like an = interrupt) when it receives a data packet at the TCP layer, to avoid = polling in user code to check if data has arrived at the socket.=20 I will read about kqueues, and fcntl which I dont know much about:) Thanks, Anjali ----- Original Message -----=20 From: Josh Osborne=20 To: Anjali Kulkarni=20 Sent: Tuesday, June 12, 2001 5:50 PM Subject: Re: User-Level upcalls On Tuesday, June 12, 2001, at 05:34 AM, Anjali Kulkarni wrote: hi, =20 Does any one know how to perform user-level upcalls from kernel = TCP/IP stack? If I wanted to get an upcall every time a data packet = arrived on a socket, how can it be done? Can I use signal handlers for = this? =20 Thanks, Anjali kqueue is the nicest interface, but new and not as portable as others. poll and select are more traditional, and popular. you can also try fcntl's O_ASYNC flag, but I have never used it. ------=_NextPart_000_043A_01C0F36E.F3F648D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
Thanks a lot for the info. But how can = I use poll=20 and select to make the kernel call the user-upcall? Poll and select will = run in=20 user-mode and will take processor cycles in busy waiting. I want an = event-driven=20 mechanism in which kernel will automatically call the upcall(like an = interrupt)=20 when it receives a data packet at the TCP layer, to avoid polling in = user code=20 to check if data has arrived at the socket.
I will read about kqueues, and fcntl = which I dont=20 know much about:)
 
Thanks,
Anjali
----- Original Message -----
From:=20 Josh = Osborne
To: Anjali=20 Kulkarni
Sent: Tuesday, June 12, 2001 = 5:50=20 PM
Subject: Re: User-Level = upcalls

On Tuesday, June 12, 2001, at 05:34 AM, Anjali Kulkarni = wrote:

hi,
 
Does=20 any one know how to perform user-level upcalls from kernel TCP/IP = stack? If=20 I wanted to get an upcall every time a data packet arrived on a = socket, how=20 can it be done? Can I use signal handlers for=20 this?
 
Thanks,
Anjali


k= queue=20 is the nicest interface, but new and not as portable as = others.
poll and=20 select are more traditional, and popular.
you can also try fcntl's = O_ASYNC=20 flag, but I have never used it. ------=_NextPart_000_043A_01C0F36E.F3F648D0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message