From nobody Thu Apr 25 16:41:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=uniudc.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543545813722236.96113044142976; Thu, 29 Nov 2018 18:43:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 367673091783; Fri, 30 Nov 2018 02:43:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8C201001F50; Fri, 30 Nov 2018 02:43:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 99BFF27C; Fri, 30 Nov 2018 02:43:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAU2hPwE026403 for ; Thu, 29 Nov 2018 21:43:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 32B2C61520; Fri, 30 Nov 2018 02:43:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2959861544 for ; Fri, 30 Nov 2018 02:43:22 +0000 (UTC) Received: from m176115.mail.qiye.163.com (m176115.mail.qiye.163.com [59.111.176.115]) by mx1.redhat.com (Postfix) with ESMTP id 121263F722 for ; Fri, 30 Nov 2018 02:43:20 +0000 (UTC) Received: from cvknode54.localdomain (unknown [106.37.239.65]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id F235A661239; Fri, 30 Nov 2018 10:43:17 +0800 (CST) From: luzhipeng@uniudc.com To: libvir-list@redhat.com Date: Fri, 30 Nov 2018 10:43:10 +0800 Message-Id: <1543545790-156739-1-git-send-email-luzhipeng@uniudc.com> X-HM-Spam-Status: e1kIGBQJHllBS1VLV1koWUFITzdXWS1ZQUlXWQkOFx4IWUFZMjUtOjcyP0 FLVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NCo6Iww6NzkVIywINTQ8F00N Q1YwCUJVSlVKTk9ITk9OTEJDSE1OVTMWGhIXVRcOARMSCx4VHDsOFRIOHxhVGBQWRVlXWRILWUFZ SktNVUhMVUlIQlVNTllXWQgBWUFPTUNMNwY+ X-HM-Tid: 0a67627fbdf69373kuwsf235a661239 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 30 Nov 2018 02:43:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 30 Nov 2018 02:43:21 +0000 (UTC) for IP:'59.111.176.115' DOMAIN:'m176115.mail.qiye.163.com' HELO:'m176115.mail.qiye.163.com' FROM:'luzhipeng@uniudc.com' RCPT:'' X-RedHat-Spam-Score: -0.011 (RCVD_IN_DNSWL_NONE, SPF_PASS) 59.111.176.115 m176115.mail.qiye.163.com 59.111.176.115 m176115.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: ZhiPeng Lu Subject: [libvirt] [PATCH v2] openvswitch: Add new port VLAN mode "dot1q-tunnel" X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 30 Nov 2018 02:43:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: ZhiPeng Lu Signed-off-by: ZhiPeng Lu --- v1->v2: 1. Fix "make syntax-check" failure docs/formatnetwork.html.in | 17 +++++++++-------- docs/schemas/networkcommon.rng | 1 + src/conf/netdev_vlan_conf.c | 2 +- src/util/virnetdevopenvswitch.c | 5 +++++ src/util/virnetdevvlan.h | 1 + 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in index 363a72b..3c1ae62 100644 --- a/docs/formatnetwork.html.in +++ b/docs/formatnetwork.html.in @@ -688,16 +688,17 @@

For network connections using Open vSwitch it is also possible - to configure 'native-tagged' and 'native-untagged' VLAN modes + to configure 'native-tagged' and 'native-untagged' and 'dot1q-tunnel' + VLAN modes. Since 1.1.0. This is done with the - optional nativeMode attribute on - the <tag> subelement: nativeMode - may be set to 'tagged' or 'untagged'. The id - attribute of the <tag> subelement - containing nativeMode sets which VLAN is considered - to be the "native" VLAN for this interface, and + optional nativeMode attribute on the + <tag> subelement: nativeMode + may be set to 'tagged' or 'untagged' or 'dot1q-tunnel'. + The id attribute of the <tag> + subelement containing nativeMode sets which VLAN is + considered to be the "native" VLAN for this interface, and the nativeMode attribute determines whether or not - traffic for that VLAN will be tagged. + traffic for that VLAN will be tagged or QinQ.

<vlan> elements can also be specified in diff --git a/docs/schemas/networkcommon.rng b/docs/schemas/networkcommon.rng index 2699555..11c48ff 100644 --- a/docs/schemas/networkcommon.rng +++ b/docs/schemas/networkcommon.rng @@ -223,6 +223,7 @@ tagged untagged + dot1q-tunnel diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c index dff49c6..79710d9 100644 --- a/src/conf/netdev_vlan_conf.c +++ b/src/conf/netdev_vlan_conf.c @@ -29,7 +29,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE =20 VIR_ENUM_IMPL(virNativeVlanMode, VIR_NATIVE_VLAN_MODE_LAST, - "default", "tagged", "untagged") + "default", "tagged", "untagged", "dot1q-tunnel") =20 int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlan= Ptr def) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index 8fe06fd..ba5e333 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -91,6 +91,11 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, vi= rNetDevVlanPtr virtVlan) virCommandAddArg(cmd, "vlan_mode=3Dnative-untagged"); virCommandAddArgFormat(cmd, "tag=3D%d", virtVlan->nativeTag); break; + case VIR_NATIVE_VLAN_MODE_DOT1Q_TUNNEL: + virCommandAddArg(cmd, "vlan_mode=3Ddot1q-tunnel"); + virCommandAddArg(cmd, "other_config:qinq-ethtype=3D802.1q"); + virCommandAddArgFormat(cmd, "tag=3D%d", virtVlan->nativeTag); + break; case VIR_NATIVE_VLAN_MODE_DEFAULT: default: break; diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index be85f59..0667f9d 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -29,6 +29,7 @@ typedef enum { VIR_NATIVE_VLAN_MODE_DEFAULT =3D 0, VIR_NATIVE_VLAN_MODE_TAGGED, VIR_NATIVE_VLAN_MODE_UNTAGGED, + VIR_NATIVE_VLAN_MODE_DOT1Q_TUNNEL, =20 VIR_NATIVE_VLAN_MODE_LAST } virNativeVlanMode; --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list