Networking Forums

Networking Forums > Computer Networking > Linux Networking > Placing ioctl in a kernel module ?

Reply
Thread Tools Display Modes

Placing ioctl in a kernel module ?

 
 
vivekaseeja@gmail.com
Guest
Posts: n/a

 
      05-10-2006, 12:27 PM
Hi,

Have an application which uses the ioctl call to set configuration of
the wireless card and the IP address. Just wondering if there is some
way this ioctl call can be placed in a kernel module to get better
performance. Any example of code showing the working of ioctl in a
kernel module would be helpful ..

thanks in advance ..
vivekian

 
Reply With Quote
 
 
 
 
Secure Buddha
Guest
Posts: n/a

 
      05-10-2006, 10:10 PM
Review of any network drivers should produce valuable information for
your purpose(s).

I would recommend looking through the linux/sockios.h header for
specific custom ioctl implementations.

Also it is fairly easy to implement a system wide configuration of
network devices by using the ethtool found at
http://sf.net/projects/gkernel/. Available macros for this utility are
found in linux/ethtool.h.

hth.
Thomas

 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a

 
      05-11-2006, 06:24 AM
(E-Mail Removed) wrote:
>
>Have an application which uses the ioctl call to set configuration of
>the wireless card and the IP address. Just wondering if there is some
>way this ioctl call can be placed in a kernel module to get better
>performance.


There is a commonly held misconception that kernel mode is somehow faster
than user mode. It ain't true. The processor runs the same speed in both
modes.

Unless you are starting this process from a kernel driver and spending time
calling out to user-mode, you aren't ging to gain anything.

>Any example of code showing the working of ioctl in a
>kernel module would be helpful ..


There are lots of examples. Look for IoBuildDeviceIoControlRequest --
that's what it's for.
--
- Tim Roberts, (E-Mail Removed)
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
vivekaseeja@gmail.com
Guest
Posts: n/a

 
      05-11-2006, 12:20 PM

Tim Roberts wrote:
> There is a commonly held misconception that kernel mode is somehow faster
> than user mode. It ain't true. The processor runs the same speed in both
> modes.
>
> Unless you are starting this process from a kernel driver and spending time
> calling out to user-mode, you aren't ging to gain anything.
>


Yes. But , was hoping that could avoid the overhead of userspace to
kernel space transition through this ..

 
Reply With Quote
 
Robert Redelmeier
Guest
Posts: n/a

 
      05-11-2006, 01:40 PM
In comp.os.linux.development.system (E-Mail Removed) wrote in part:
>
> Tim Roberts wrote:
>> There is a commonly held misconception that kernel
>> mode is somehow faster than user mode. It ain't true.
>> The processor runs the same speed in both modes.


>> Unless you are starting this process from a kernel driver
>> and spending time calling out to user-mode, you aren't
>> ging to gain anything.


>
> Yes. But , was hoping that could avoid the overhead of
> userspace to kernel space transition through this ..


This time shouldn't be significant. The null syscall (getpid)
takes 295 clocks on my old system. This only matters iff you
have a lot of non-blocking syscalls. Then I'd wonder if it
weren't poor pgm design (polling).

Kernel code isn't any faster, and still has to wait on devices.

One case to hoist code into the kernel may be where you can reduce
the number of interrupts. These can have really slow IO overhead
using the XT-PIC. But using APIC may be a better solution.

-- Robert

 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a

 
      05-15-2006, 04:06 AM
Tim Roberts <(E-Mail Removed)> wrote:

>(E-Mail Removed) wrote:
>
>>Any example of code showing the working of ioctl in a
>>kernel module would be helpful ..

>
>There are lots of examples. Look for IoBuildDeviceIoControlRequest --
>that's what it's for.


By the way, I apologize for my momentary disorientation. I read mostly
Windows groups, and IoBuildDeviceIoControlRequest is a Windows kernel
API...
--
- Tim Roberts, (E-Mail Removed)
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with netfilter in a kernel module Aashay Shringarpure Linux Networking 1 03-02-2009 06:58 AM
How to get data in kernel SEND buffer for a TCP socket from a netfilter based kernel module Rohit Linux Networking 0 05-10-2007 11:27 AM
Kernel module W.P. Linux Networking 9 04-04-2007 06:36 PM
killing a kernel thread ....... UDP server (kernel module)......... alex Linux Networking 0 09-20-2006 11:26 AM
UDP server as a kernel module alex Linux Networking 2 09-04-2006 09:48 AM



1 2 3 4 5 6 7 8 9 10 11