[ovs-dev] exporting port-to-ifindex mapping

Ben Pfaff blp at nicira.com
Fri Jun 7 22:27:22 UTC 2013

I think it should go into Interface.

The field should be mutable, because its value is not known when
ovs-vsctl (or another OVSDB client) adds the Interface record;
instead, ovs-vswitchd fills it in later.  Otherwise your plan sounds

Other interface status columns, such as 'link_state' and 'mtu', behave
much as I would expect ifindex to behave.

Thanks a lot!

On Fri, Jun 07, 2013 at 03:19:28PM -0700, Neil Mckee wrote:
> Want to make sure I get off on the right foot...  should the read-only ifindex field go
> into "Port" or "Interface" ?  It seems like ovsrec_interface is the one with the pointer to netdev.
> So I just need to:
> 1. change the schema to add ifindex as a new field (with mutable: false),
> 2. update the schema checksum and rebuild vswitch-idl.[ch],  then
> 3.  edit bridge.c to make sure the ifindex from the netdev is pushed into
> ovsrec_interface whenever one of those is created.
> Does this sound like a plan?
> Is there an existing read-only field that behaves in a similar way so I can nose around?
> Neil
> On May 28, 2013, at 5:01 PM, Ben Pfaff <blp at nicira.com> wrote:
> > On Tue, May 28, 2013 at 12:17:39PM -0700, Neil Mckee wrote:
> >> It would be helpful if ovs-vsctl(1) had a way to write out the
> >> netdev ifIndex numbers, where applicable, of the bridge ports.  This
> >> would help to harmonize integration with SNMP, sFlow, LLDP and more.
> >> 
> >> Could it be an extra column in the output from "ovs-vsctl list Port"
> >> ?  Or a key-value pair in the "External-IDs" column?
> > 
> > It would be easy enough to add it to the "status" column,
> > e.g. status:ifindex.  It might even be reasonable to add a standalone
> > "ifindex" column, since ifindex is a pretty universal concept.  I
> > think I lean that way.
> > 
> > Are you willing and able to propose a patch?

More information about the dev mailing list