Skip to content

Commit

Permalink
rhel/ifup: support vhost-user client mode
Browse files Browse the repository at this point in the history
This adds support for ifup to configure client-mode sockets by exposing
two new variables $OVS_PORT_MODE and $OVS_PORT_PATH to the ifcfg
scripts.  When OVS_PORT_MODE is set to 'client', the OVS_PORT_PATH will
be passed as the vhost-server-path option.

No change is needed to ifdown because the OVSDPDKVhostUserPort type
already has an appropriate entry.

Signed-off-by: Aaron Conole <[email protected]>
Signed-off-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
apconole authored and ddiproietto committed Feb 10, 2017
1 parent 389e90e commit d46b603
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions rhel/README.RHEL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ OVS_PATCH_PEER
For "OVSPatchPort" devices, this field specifies the patch's peer on the
other bridge.

OVS_PORT_MODE
For "OVSDPDKVhostUserPort" devices, this field can be set to "client" which
indicates that the port will be used in client mode.

OVS_PORT_PATH
For "OVSDPDKVhostUserPort" devices, this field specifies the path to the
vhost-user server socket. It will only be used if OVS_PORT_MODE is set to
"client".

Note
----

Expand Down
10 changes: 9 additions & 1 deletion rhel/etc_sysconfig_network-scripts_ifup-ovs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,18 @@ case "$TYPE" in
;;
OVSDPDKVhostUserPort)
ifup_ovs_bridge
PORT_TYPE="dpdkvhostuser"
PORT_PATH=""
if [ "$OVS_PORT_MODE" == "client" ]; then
PORT_TYPE="dpdkvhostuserclient"
PORT_PATH="options:vhost-server-path=${OVS_PORT_PATH}"
fi
ovs-vsctl -t ${TIMEOUT} \
-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
-- set Interface "$DEVICE" type=dpdkvhostuser ${OVS_EXTRA+-- $OVS_EXTRA}
-- set Interface "$DEVICE" type=$PORT_TYPE \
$PORT_PATH \
${OVS_EXTRA+-- $OVS_EXTRA}
;;
OVSDPDKBond)
ifup_ovs_bridge
Expand Down

0 comments on commit d46b603

Please sign in to comment.