On Mon, Jan 13, 2014 at 03:37:56PM -0800, Joe Stringer wrote:
> On 13 January 2014 14:04, Ben Pfaff <[email protected]> wrote:
> >
> > I suggest adding an NL_DUMP_BUFSIZE or similar in the header and
> > suggesting in the comment that at least that much space should
> > available.  (There is no harm if there isn't, because the netlink
> > receive function will reallocate the buffer and copy data around, but
> > performance is better without that.)
> >
> 
> I wasn't sure how much should be used, and the nl_sock_recv() comment
> didn't help much either---"enough space for a typical message". Could this
> be more general, as a suggested buffer size for all netlink transactions?

Most netlink messages fit in 4k, but the average size of a reply is
probably a lot smaller.  The average size of a dump reply is probably
much closer to 4k because the kernel will fill the dump with as many
messages as actually fit in 4k.

I guess I'm OK with suggesting 4k for all transactions, then, while
keeping in mind that it's not actually necessary all the time (and
that messages can actually be bigger than that).
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to