[Click] Re?: Re: Kernel mode with a recent kernel

Luigi Rizzo rizzo at iet.unipi.it
Fri Dec 16 18:18:39 EST 2011


On Sat, Dec 17, 2011 at 12:46:37AM +0200, Beyers Cronje wrote:
> Hi Luigi,
> 
> On Sat, Dec 17, 2011 at 12:28 AM, Luigi Rizzo <rizzo at iet.unipi.it> wrote:
> 
> > On Fri, Dec 16, 2011 at 10:54:06PM +0200, Beyers Cronje wrote:
> > > According to figure 5
> > > http://info.iet.unipi.it/~luigi/netmap/20110729-rizzo-infocom.pdf  there
> > > seems to be a significant improvement over netmapcap using native netmap
> > > (7500kpps vs 9660kpps), so this sounds like a good idea.
> >
> > in terms of time it is only 20ns per packet :)
> >
> > Surely every little improvement counts, but probably it is more
> > useful to extend the libpcap library to attach to individual rings,
> > so you can run multiple threads in parallel without contention.
> > It's a trivial change (the ring index can be part of the device
> > name).
> >
> > To use efficiently the native API, click should use the buffers
> > allocated by netmap instead of its own. I guess the in-kernel
> > click does the same, using sk_buffs instead of allocating memory ?
> >
> 
> That is correct, Click kernel module uses sk_buffs instead of allocating
> packet data memory. However, userspace Click has a nice Packet::make
> overload that takes a previous allocated buffer and a pointer to a
> destructor function that gets called when the packet is killed. See
> https://github.com/kohler/click/blob/master/include/click/packet.hh#L58
> So you can use netmap buffers allocated to Click packet data, Click will
> only allocate packet annotations and headers using the Click packet pool
> but use netmap's buffer for the data payload.

ok

> Does netmap require in-order release of these buffers back to netmap? If so

the only requirement is to refill the receive ring, but it does not
have to be made immediately and it does not have to be the same buffer.

In-kernel click probably doesn't need to bother with ring refills because
they are done by the device driver, but this way loses the flexibility of
recycling buffers without going through the allocator.

cheers
luigi


More information about the click mailing list