[ovs-dev] [RFC] rhel/ifup: support vhost-user client mode

Aaron Conole aconole at redhat.com
Mon Feb 6 19:29:00 UTC 2017


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 <aconole at redhat.com>
---
NOTE: I haven't tested this yet.  I'll submit formally once I do.

 rhel/README.RHEL.rst                        |  9 +++++++++
 rhel/etc_sysconfig_network-scripts_ifup-ovs | 10 +++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
index afccf17..8d57cb2 100644
--- a/rhel/README.RHEL.rst
+++ b/rhel/README.RHEL.rst
@@ -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
 ----
 
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index e49e6fe..aabcca0 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -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="-- set Interface $DEVICE 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
-- 
2.9.3



More information about the dev mailing list