Date: Tue, 12 Jun 2001 18:39:03 +0530 From: "Anjali Kulkarni" <anjali@indranetworks.com> To: "Josh Osborne" <stripes@mac.com> Cc: <hackers@freebsd.org> Subject: Re: User-Level upcalls Message-ID: <043f01c0f340$dbf95160$0a64a8c0@indranetworks.com> References: <200106121221.FAA16567@smtpout.mac.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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.
I will read about kqueues, and fcntl which I dont know much about:)
Thanks,
Anjali
----- Original Message -----
From: Josh Osborne
To: Anjali Kulkarni
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,
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?
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.
[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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. </FONT></DIV>
<DIV><FONT face=Arial size=2>I will read about kqueues, and fcntl which I dont
know much about:)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Anjali</FONT></DIV></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:stripes@mac.com" title=stripes@mac.com>Josh Osborne</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:anjali@indranetworks.com" title=anjali@indranetworks.com>Anjali
Kulkarni</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 12, 2001 5:50
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: User-Level upcalls</DIV>
<DIV><BR></DIV>On Tuesday, June 12, 2001, at 05:34 AM, Anjali Kulkarni
wrote:<BR><BR>
<BLOCKQUOTE><?fontfamily><?param Arial><?smaller>hi,<?/smaller><?/fontfamily><BR> <BR><?fontfamily><?param Arial><?smaller>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?<?/smaller><?/fontfamily><BR> <BR><?fontfamily><?param Arial><?smaller>Thanks,<?/smaller><?/fontfamily><BR><?fontfamily><?param Arial><?smaller>Anjali<?/smaller><?/fontfamily><BR></BLOCKQUOTE><BR><BR>kqueue
is the nicest interface, but new and not as portable as others.<BR>poll and
select are more traditional, and popular.<BR>you can also try fcntl's O_ASYNC
flag, but I have never used it.</BLOCKQUOTE></BODY></HTML>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?043f01c0f340$dbf95160$0a64a8c0>
