From patchwork Tue Dec 1 14:48:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Panu Matilainen X-Patchwork-Id: 550916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 46140140216 for ; Wed, 2 Dec 2015 01:48:17 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 242B51058F; Tue, 1 Dec 2015 06:48:16 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 2C55010559 for ; Tue, 1 Dec 2015 06:48:14 -0800 (PST) Received: from bar4.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 57FBB1624A2 for ; Tue, 1 Dec 2015 07:48:13 -0700 (MST) X-ASG-Debug-ID: 1448981292-03dc2160406591a0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar4.cudamail.com with ESMTP id xvSqLvS8jDf9698z (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 01 Dec 2015 07:48:12 -0700 (MST) X-Barracuda-Envelope-From: pmatilai@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 1 Dec 2015 14:54:12 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 848E3C0A8023 for ; Tue, 1 Dec 2015 14:48:10 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org.com (vpn1-6-72.ams2.redhat.com [10.36.6.72]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB1Em98u019387 for ; Tue, 1 Dec 2015 09:48:09 -0500 X-CudaMail-Envelope-Sender: pmatilai@redhat.com From: Panu Matilainen To: dev@openvswitch.org X-CudaMail-MID: CM-V3-1130017359 X-CudaMail-DTE: 120115 X-CudaMail-Originating-IP: 209.132.183.28 Date: Tue, 1 Dec 2015 16:48:04 +0200 X-ASG-Orig-Subj: [##CM-V3-1130017359##][PATCH] rhel: Add support DPDK port creation via network scripts Message-Id: <619ba4004a3c0380f54dc434ca7a1b9f895fd857.1448981284.git.pmatilai@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1448981292 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.24878 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] rhel: Add support DPDK port creation via network scripts X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Add support for creating a userspace bridge and the four DPDK port types via network scripts + basic documentation. Signed-off-by: Panu Matilainen Acked-by: Aaron Conole Acked-by: Flavio Leitner --- rhel/README.RHEL | 43 +++++++++++++++++++++++++++ rhel/etc_sysconfig_network-scripts_ifdown-ovs | 5 +++- rhel/etc_sysconfig_network-scripts_ifup-ovs | 24 +++++++++++++-- 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/rhel/README.RHEL b/rhel/README.RHEL index 2620674..54c1b44 100644 --- a/rhel/README.RHEL +++ b/rhel/README.RHEL @@ -27,6 +27,19 @@ assignments. The following OVS-specific variable names are supported: * "OVSPatchPort", if is a patch port + Additionally the following DPDK port types may be available, + depends on OVS build- and runtime configuration: + + * "OVSDPDKPort", if is a physical DPDK NIC port (name + must start with "dpdk" and end with portid, eg "dpdk0") + + * "OVSDPDKRPort", if is a DPDK ring port (name must + start with dpdkr and end with portid, eg "dpdkr0") + + * "OVSDPDKVhostPort" if is a DPDK vhost-cuse port + + * "OVSDPDKVhostUserPort" if is a DPDK vhost-user port + - OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to the name of the OVS bridge to which the port should be attached. @@ -206,6 +219,36 @@ TYPE=OVSPatchPort OVS_BRIDGE=ovsbridge1 OVS_PATCH_PEER=patch-ovs-0 +User bridge: + +==> ifcfg-obr0 <== + +DEVICE=obr0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSUserBridge +BOOTPROTO=static +IPADDR=A.B.C.D +NETMASK=X.Y.Z.0 +HOTPLUG=no + +DPDK NIC port: + +==> ifcfg-dpdk0 <== + +DPDK vhost-user port: +DEVICE=dpdk0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSDPDKPort +OVS_BRIDGE=obr0 + +==> ifcfg-vhu0 <== +DEVICE=vhu0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSDPDKVhostUserPort +OVS_BRIDGE=obr0 Reporting Bugs -------------- diff --git a/rhel/etc_sysconfig_network-scripts_ifdown-ovs b/rhel/etc_sysconfig_network-scripts_ifdown-ovs index 5f78f9c..46b6ca5 100755 --- a/rhel/etc_sysconfig_network-scripts_ifdown-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifdown-ovs @@ -46,7 +46,7 @@ else fi case "$TYPE" in - OVSBridge) + OVSBridge|OVSUserBridge) ${OTHERSCRIPT} ${CONFIG} $2 retval=$? ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE" @@ -59,6 +59,9 @@ case "$TYPE" in OVSPatchPort|OVSTunnel) ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" ;; + OVSDPDKPort|OVSDPDKRPort|OVSDPDKVhostPort|OVSDPDKVhostUserPort) + ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" + ;; *) echo $"Invalid OVS interface type $TYPE" exit 1 diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index 478c5c3..f3fc05e 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -72,15 +72,19 @@ else fi case "$TYPE" in - OVSBridge) + OVSBridge|OVSUserBridge) # If bridge already exists and is up, it has been configured through # other cases like OVSPort, OVSIntPort and OVSBond. If it is down or # it does not exist, create it. It is possible for a bridge to exist # because it remained in the OVSDB for some reason, but it won't be up. + if [ "${TYPE}" = "OVSUserBridge" ]; then + DATAPATH="netdev" + fi if check_device_down "${DEVICE}"; then ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS \ ${OVS_EXTRA+-- $OVS_EXTRA} \ - ${STP+-- set bridge "$DEVICE" stp_enable="${STP}"} + ${STP+-- set bridge "$DEVICE" stp_enable="${STP}"} \ + ${DATAPATH+-- set bridge "$DEVICE" datapath_type="$DATAPATH"} else OVSBRIDGECONFIGURED="yes" fi @@ -150,6 +154,22 @@ case "$TYPE" in ifup_ovs_bridge ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=patch options:peer="${OVS_PATCH_PEER}" ${OVS_EXTRA+-- $OVS_EXTRA} ;; + OVSDPDKPort) + ifup_ovs_bridge + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA} + ;; + OVSDPDKRPort) + ifup_ovs_bridge + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=dpdkr ${OVS_EXTRA+-- $OVS_EXTRA} + ;; + OVSDPDVhostPort) + ifup_ovs_bridge + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=dpdkvhost ${OVS_EXTRA+-- $OVS_EXTRA} + ;; + OVSDPDKVhostUserPort) + ifup_ovs_bridge + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=dpdkvhostuser ${OVS_EXTRA+-- $OVS_EXTRA} + ;; *) echo $"Invalid OVS interface type $TYPE" exit 1