[ovs-dev] ofport = -1?

Krzysztof Wojciechowski krzysztofwojciechowski at poczta.pl
Wed Jul 12 12:05:58 UTC 2017


Hello

I am writing some kind of SDN driver at this moment. I have problem with 
ofports. Sometimes they have value "-1". I am not sure if its wrong. But 
i cant add flow with ACTION=output:-1
I think We didn't have this problem with Xen Cloud Platform or Xen 
installed on Xen on Debian. But it exist in XenServer6.5 (not sure if in 
newer).

example:

> # ovs-vsctl list Interface
> .........
> _uuid               : 7579e414-d739-400b-9fc8-538d497485dc
> admin_state         : []
> bfd                 : {}
> bfd_status          : {}
> cfm_fault           : []
> cfm_fault_status    : []
> cfm_flap_count      : []
> cfm_health          : []
> cfm_mpid            : []
> cfm_remote_mpids    : []
> cfm_remote_opstate  : []
> duplex              : []
> external_ids        : {attached-mac="ee:ee:ee:ee:ee:e", 
> xs-network-uuid="(xen-network-uuid-here)", 
> xs-vif-uuid="(xen-vif-uuid-here)", xs-vm-uuid="(xenserver-vm-uuid-here)"}
> ifindex             : []
> ingress_policing_burst: 10000
> ingress_policing_rate: 100000
> lacp_current        : []
> link_resets         : []
> link_speed          : []
> link_state          : []
> mac                 : []
> mac_in_use          : []
> mtu                 : []
> name                : "vif1.1"
> ofport              : -1
> ofport_request      : []
> options             : {}
> other_config        : {}
> statistics          : {}
> status              : {}
> type                : ""
> ........
there is ofport: -1.

But if I use this command:
> # ovs-ofctl show xapi10
> OFPT_FEATURES_REPLY (xid=0x2): dpid:0000c6431dd0fb2e
> n_tables:254, n_buffers:256
> capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
> actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC 
> SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
>  4(vif1.1): addr:fe:ff:ff:ff:ff:ff
>      config:     0
>      state:      0
>      speed: 0 Mbps now, 0 Mbps max
> .....

But here this port have number "4".

i am using python so i am creating dictionary of ofports using this:

> for bridge in self.idl.tables["Bridge"].rows.itervalues():
>             for port in bridge.ports:
>                 for interface in port.interfaces:
> mac_to_ofport[xapi_to_gre[bridge.name]][interface.external_ids["attached-mac"]]=interface.ofport[0]
Or I should make it other way?


Sorry for my bad english.

Regards
Krzysztof



More information about the dev mailing list