On Thu, Nov 01, 2012 at 02:30:29PM +0000, Thomas Graf wrote:
> On 10/26/12 at 07:44am, Ben Pfaff wrote:
> > On Fri, Oct 26, 2012 at 09:22:35PM +0800, Cong Wang wrote:
> > > On 10/25/2012 11:20 PM, Ben Pfaff wrote:
> > > >Furthermore, ovs-vsctl is meant to be generic in the sense that you can
> > > >use an ovs-vsctl built in one place (on one OS) to control a switch and
> > > >database running elsewhere (on another OS).  You don't want to apply the
> > > >local host's restrictions to changes to a remote db.
> > > 
> > > The problem without this patch is that when we add some port whose
> > > name is longer than IFNAMSIZ, ovs-vsctl doesn't give any error, the
> > > error is actually "hidden" in the log, which is actually written by
> > > ovs-vswitchd. So, it is not easy for inexperienced people to find
> > > where the error is.
> > > 
> > > How about raising the console log level? So that such errors will be
> > > seen on the terminal.
> > 
> > ovs-vswitchd doesn't have a fd for the console; it daemonized itself and
> > closed that fd long ago.  (That's especially important if one started
> > ovs-vswitchd over an SSH connection; otherwise ovs-vswitchd holds the
> > SSH connection open.)
> > 
> > I think the key is probably to learn to look at the log if something
> > goes wrong.
> 
> Cong is referring to the console where ovs-vsctl is running on.

Raising the console log level for ovs-vsctl will not make this
information obviously available.  You will see this, if you try it.

> What we experience is that if the kernel returns an error via netlink,
> ovs-vsctl does not display an error or any other indication that an
> error occured and that the port could not be added to the datapath.

ovs-vsctl does not make Netlink calls.  It only updates the database,
via ovsdb-server.  ovs-vswitchd does make the Netlink calls, but it
doesn't talk directly to ovs-vsctl.  It only monitors the database.

> Currently the logfile has to be consulted after each invocation of
> ovs-vsctl to verify whether there was an error or not.
>
> Would you accept a patch to pipe what goes into the logfile in
> responds to a ovs-* command to stderr as well?

I can't imagine a clean way to do that.  ovs-vswitchd makes the
Netlink call.  It doesn't communicate directly with ovs-vsctl.  It
does talk to ovsdb-server, which talks to ovs-vsctl.

Stepping back: I support your basic proposal, that "ovs-vsctl
add-port" should report a problem if the port cannot successfully be
added.  The issue is that, so far, the approaches I've seen don't fit
well with the overall Open vSwitch design.  Here is another approach
that fits better: make "ovs-vsctl add-port" check the value that
ovs-vswitchd assigns to the "ofport" column in the new Interface
record.  When a port is added successfully, this column receives a
positive integer value; when adding a port fails, it receives the
value -1.  I'd accept a patch to do this.

Currently, nothing reports the particular reason why a port cannot be
added, but if this is really necessary (it seems like a fairly minor
refinement) then we could add a column to hold a status string.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to