Add support to set ovs module log level
Change-Id: I1fcd5b49cb2af4c76ed32b332f83ca8fa783a3c6
This commit is contained in:
parent
34a7533b64
commit
03a43cb91e
@ -338,6 +338,20 @@ function process_dpdk_bonds {
|
|||||||
done < "/tmp/bonds_array"
|
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 {
|
function get_driver_by_address {
|
||||||
if [[ -e /sys/bus/pci/devices/$1/driver ]]; then
|
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]}')
|
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
|
init_ovs_dpdk_bridges
|
||||||
process_dpdk_nics
|
process_dpdk_nics
|
||||||
process_dpdk_bonds
|
process_dpdk_bonds
|
||||||
|
set_dpdk_module_log_level
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
|
# 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
|
if [[ "${bridge_name}" == "${tunnel_interface}" ]]; then
|
||||||
# Route the tunnel traffic via the physical bridge
|
# Route the tunnel traffic via the physical bridge
|
||||||
if [[ -n "${LOCAL_IP}" && -n "${PREFIX}" ]]; then
|
if [[ -n "${LOCAL_IP}" && -n "${PREFIX}" ]]; then
|
||||||
if [[ -n $(ovs-appctl ovs/route/show | grep "${LOCAL_IP}") ]]; then
|
if [[ -n $(ovs-appctl -t ${OVS_CTL} ovs/route/show | grep "${LOCAL_IP}") ]]; then
|
||||||
ovs-appctl ovs/route/del "${LOCAL_IP}"/"${PREFIX}"
|
ovs-appctl -t ${OVS_CTL} ovs/route/del "${LOCAL_IP}"/"${PREFIX}"
|
||||||
fi
|
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 [[ -n "${tunnel_underlay_vlan}" ]]; then
|
||||||
# If there is not tunnel network gateway, exit
|
# If there is not tunnel network gateway, exit
|
||||||
|
@ -1698,6 +1698,7 @@ conf:
|
|||||||
ovs-vsctl: CommandFilter, ovs-vsctl, root
|
ovs-vsctl: CommandFilter, ovs-vsctl, root
|
||||||
# NOTE(yamamoto): of_interface=native doesn't use ovs-ofctl
|
# NOTE(yamamoto): of_interface=native doesn't use ovs-ofctl
|
||||||
ovs-ofctl: CommandFilter, ovs-ofctl, root
|
ovs-ofctl: CommandFilter, ovs-ofctl, root
|
||||||
|
ovs-appctl: CommandFilter, ovs-appctl, root
|
||||||
kill_ovsdb_client: KillFilter, root, /usr/bin/ovsdb-client, -9
|
kill_ovsdb_client: KillFilter, root, /usr/bin/ovsdb-client, -9
|
||||||
ovsdb-client: CommandFilter, ovsdb-client, root
|
ovsdb-client: CommandFilter, ovsdb-client, root
|
||||||
xe: CommandFilter, xe, root
|
xe: CommandFilter, xe, root
|
||||||
@ -2100,6 +2101,13 @@ conf:
|
|||||||
# # used with ovs-dpdk. In which case pci_id of PF must be
|
# # used with ovs-dpdk. In which case pci_id of PF must be
|
||||||
# # provided above.
|
# # provided above.
|
||||||
# # vf_index: 0
|
# # 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
|
# Names of secrets used by bootstrap and environmental checks
|
||||||
secrets:
|
secrets:
|
||||||
|
@ -75,6 +75,10 @@ conf:
|
|||||||
vf_index: 0
|
vf_index: 0
|
||||||
bridges:
|
bridges:
|
||||||
- name: br-phy-bond0
|
- name: br-phy-bond0
|
||||||
|
modules:
|
||||||
|
- name: dpdk
|
||||||
|
log_level: info
|
||||||
|
|
||||||
# In case of shared profile (sriov + ovs-dpdk), sriov agent should finish
|
# 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
|
# first so as to let it configure the SRIOV VFs before ovs-agent tries to
|
||||||
# bind it with DPDK driver.
|
# bind it with DPDK driver.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user