From nobody Fri Nov 22 23:43:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=solinno.co.uk ARC-Seal: i=1; a=rsa-sha256; t=1715857028; cv=none; d=zohomail.com; s=zohoarc; b=kvOLffqdl0qukQJZOCUtEi1x2IgUHvjr9KQQd5B+DrGFNH9lD+w7LLw8ErNqySUEO1TUjCpKD4OcnFHZr+YmUxF8hzIXQK/EGEfo2DgbUYodKm6UGliXpS8vl2fz68N2lrcptZfOj9VFEPsBKBfMJ26Y8+95Is/aFZ+Cul5y4pw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715857028; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=P/yZOFAHN5M3gV0kLUga/CsGI2aHJ6UoTvkzJwPwFFs=; b=EJcjx77HLmnzb6Ov2iNbaABqDuGaXIZ3a4ZWfwNcONOe8XEbPK+dJUbLeWY9vQqiCPkRu8N+xrWAjOOCfDCm8eZ1NGyLcUitevRxf5LgOMyQfHbTkIVDROnjtO4WTL+UsGGwVLdvVDNYr2THS+tNX2SDseVtSIkWMZd8UY+rJnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1715857028645414.98092548311433; Thu, 16 May 2024 03:57:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.723125.1127693 (Exim 4.92) (envelope-from ) id 1s7Yn4-0007y0-KM; Thu, 16 May 2024 10:56:50 +0000 Received: by outflank-mailman (output) from mailman id 723125.1127693; Thu, 16 May 2024 10:56:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s7Yn4-0007xX-DH; Thu, 16 May 2024 10:56:50 +0000 Received: by outflank-mailman (input) for mailman id 723125; Thu, 16 May 2024 10:56:48 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s7Yn2-0007XN-ML for xen-devel@lists.xenproject.org; Thu, 16 May 2024 10:56:48 +0000 Received: from doppler.solinno.uk (doppler.solinno.uk [81.2.106.178]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fdaeafff-1372-11ef-909d-e314d9c70b13; Thu, 16 May 2024 12:56:48 +0200 (CEST) Received: from folly.solinno.co.uk (folly.dyn.solinno.co.uk [192.168.2.135]) by doppler.solinno.uk (Postfix) with ESMTPSA id 5B26B8009E; Thu, 16 May 2024 11:56:47 +0100 (BST) Received: by folly.solinno.co.uk (Postfix, from userid 1000) id 32D1520189; Thu, 16 May 2024 11:56:47 +0100 (BST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fdaeafff-1372-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=solinno.co.uk; s=mail; t=1715857007; bh=0RL/5syMYmKDu7gc+zffZXfng7BleYOM9Jn0BEO2t7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eryxgq4RS00dz0XWpf0ry83hU9EsoIJaowHO9dpyp+xEGYa6C9J2Ecl9oDNTtbwIo P1U3pu3D62zCQ5M0OF1oMg5ooOavCYPITm9RDL5jsfvS36j3W6oYUQDRGajMGODqcf 8edB1TFYEXpuoPDcMs2HG7sjurrrUzaI7jfx/L1Y= From: Leigh Brown To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Anthony Perard , Jason Andryuk , Leigh Brown Subject: [PATCH v3 2/4] tools/xl: add vlan keyword to vif option Date: Thu, 16 May 2024 11:56:10 +0100 Message-Id: <20240516105612.15306-3-leigh@solinno.co.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240516105612.15306-1-leigh@solinno.co.uk> References: <20240516105612.15306-1-leigh@solinno.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @solinno.co.uk) X-ZM-MESSAGEID: 1715857030265100005 Content-Type: text/plain; charset="utf-8" Update parse_nic_config() to support a new `vlan' keyword. This keyword specifies the VLAN configuration to assign to the VIF when attaching it to the bridge port, on operating systems that support the capability (e.g. Linux). The vlan keyword will allow one or more VLANs to be configured on the VIF when adding it to the bridge port. This will be done by the vif-bridge script and functions. Document the new `vlan' keyword in xl-network-configuration(5). Signed-off-by: Leigh Brown Reviewed-by: Jason Andryuk --- docs/man/xl-network-configuration.5.pod.in | 38 ++++++++++++++++++++++ tools/xl/xl_parse.c | 2 ++ 2 files changed, 40 insertions(+) diff --git a/docs/man/xl-network-configuration.5.pod.in b/docs/man/xl-netwo= rk-configuration.5.pod.in index f3e379bcf8..dfc35e72c6 100644 --- a/docs/man/xl-network-configuration.5.pod.in +++ b/docs/man/xl-network-configuration.5.pod.in @@ -259,6 +259,44 @@ Specifies the MTU (i.e. the maximum size of an IP payl= oad, exclusing headers). T default value is 1500 but, if the VIF is attached to a bridge, it will be = set to match unless overridden by this parameter. =20 +=3Dhead2 vlan + +Specifies the VLAN configuration. The format of this parameter is one or m= ore +VLAN IDs or ranges separated by forward slashes. Each term can be: + +=3Dover + +=3Ditem * + +B - a single VLAN ID in the range 1 to 4094. This can optionally fol= lowed +by a B

to indicate the PVID or by a B to indicate an untagged VLAN. = C

+implies B. + +=3Ditem * + +B-B - a range of VLAN IDs from B to B, both be= tween +1 and 4094 and B being less than or equal to B. This can be +optionally followed by a B to indicate that the range of VLANs are unta= gged. + +=3Ditem * + +B+BxB - describing a range of VLAN IDs starting at B<= vlan> +with B additional entries, each incremented by B. This can = be=20 +optionally followed by a B to indicate that the range of VLANs are unta= gged. + +=3Dback + +Note, one VLAN ID must be marked as the PVID. In the case of a vlan=20 +specification consisting of a single VLAN ID (e.g. C), the B

= suffix +may be omitted. Specifying more than one untagged VLAN ID is an advanced=20 +configuration - use with caution. + +For example: + + 'vlan=3D10' -- meaning a single VLAN that is the PVID. + 'vlan=3D10p/20' -- VLAN 10 is the PVID and VLAN 20 is tagged. + 'vlan=3D10p/100+10x4' -- VLANs 10, 100, 110, 120, 130, 140, 150. + =3Dhead2 trusted / untrusted =20 An advisory setting for the frontend driver on whether the backend should = be diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index ed983200c3..7546fe7e7a 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -565,6 +565,8 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config = **config, char *token) nic->devid =3D parse_ulong(oparg); } else if (MATCH_OPTION("mtu", token, oparg)) { nic->mtu =3D parse_ulong(oparg); + } else if (MATCH_OPTION("vlan", token, oparg)) { + replace_string(&nic->vlan, oparg); } else if (!strcmp("trusted", token)) { libxl_defbool_set(&nic->trusted, true); } else if (!strcmp("untrusted", token)) { --=20 2.39.2