Add support to set ovs module log level

Change-Id: I1fcd5b49cb2af4c76ed32b332f83ca8fa783a3c6
This commit is contained in:
Roy Tang 2020-04-16 21:39:20 -07:00
parent 34a7533b64
commit 03a43cb91e
3 changed files with 31 additions and 4 deletions

View File

@ -338,6 +338,20 @@ function process_dpdk_bonds {
done < "/tmp/bonds_array"
}
function set_dpdk_module_log_level {
# loop over all target modules
if [ -n "$(get_dpdk_config_value ${DPDK_CONFIG} '.modules')" ]; then
echo $DPDK_CONFIG | jq -r -c '.modules[]' > /tmp/modules_array
while IFS= read -r module; do
local mod_name=$(get_dpdk_config_value ${module} '.name')
local mod_level=$(get_dpdk_config_value ${module} '.log_level')
ovs-appctl -t ${OVS_CTL} vlog/set ${mod_name}:${mod_level}
ovs-appctl -t ${OVS_CTL} vlog/list|grep ${mod_name}
done < /tmp/modules_array
fi
}
function get_driver_by_address {
if [[ -e /sys/bus/pci/devices/$1/driver ]]; then
echo $(ls /sys/bus/pci/devices/$1/driver -al | awk '{n=split($NF,a,"/"); print a[n]}')
@ -393,6 +407,7 @@ if [[ "${DPDK_ENABLED}" == "true" ]]; then
init_ovs_dpdk_bridges
process_dpdk_nics
process_dpdk_bonds
set_dpdk_module_log_level
fi
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
@ -420,10 +435,10 @@ EOF
if [[ "${bridge_name}" == "${tunnel_interface}" ]]; then
# Route the tunnel traffic via the physical bridge
if [[ -n "${LOCAL_IP}" && -n "${PREFIX}" ]]; then
if [[ -n $(ovs-appctl ovs/route/show | grep "${LOCAL_IP}") ]]; then
ovs-appctl ovs/route/del "${LOCAL_IP}"/"${PREFIX}"
if [[ -n $(ovs-appctl -t ${OVS_CTL} ovs/route/show | grep "${LOCAL_IP}") ]]; then
ovs-appctl -t ${OVS_CTL} ovs/route/del "${LOCAL_IP}"/"${PREFIX}"
fi
ovs-appctl ovs/route/add "${LOCAL_IP}"/"${PREFIX}" "${tunnel_interface}"
ovs-appctl -t ${OVS_CTL} ovs/route/add "${LOCAL_IP}"/"${PREFIX}" "${tunnel_interface}"
if [[ -n "${tunnel_underlay_vlan}" ]]; then
# If there is not tunnel network gateway, exit

View File

@ -1698,6 +1698,7 @@ conf:
ovs-vsctl: CommandFilter, ovs-vsctl, root
# NOTE(yamamoto): of_interface=native doesn't use ovs-ofctl
ovs-ofctl: CommandFilter, ovs-ofctl, root
ovs-appctl: CommandFilter, ovs-appctl, root
kill_ovsdb_client: KillFilter, root, /usr/bin/ovsdb-client, -9
ovsdb-client: CommandFilter, ovsdb-client, root
xe: CommandFilter, xe, root
@ -2100,6 +2101,13 @@ conf:
# # used with ovs-dpdk. In which case pci_id of PF must be
# # provided above.
# # vf_index: 0
#
# Set the log level for each target module (default level is always dbg)
# Supported log levels are: off, emer, err, warn, info, dbg
#
# modules:
# - name: dpdk
# log_level: info
# Names of secrets used by bootstrap and environmental checks
secrets:

View File

@ -75,6 +75,10 @@ conf:
vf_index: 0
bridges:
- name: br-phy-bond0
modules:
- name: dpdk
log_level: info
# In case of shared profile (sriov + ovs-dpdk), sriov agent should finish
# first so as to let it configure the SRIOV VFs before ovs-agent tries to
# bind it with DPDK driver.
@ -87,4 +91,4 @@ dependencies:
- requireSameNode: true
labels:
application: neutron
component: neutron-sriov-agent
component: neutron-sriov-agent