Date: Tue, 12 Jun 2001 19:34:24 +0500 From: manas <manas@yahoo-inc.com> To: Anjali Kulkarni <anjali@indranetworks.com> Cc: hackers@FreeBSD.ORG Subject: Re: User-Level upcalls Message-ID: <3B26286F.E5E6F327@yahoo-inc.com> References: <200106121221.FAA16567@smtpout.mac.com> <043f01c0f340$dbf95160$0a64a8c0@indranetworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--------------F4838F767407969251B21021 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit try signal based i/o. basically you have set a signal handler (SIG_IO) and then handle read/write when the signal gets generated. i don't exactly remember the command. it the function call is aio_read/aio_write. check the man thanks manas Anjali Kulkarni wrote: > 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: > > > <?fontfamily><?param > Arial><?smaller>hi,<?/smaller><?/fontfamily> > > <?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> > > <?fontfamily><?param > Arial><?smaller>Thanks,<?/smaller><?/fontfamily> > <?fontfamily><?param > Arial><?smaller>Anjali<?/smaller><?/fontfamily> > > 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. > --------------F4838F767407969251B21021 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <body bgcolor="#FFFFFF"> try signal based i/o. basically you have set a signal handler (SIG_IO) and then handle read/write when the signal gets generated. i don't exactly remember the command. it the function call is aio_read/aio_write. check the man <br>thanks <br>manas <p>Anjali Kulkarni wrote: <blockquote TYPE=CITE><style></style> <font face="Arial"><font size=-1>Hi,</font></font> <font face="Arial"><font size=-1>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></font><font face="Arial"><font size=-1>I will read about kqueues, and fcntl which I dont know much about:)</font></font> <font face="Arial"><font size=-1>Thanks,</font></font><font face="Arial"><font size=-1>Anjali</font></font> <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> On Tuesday, June 12, 2001, at 05:34 AM, Anjali Kulkarni wrote: <br> <blockquote><?fontfamily><?param Arial><?smaller>hi,<?/smaller><?/fontfamily> <p><?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> <p><?fontfamily><?param Arial><?smaller>Thanks,<?/smaller><?/fontfamily> <br><?fontfamily><?param Arial><?smaller>Anjali<?/smaller><?/fontfamily></blockquote> <p>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> </blockquote> </body> </html> --------------F4838F767407969251B21021-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B26286F.E5E6F327>