RE: Any one has experience about TCP/UDP develepment in LINUXkernel space.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Bernd,
	Really thank you for your advice.
	What makes me to have this thought is I want to improve the
performance of my software.	Normally, I use user-space socket
interface to receive UPD/TCP packets. But for my project, in fact,
another device will process the payload of the packets, so I have to
send the data to kernel driver again. That means I have to do a lot data
transfer, such as from kernel to user-space, then from user-space to
kernel again.
	If I can directly receive TCP/UDP packets from kernel space and
send them into my device. Does that mean I can save a lot of CPU time?
	Of course, I'm not sure if such this crazy thing can help me,
maybe it is a very silly idea.
	In addition, I need to receive high bit rate data stream
[20Mbit/s] from ip port. So performance is really important for me. 

Terry

-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx
[mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Bernd
Petrovitsch
Sent: Friday, November 09, 2007 5:01 PM
To: Tang Rui
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: Any one has experience about TCP/UDP develepment in
LINUXkernel space.

On Fri, 2007-11-09 at 10:17 +0800, Tang Rui wrote:
[...]
>        I want to develop a TCP/UDP daemon in LINUX kernel-space, I use
> this demon to receive data from specified ip port, and then injector
> the data to another driver or device.
> 
> Most of cases,  we can use user-space socket interface to receive
> TCP/UDP packet , then send data to driver by driver's user-space file
> control interface ,
> 
> Why not we do such thing in kernel space?  Dose any one have

It buys much less performance then you think/believe if you implement it
sanely in user-space - e.g. learn about the sendfile() and splice()
system-calls.
If you need almost-realtime, learn about POSIX real-time priorities.
And there are other means to solve other potential problems good enough
for almost all applications.

If you need real hard real-time, learn about RTAI.

And you have to cope with all the kernel-internal programming
restrictions, non-existing debug features, risk of
killing/booting/freezing the system just because your daemon has
a silly bug.

>  experience about this?

No, because in almost all cases the network traffic is slow enough for
user-space. So perhaps you can describe what's the primary reason you
want to so it in the kernel?

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux