[LiSA-Devel] Implementation of get_vdb

Radu Rendec radu.rendec at mindbit.ro
Fri Apr 12 12:00:00 EEST 2013


On Wed, 2013-04-10 at 21:12 +0300, Victor Duta wrote:
>    I have a question regardin the implementation of get_vdb . We have
> agreed that the function must return a vlan bitmap. In the current
> implementation the kernel sends a buffer of net_switch_vdb's to
> userspace containing all vlans in database . My question is should the
> bitmap be constructed from within the kernel and send to userspace or
> use the current implementation and construct the bitmap from within
> the middleware. Both aproaches have their ups and downs . If the vdb
> is large (more the 128 vlans) the first aproach would be better but if
> we have a vdb with few vlans then the second aproach would be better .

I'm moving this thread to "lisa-devel", since it's a technical question
(rather than an administrative topic).

Since the vlan description is no longer in the kernel, the only
information that the kernel call needs to return is whether each vlan
number exists in the kernel VDB.

I think it's better to use bitmaps both in user space and kernel. The
memory for the bitmap can be allocated in userspace, and then the kernel
can write to it directly - without the "ping-pong" between user space
and kernel that can happen in case of increasingly allocated buffers
(the buf_alloc_swcfgr() function in lib/util.c).

The sw_get_vdb() function in net/switch/sw_ioctl.c can then simply set
the corresponding bits in the bitmap that is passed from user space.



More information about the LiSA-Devel mailing list