Sean Boudreau(deleted)
|
Re: allocating memory for mbuf
|
Sean Boudreau(deleted)
01/19/2010 10:15 PM
post45522
|
Re: allocating memory for mbuf
On Tue, Jan 19, 2010 at 08:28:16PM -0500, Vinod Kolapuram wrote:
> Hi ,
> 1. Do we neet to just use malloc to allocate memory for mbuf? In io-net there are inbuilt functions on io-net
structure for allocation and free.
No, malloc doesn't provide memory that is safe for packet buffers, use
m_get(), m_gethdr() or m_getcl(). For 512 bytes you'll probably need
a cluster.
>
> 2. Since io-net is not available now for 6.4.0 and above, we don't have to use iov which was part of io-net for
porting to io-pkt right?
This is vague. There's various iovs in both io-net and io-pkt.
>
> 3. At the porting point where I am right now makes me feel, that the _iopkt_self structure usage in io-pkt is very
minimal compared to _io_net_self usage in io-net. Even though we are using_iopkt_self struct in the entry function,
looks like most of the functionality is for the thread handling.
>
> 4. I have around 512 bytes of data to read from stack and do my modification and then put back on stack to send it to
other machine. From high level its very simple, but when I looking at the structure usage, its getting more entangled in
other complex manipulations. Can any suggest simple steps to achive this using the io-pkt features and functionality.
There's various ways to do this. The most portable would be with
userland sockets.
Regards,
-seanb
|
|
|