Skip to content

Commit

Permalink
DPDK: Bond mode set incorrectly after upgrade
Browse files Browse the repository at this point in the history
Don't fetch bonding info from /proc/net/bonding if the dpdk.ini file
is already setup with the required bonding information.

Change-Id: Ie8341b97597082a5829cee9ba70c5c1af9c11dc1
Closes-Bug: 1625938
  • Loading branch information
kirankn80 committed Nov 4, 2016
1 parent 3830269 commit be8fc0e
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions common/control_files/vrouter-functions.sh
Expand Up @@ -332,26 +332,29 @@ _dpdk_system_bond_info_collect() {
_dpdk_vrouter_ini_update() {
_dpdk_system_bond_info_collect

## update virtual device (bond) configuration
dpdk_vdev=""
if [ -n "${DPDK_BOND_MODE}" -a -n "${DPDK_BOND_NUMA}" ]; then
echo "${0##*/}: updating bonding configuration in ${VROUTER_DPDK_INI}..."

dpdk_vdev=" --vdev \"eth_bond_${DPDK_PHY},mode=${DPDK_BOND_MODE}"
dpdk_vdev="${dpdk_vdev},xmit_policy=${DPDK_BOND_POLICY}"
dpdk_vdev="${dpdk_vdev},socket_id=${DPDK_BOND_NUMA},mac=${DPDK_BOND_MAC}"
for SLAVE in ${DPDK_BOND_PCIS}; do
dpdk_vdev="${dpdk_vdev},slave=${SLAVE}"
done
dpdk_vdev="${dpdk_vdev}\""
fi
## always update the ini file, so we remove vdev argument
## whenever Linux configuration has changed
sed -ri.bak \
-e 's/(^ *command *=.*vrouter-dpdk.*) (--vdev +\"[^"]+\"|--vdev +[^ ]+)(.*) *$/\1\3/' \
-e 's/(^ *command *=.*vrouter-dpdk.*) (--vdev +\"[^"]+\"|--vdev +[^ ]+)(.*) *$/\1\3/' \
-e "s/(^ *command *=.*vrouter-dpdk.*)/\\1${dpdk_vdev}/" \
${VROUTER_DPDK_INI}
## update virtual device (bond) configuration if needed
cat ${VROUTER_DPDK_INI} | grep "\-\-vdev"
if [ $? -ne 0 ];
then
dpdk_vdev=""
if [ -n "${DPDK_BOND_MODE}" -a -n "${DPDK_BOND_NUMA}" ]; then
echo "${0##*/}: updating bonding configuration in ${VROUTER_DPDK_INI}..."

dpdk_vdev=" --vdev \"eth_bond_${DPDK_PHY},mode=${DPDK_BOND_MODE}"
dpdk_vdev="${dpdk_vdev},xmit_policy=${DPDK_BOND_POLICY}"
dpdk_vdev="${dpdk_vdev},socket_id=${DPDK_BOND_NUMA},mac=${DPDK_BOND_MAC}"
for SLAVE in ${DPDK_BOND_PCIS}; do
dpdk_vdev="${dpdk_vdev},slave=${SLAVE}"
done
dpdk_vdev="${dpdk_vdev}\""
fi
## update the --vdev string if it does not exist
sed -ri.bak \
-e 's/(^ *command *=.*vrouter-dpdk.*) (--vdev +\"[^"]+\"|--vdev +[^ ]+)(.*) *$/\1\3/' \
-e 's/(^ *command *=.*vrouter-dpdk.*) (--vdev +\"[^"]+\"|--vdev +[^ ]+)(.*) *$/\1\3/' \
-e "s/(^ *command *=.*vrouter-dpdk.*)/\\1${dpdk_vdev}/" \
${VROUTER_DPDK_INI}
fi


## update VLAN configuration
Expand Down

0 comments on commit be8fc0e

Please sign in to comment.