[ovs-discuss] Netdev 'name' Uniqueness
Casey Barker
crbarker at google.com
Thu Mar 8 19:12:58 UTC 2012
I'm experimenting with running multiple ofproto instances from within a
single process, where Open vSwitch is linked as a library, and the
datapaths operate outside the kernel. These ofproto instances are
completely independent of each other, each representing a separate logical
switching entity. (The reasons for putting them in the same process are...
complex.)
Since they're independent, there's now a desire to use some common port
names on every switching entity -- including those ofprotos that happen to
be managed by the same process. That's fine for the ofprotos, but netdev.c
tracks all created devices in a static 'netdev_dev_shash,' keyed only by
netdev_dev.name. That means all netdevs across all ofprotos in a process
share a global namespace (as is customary for sane use of netdevs).
My proposed departure from sanity is to assign the ports an
ofproto-specific netdev provider 'type' to differentiate the devs from each
other, similar to how type/name works for datapaths. Does anyone see any
issues with keying the netdev_dev_shash by the concatenation of netdev_dev
type + name? It causes some minor ripples in the netdev API, but nothing
insurmountable.
I imagine this isn't a desirable change for the mainline code, so I intend
to keep this hack to myself. I'm more looking for any issues that I'm not
seeing, or that could crop up in future iterations. (However, I did notice
that netdev_open() doesn't compare the 'type' before re-opening an existing
dev. Might be worth adding a sanity check as is done for args.)
Casey Barker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20120308/616db0e9/attachment.html>
More information about the discuss
mailing list