[NETVIRT-566] Netvirt does not set br-int to netdev with dpdk Created: 24/Mar/17  Updated: 29/May/18  Resolved: 30/Mar/17

Status: Resolved
Project: netvirt
Component/s: General
Affects Version/s: Boron
Fix Version/s: None

Type: Bug
Reporter: Tim Rozet Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 8078

 Description   

Right now it looks like netvirt is looking for some configuration parameter to decide if a bridge should be created as netdev or system:

https://github.com/opendaylight/netvirt/blob/e477acc8f904f14869777db7a7f4b9cd1b479a4d/vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanBridgeManager.java#L77

Configuring it this way may work for a user who wants a homogeneous deployment, but it is not valid in other scenarios. For example, in OpenStack when using controller and compute nodes, we want the compute nodes to be in netdev for br-int because they will have vhostuser ports. However, controller nodes will use Neutron DHCP agent, and therefore we want them to use system bridge br-int for regular tap interfaces.

If the configuration option is not provided to netvirt, then netvirt should decide to use netdev or system based on configuration of the OVSDB node. In OVS >= 2.6 this can be determined by checking other_config: dpdk-init="true" in OVS. If DPDK is enabled, then I think it is safe for netvirt to decide to create br-int as netdev type. Otherwise it can create br-int as system.

Note other_config:dpdk-init is not yet part of the OVSDB schema, so it would need to be added. Another option may be to introduce a totally new flag as other_config to each OVSDB node, so that a user may configure (per node) to enable netdev or not.



 Comments   
Comment by Tim Rozet [ 25/Mar/17 ]

You can see dpdk is enabled in my iface_types, but br-int was created as system.

[root@overcloud-novacompute-0 ~]# ovs-vsctl list open_vswitch
_uuid : 563f5fee-ddbb-4e24-acb5-2c24f09496ae
bridges : [8abc4f0f-514c-482d-af48-c50eca62133f, b4828ab2-5ac0-4dda-8880-b55bb95536d2, e506262d-fcd7-48c7-ad34-62f837d1f453]
cur_cfg : 13
datapath_types : [netdev, system]
db_version : "7.14.0"
external_ids :

{hostname="overcloud-novacompute-0.opnfvlf.org", system-id="a636e28f-f6e8-4b9e-8a1d-cfab65c3dab8"}

iface_types : [dpdk, dpdkr, dpdkvhostuser, dpdkvhostuserclient, geneve, gre, internal, ipsec_gre, lisp, patch, stt, system, tap, vxlan]
manager_options : [41a242c9-d10a-482a-865b-9113911525a7, 7fffb012-ba4b-4e2d-9694-0bd5c47cb17e, cf6aa392-f0a4-4097-8f9c-a429a62606d6, db0d31ed-e6fa-4b39-84e7-910c0987c6a2, df31e757-7732-4a52-9aa3-91dcee28022f]
next_cfg : 13
other_config :

{dpdk-init="true", dpdk-lcore-mask="2", dpdk-socket-mem="1024", local_ip="11.0.0.22", pmd-cpu-mask="4", provider_mappings="datacentre:br-ex"}

ovs_version : "2.6.1"
ssl : []
statistics : {}
system_type : centos
system_version : "7"
[root@overcloud-novacompute-0 ~]# ovs-appctl dctpl/show
"dctpl/show" is not a valid command
ovs-appctl: ovs-vswitchd: server returned an error
[root@overcloud-novacompute-0 ~]# ovs-appctl dpctl/show
netdev@ovs-netdev:
lookups: hit:20641 missed:141 lost:0
flows: 3
port 0: ovs-netdev (tap)
port 1: br-ex (tap)
port 2: eth2
port 3: dpdk0 (dpdk: configured_rx_queues=1, configured_tx_queues=1, mtu=1500, requested_rx_queues=1, requested_tx_queues=3)
port 4: br-phy (tap)
system@ovs-system:
lookups: hit:0 missed:0 lost:0
flows: 0
masks: hit:0 total:0 hit/pkt:0.00
port 0: ovs-system (internal)
port 1: br-int (internal)

Comment by Josh Hershberg [ 30/Mar/17 ]

(In reply to Timothy Rozet from comment #0)
> Right now it looks like netvirt is looking for some configuration parameter
> to decide if a bridge should be created as netdev or system:
>
> https://github.com/opendaylight/netvirt/blob/
> e477acc8f904f14869777db7a7f4b9cd1b479a4d/vpnservice/elanmanager/elanmanager-
> impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanBridgeManager.
> java#L77
>

It certainly looks like that . But if you dig further down that is just one of the ways the bridge can be set to netdev. The code you reference sets a variable called dpType which is passed into SouthboundUtils.addBridge. But in there we have:

if (dpType != null)

{ ovsdbBridgeAugmentationBuilder.setDatapathType(dpType); }

if (isOvsdbNodeDpdk(ovsdbNode))

{ ovsdbBridgeAugmentationBuilder.setDatapathType(DatapathTypeNetdev.class); }

isOvsdbNodeDpdk checks for the dpdk interface type and returns true if it exists.

So no matter what the value of the configuration parameter, if the OVS has dpdk interface type, netdev will get set.

Comment by Tim Rozet [ 30/Mar/17 ]

The reason br-int was getting set to system was due to a bug in RDO:
https://bugzilla.redhat.com/show_bug.cgi?id=1436021

When setting OVS to be dpdk, it requires a restart. This restart was triggering systemd to also start Neutron OVS Agent which was connecting to the switch and creating br-int as system.

Generated at Wed Feb 07 20:21:54 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.