[ovs-dev] [PATCH 2/2] datapath: omit _mod from module names

Jesse Gross jesse at nicira.com
Fri Mar 9 00:30:54 UTC 2012


On Thu, Mar 8, 2012 at 2:52 PM, Chris Wright <chrisw at sous-sol.org> wrote:
> * Jesse Gross (jesse at nicira.com) wrote:
>> On Wed, Mar 7, 2012 at 10:28 AM, Chris Wright <chrisw at sous-sol.org> wrote:
>> > diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
>> > index 9bdb3df..80e8f00 100755
>> > --- a/utilities/ovs-ctl.in
>> > +++ b/utilities/ovs-ctl.in
>> >  insert_openvswitch_mod_if_required () {
>> > -    # If openvswitch_mod is already loaded then we're done.
>> > -    test -e /sys/module/openvswitch_mod && return 0
>> > +    # If openvswitch is already loaded then we're done.
>> > +    test -e /sys/module/openvswitch && return 0
>> [...]
>> > -    test -e /sys/module/brcompat_mod && return 0
>> > -    action "Inserting brcompat module" modprobe brcompat_mod
>> > +    test -e /sys/module/brcompat && return 0
>> > +    action "Inserting brcompat module" modprobe brcompat
>>
>> I think we might want to test for either name in these places.
>> Previously, if an old version of the module was loaded then we would
>> succeed, which should be OK now that we're maintaining stable
>> interfaces.  However, if the names are different we'll try to load the
>> new module when the old one is loaded, which will fail.
>
> OK.  Were you thinking something simple like:
>
>    test -e /sys/module/openvswitch_mod && rmmod openvswitch_mod
>
> as a preamble, then allow the new module to get loaded?  Or something
> more akin to force_reload_kmod (to save/restore, although restore may
> not work)?

I was actually thinking something even simpler like this:
(test -e /sys/module/openvswitch || test -e
/sys/module/openvswitch_mod) && return 0

If the kernel module is already loaded (from an earlier version) but
with the same name then currently we'll succeed without doing
anything.  Since the name change doesn't signify anything in
particular, I don't think there's any reason that we should behave
differently.



More information about the dev mailing list