[ovs-dev] [PATCH 6/6] netdev-vport: Use vport set_stats instead of internal dev.

Jesse Gross jesse at nicira.com
Thu Jun 10 20:35:04 UTC 2010


On Thu, Jun 10, 2010 at 10:10 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Wed, Jun 09, 2010 at 07:33:21PM -0700, Jesse Gross wrote:
> > In certain cases we require the ability to provide stats that are
> > added to the values collected by the kernel (currently only used
> > by bond fake devices).  Internal devices previously implemented
> > this directly but now that their stats are now handled by the vport
> > layer the functionality has been moved there.  This removes the
> > userspace code to set the stats and replaces it with a mechanism
> > to access the equivalent functionality in the vport layer.
>
> The only question I had here, other than a trivial one in a comment
> below, was whether you were swapping or not swapping rx/tx in the right
> places.  But since there's a big comment about that in one spot, I'll
> assume that you thought it through.  Personally that issue just makes my
> head spin.
>

In general there is less swapping with these stats then there was
previously.  We always track the stats from the perspective of the switch
and ideally the only place where the stats are swapped is when we report
them to the OS for the internal device.  The one issue is with bond fake
devices where we don't have the information on the device type down in the
kernel.  Since the bond fake devices are really a hack and I didn't want to
propagate more of that hack throughout the code I just swapped them at the
source and added that big comment.  It isn't really correct (it will make
the OpenFlow stats reversed for the bond device) but it is the same behavior
as before and nobody has complained about it.


>
> > +    err = netdev_vport_do_ioctl(ODP_VPORT_STATS_SET, &ovsr);
> > +
> > +    /* If the vport layer doesn't know about the device, that doesn't
> mean it
> > +     * doesn't exist (after all we have an open netdev), it just means
> that it
> > +     * isn't attached and we'll be getting stats a different way. */
>
> I think that the parenthetical comment here is a little deceptive.  I
> don't think that there's really such a thing as an "open netdev" under
> Linux.  We don't even have a per-netdev file descriptor anymore, since
> it was too expensive.
>

I actually meant our userspace netdev library here, which in practice means
that the device at least existed when netdev_open() was called.  I'll try to
clarify the comment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20100610/2d26eb16/attachment-0003.html>


More information about the dev mailing list