[ovs-dev] [PATCH 2/2] ovs-ctl.in: Restore flows across force-reload-kmod.

Ben Pfaff blp at nicira.com
Wed Jan 16 00:03:17 UTC 2013


On Tue, Jan 15, 2013 at 03:27:44PM -0800, Gurucharan Shetty wrote:
> On Tue, Jan 15, 2013 at 11:46 AM, Ben Pfaff <blp at nicira.com> wrote:
> >
> > On Fri, Jan 11, 2013 at 03:48:41PM -0800, Gurucharan Shetty wrote:
> > > If we want to upgrade from branch1.9 to master (or potential 1.10)
> > > and restore flows across force-reload-kmod, we need to maintain
> > > the value of ofport.
> > >
> > > To do this, we fetch the value of ofport before the upgrade and use
> > > it to populate the column 'ofport_request' after ovsdb is upgraded.
> > > We need to do this before vswitchd is restarted as vswitchd
> > > needs the ofport_request column populated before it starts.
> > >
> > > Issue #13556
> > > Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
> >
> > We seem to do this on every upgrade, but in fact it's only useful for
> > upgrades from 1.9 to 1.10 or later, right?
> 
> Sorry, my commit message does not give the correct picture. It should have read
> 
> "If we want to upgrade from a previous branch to master..."

I think that part is clear enough, but I think that the first line (in
the subject) is wrong, because (if I undersatnd it properly) this patch
does not restore flows, it restores port numbers.  I guess that this is
a prerequisite for usefully restoring flows; maybe that is what you
mean.

> The current patch should be able to handle flow restore when there
> is an upgrade from any previous branch to current master(1.10).

OK, I see what you mean, that it should work with any upgrade from
pre-1.10 to 1.10 or later.

> But we won't need to save ofports while upgrading from 1.10 to a
> future branch (because ofport
> becomes persistent in 1.10). So we eventually can remove it. Its
> presence does not hurt,
> but it will be unnecessary.

OK.

> Removing "save ofports" in a future branch will not?restore flows for
> a upgrade from pre-1.10 branch(ex: 1.9) to that future
> branch.  To avoid a situation like that I can do something like this:
> 
> save_ofports ()
> {
> #VERSION will hold major number and minor number without dots. Ex: ab
> for a.b.c.d
> VERSION=`ovs-appctl version | sed -n '/ovs-vswitchd/s/[^0-9]*//p' |
> sed 's/\([^\.]*\)\.\([^\.]*\).*/\1\2/'`
> if [ "${VERSION}" -gt 19 ]; then
>    return
> fi
> ....
> ....
> ....
> 
> }
> 
> I am not sure whether it is a overkill.

It could be a little cleaner, I think, something like:

    case `ovs-appctl version | sed 1q` in
        "ovs-vswitchd (Open vSwitch) 1."[0-9].*) 
            # Need to save port numbers
            ;;
        *)
            # Can skip saving port numbers.
            ;;
    esac



More information about the dev mailing list