[ipxe-devel] alloc_iob failing
Michael Brown
mcb30 at ipxe.org
Sat Mar 8 07:23:06 UTC 2014
On 08/03/14 04:23, Pfaff, Mark wrote:
> I am working on a propriety driver which is very similar to the legacy.c code in the ipxe codebase.
That's not a good starting point. As the name suggests, legacy.c is
just a wrapper around the legacy drivers which have not been converted
to the iPXE driver model. It does not make sense to create new code
following that model.
> In the same fashion I initialize a new iobuf ptr on every receive iteration and then send it to netdev_rx. I don't have the need for a circular private iobuffer list at this time as I have my own backend dma buffer which memcpy's the packet to my iobuf for receives.
The general structure of an iPXE driver RX datapath is that you allocate
a ring of RX buffers which you pass to the hardware, and then when the
hardware reports a received packet you just mark the buffer as filled
with the appropriate length (using iob_put()) and hand the iobuf to
netdev_rx(). See e.g. intel.c for a good example of how this works.
> I'd like for my poll to call receive, send my iobuf to netdev_rx and have it sent to the stack and cleaned up.
>
> My code base works perfectly for pings and well as small transfers. After loading about 40% of an 800k kernel/image alloc_iob is failing. Am I missing a step to release iobuf's at some point, or do you have other suggestions?
Please publish your driver (as required by the GPL), and we can then
review the code.
Michael
More information about the ipxe-devel
mailing list