Character device synchronization with network interface
Character device synchronization with network interface
- Subject: Character device synchronization with network interface
- From: "Jamie Wood" <email@hidden>
- Date: Wed, 03 Nov 2004 12:11:30 -0800
Hi,
I have a network interface driver that passes information to user space via
a character device file in /dev. I need to provide some sort of
synchronization between the code which services the read/write system calls
and the code that accepts and sends network packets from the IP stack.
I've been poking around in the Apple documentation, but am still a little
confused. In the syscall service code, do I simply need to use
thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL) and vice versa to keep
the networking code from accessing the driver's shared data structures?
Based on what
http://www.usenix.org/publications/library/proceedings/bsdcon02/full_papers/gerbarg/gerbarg_html/
says, this doesn't sound like it will be enough, and only helps in SMP
situations. However, that seems to be what other drivers are doing (namely,
the PPP driver).
Do I need to use a mutex in addition to thread_funnel_switch()? Performance
is critical to me, so I would like to avoid using any unnecessary locks.
Any clarification would be greatly appreciated.
Thanks,
Jamie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden