--- /dev/null
+SRIOV_AGENT_CONF="${Q_PLUGIN_CONF_PATH}/sriov_agent.ini"
+SRIOV_AGENT_BINARY="${NEUTRON_BIN_DIR}/neutron-sriov-nic-agent"
+
+function configure_l2_agent_sriovnicswitch {
+ if [[ -n "$PHYSICAL_NETWORK" ]] && [[ -n "$PHYSICAL_INTERFACE" ]]; then
+ PHYSICAL_DEVICE_MAPPINGS=$PHYSICAL_NETWORK:$PHYSICAL_INTERFACE
+ fi
+ if [[ -n "$PHYSICAL_DEVICE_MAPPINGS" ]]; then
+ iniset /$SRIOV_AGENT_CONF sriov_nic physical_device_mappings $PHYSICAL_DEVICE_MAPPINGS
+ fi
+
+ iniset /$SRIOV_AGENT_CONF securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
+
+ iniset /$SRIOV_AGENT_CONF agent extensions "$L2_AGENT_EXTENSIONS"
+}
+
+function start_l2_agent_sriov {
+ run_process q-sriov-agt "$SRIOV_AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$SRIOV_AGENT_CONF"
+}
+
+function stop_l2_agent_sriov {
+ stop_process q-sriov-agt
+}
+source $LIBDIR/ml2_drivers/sriovnicswitch
+
+
function enable_ml2_extension_driver {
local extension_driver=$1
if [[ -z "$Q_ML2_PLUGIN_EXT_DRIVERS" ]]; then
function configure_qos_ml2 {
enable_ml2_extension_driver "qos"
}
+
+
+function configure_ml2 {
+ OIFS=$IFS;
+ IFS=",";
+ mechanism_drivers_array=($Q_ML2_PLUGIN_MECHANISM_DRIVERS);
+ IFS=$OIFS;
+ for mechanism_driver in "${mechanism_drivers_array[@]}"; do
+ if [ "$(type -t configure_ml2_$mechanism_driver)" = function ]; then
+ configure_ml2_$mechanism_driver
+ fi
+ done
+}
\ No newline at end of file
--- /dev/null
+function configure_ml2_sriovnicswitch {
+ iniset /$Q_PLUGIN_CONF_FILE ml2_sriov agent_required True
+}
\ No newline at end of file
LIBDIR=$DEST/neutron/devstack/lib
source $LIBDIR/l2_agent
+source $LIBDIR/l2_agent_sriovnicswitch
source $LIBDIR/ml2
source $LIBDIR/qos
if is_service_enabled q-agt; then
configure_l2_agent
fi
+ #Note: sriov agent should run with OVS or linux bridge agent
+ #because they are the mechanisms that bind the DHCP and router ports.
+ #Currently devstack lacks the option to run two agents on the same node.
+ #Therefore we create new service, q-sriov-agt, and the q-agt should be OVS
+ #or linux bridge.
+ if is_service_enabled q-sriov-agt; then
+ configure_$Q_PLUGIN
+ configure_l2_agent
+ configure_l2_agent_sriovnicswitch
+ fi
fi
+
+if [[ "$1" == "stack" && "$2" == "extra" ]]; then
+ if is_service_enabled q-sriov-agt; then
+ start_l2_agent_sriov
+ fi
+fi
+
+if [[ "$1" == "unstack" ]]; then
+ if is_service_enabled q-sriov-agt; then
+ stop_l2_agent_sriov
+ fi
+fi
\ No newline at end of file