[ovs-discuss] ifindex of datapath

Ben Pfaff blp at nicira.com
Wed Nov 26 16:53:03 UTC 2014


On Wed, Nov 26, 2014 at 11:01:57PM +0900, Motonori Shindo wrote:
> Is there any way to know the ifindex of datapath (ova-system) by using
> ovs-vsctl/dpctl/appctl ?

"cat /sys/class/net/ovs-system/ifindex" will show you, although I
understand it is not one of the tools you mention.

> I also noticed that switch.xml says:
> 
>     <column name="engine_id">
>       Engine ID to use in NetFlow messages.  Defaults to datapath index
>       if not specified.
>     </column>
> 
>     <column name="engine_type">
>       Engine type to use in NetFlow messages.  Defaults to datapath
>       index if not specified.
>     </column>
> 
> but this is only true in the case of netlink. If OVS is run in user
> space these are derived from the hash based on datapath name, I think.

Here's some better documentation of the current situation, but the
current situation just looks crazy to me.  I think we should probably do
something different:

    <column name="engine_id">
      Engine ID to use in NetFlow messages.  The value used depends on
      the datapath in use.  Kernel-based datapaths use the ifindex of
      the datapath device, e.g. the ifindex of <code>ovs-system</code>
      (this can change from one boot to the next or even more often if
      the Open vSwitch kernel module is unloaded and reloaded or if
      the datapath is otherwise deleted).  The userspace datapath uses
      8 bits of an internally generated hash of the datapath name (for
      a given Open vSwitch architecture and version, this is a
      constant).
    </column>

    <column name="engine_type">
      Engine type to use in NetFlow messages.  The value used depends
      on the datapath in use.  Kernel-based datapaths use the ifindex
      of the datapath device (the same value as <ref
      column="engine_id"/>.  The userspace datapath uses 8 bits of an
      internally generated hash of the datapath name (but the bits
      used are different from <ref column="engine_id"/>.
    </column>



More information about the discuss mailing list