Re: ctl_enqueuedata ENOBUFS error
Re: ctl_enqueuedata ENOBUFS error
- Subject: Re: ctl_enqueuedata ENOBUFS error
- From: "Justin C. Walker" <email@hidden>
- Date: Tue, 12 Jul 2005 13:09:49 -0700
On Jul 12, 2005, at 12:28 , Allan Hoeltje wrote:
"Justin C. Walker" <email@hidden> wrote on 7/12/05 11:57 AM:
Justin, everything you have said so far I treat as pure gold.
Thank you for
all the time you have spent on my problem so far.
Jeez...wish I could cash that in ;-}
I mean: ENOBUFS usually means no space of some kind - either no
buffers or no space to put buffers in, depending. Since this is not
a common problem for existing code, it seems likely that it is due to
something you are doing, presumably incorrectly.
To what existing code do you refer? I have Googled and Spotlighted
for
kern_ctl_reg, ctl_enqueuedata, mbuf_copydata, and only find the
Apple docs
that I have mentioned before. I see no sample code of any kind on
the web.
I'm referring to the Darwin kernel code. Have you checked Apple's
Darwin site (<http://developer.apple.com/darwin>)? The kernel source
is there, along with all other 'open source' components of Mac OS X.
The kernel is in the 'xnu' project ("X is not unix"). You should
download a copy and become familiar with it. This will show you how
things are implemented.
You should be aware that the mbuf accounting rules take into account
all the space in an mbuf, whether you use it or not (e.g., if you
allocate an mbuf with cluster, put 1 byte in the cluster, and enqueue
it, you are docked for the size of the mbuf (256 bytes) + size of
cluster (2048 bytes). You may already know this but it's worth
emphasizing.
I am not, as far as my code goes, allocating any mbufs. I am
accessing the
data in the mbuf passed to me in my ipf_input_func but I do not
free it nor
allocate any other mbuf. The data I send via ctl_enqueuedata is
_MALLOC'd
and _FREE'd but it is not an mbuf.
What do you do with the mbuf that is passed to you?
The fact remains that something is going wrong, and it's going wrong
with the mbuf pool, in some way. The smart money would be on your
code...
This is a no-whining zone.
Oh, now you tell me! :-)
Wasn't this a part of your license agreement?
Yes that helps very much. Knowing that the only place to really
learn this
stuff is by looking directly at Darwin is the best piece of
information I've
gotten to date. The Apple docs should say that and then emphasize
it in the
section where they warn us about writing KEXTs.
If there is some aspect that you believe can be improved, let Apple
know (either as a bug/enhancement report, or directly to DTS). This
list is not the way to let Apple know anything; it's a medium for
developers to communicate with each other.
Cheers,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
It's not whether you win or lose...
It's whether *I* win or lose.
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden