[ovs-discuss] ifindex of datapath

Motonori Shindo motonori at shin.do
Wed Nov 26 23:24:27 UTC 2014


Ben,

Oh I din’t come up with this idea. Thanks a lot!

As to the current Engine ID and Engine Type, I agree with you. There must be a better way, or simply defaults to 0 regardless to the type of datapath as we can explicitly set these values anyway.

Regards,

—
Motonori Shindo

2014/11/27 1:53、Ben Pfaff <blp at nicira.com> のメール:

> 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