From patchwork Wed Jan 3 14:13:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1881967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=C8EvcZFo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T4sBz1KJlz1ydd for ; Thu, 4 Jan 2024 01:13:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D3EC561032; Wed, 3 Jan 2024 14:13:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D3EC561032 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=C8EvcZFo X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWYoM0B1q4ra; Wed, 3 Jan 2024 14:13:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0D28160AEC; Wed, 3 Jan 2024 14:13:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0D28160AEC Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DD137C0077; Wed, 3 Jan 2024 14:13:26 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A771DC0037 for ; Wed, 3 Jan 2024 14:13:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8217480FAD for ; Wed, 3 Jan 2024 14:13:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8217480FAD Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=C8EvcZFo X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3hbDw4vMeiJ7 for ; Wed, 3 Jan 2024 14:13:24 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6332680E91 for ; Wed, 3 Jan 2024 14:13:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6332680E91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704291202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rnwwg5wC8V3D4eCl7d16JapNxvdTfjdKWJ/0IV4oKmE=; b=C8EvcZFoh682lyICBgnetq6nEBwL4iYOlMz5UMO+dHxoHH9LdxuRwuheYpDyzsVKdQn4dV PudCs/2u05882lZhanoDkIvDBHX+iO5V6AISU7592dF6wbQplwvsTj/ZBLxQGPpcBqFPnT dbUemqRZeoY3Em39Fmqm4+pVd2Afi3Y= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-35-bfofciYQOdq9STqc9GZIYg-1; Wed, 03 Jan 2024 09:13:20 -0500 X-MC-Unique: bfofciYQOdq9STqc9GZIYg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74F4A1C106A1 for ; Wed, 3 Jan 2024 14:13:19 +0000 (UTC) Received: from dceara.remote.csb (unknown [10.39.194.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8A021121306; Wed, 3 Jan 2024 14:13:18 +0000 (UTC) From: Dumitru Ceara To: ovs-dev@openvswitch.org Date: Wed, 3 Jan 2024 15:13:15 +0100 Message-Id: <20240103141315.79510-1-dceara@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] Correct ethtype referencing incorrect values X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Jacob Tanenbaum documentation in OVN-NB in Logical_Switch_Port for Ethtype references incorrect values "Supported values: 802.11q (default), 802.11ad." This should be 802.1q and 802.1ad. Correct this in the code and documentation. For now I logged as a warning that the incorrect value is used and maybe in the future the incorrect value could be removed. Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2023-December/052836.html Fixes: 50f4ea011622 ("Support 802.11ad EthType for localnet ports") Submitted-at: https://github.com/ovn-org/ovn/pull/229 Signed-off-by: Jacob Tanenbaum Signed-off-by: Dumitru Ceara --- controller/physical.c | 25 ++++++++++++++++++------- ovn-nb.xml | 2 +- tests/ovn.at | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/controller/physical.c b/controller/physical.c index ba88e1d8b4..eda0854410 100644 --- a/controller/physical.c +++ b/controller/physical.c @@ -703,22 +703,33 @@ put_replace_chassis_mac_flows(const struct simap *ct_zones, } } -#define VLAN_80211AD_ETHTYPE 0x88a8 -#define VLAN_80211Q_ETHTYPE 0x8100 +#define VLAN_8021AD_ETHTYPE 0x88a8 +#define VLAN_8021Q_ETHTYPE 0x8100 static void ofpact_put_push_vlan(struct ofpbuf *ofpacts, const struct smap *options, int tag) { const char *ethtype_opt = options ? smap_get(options, "ethtype") : NULL; - int ethtype = VLAN_80211Q_ETHTYPE; + int ethtype = VLAN_8021Q_ETHTYPE; if (ethtype_opt) { - if (!strcasecmp(ethtype_opt, "802.11ad")) { - ethtype = VLAN_80211AD_ETHTYPE; - } else if (strcasecmp(ethtype_opt, "802.11q")) { + if (!strcasecmp(ethtype_opt, "802.11ad") + || !strcasecmp(ethtype_opt, "802.1ad")) { + ethtype = VLAN_8021AD_ETHTYPE; + } else if (!strcasecmp(ethtype_opt, "802.11q") + || !strcasecmp(ethtype_opt, "802.1q")) { + ethtype = VLAN_8021Q_ETHTYPE; + } else { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); VLOG_WARN_RL(&rl, "Unknown port ethtype: %s", ethtype_opt); - } + } + if (!strcasecmp(ethtype_opt, "802.11ad") + || !strcasecmp(ethtype_opt, "802.11q")) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); + VLOG_WARN_RL(&rl, "Using incorrect value ethtype: %s for either " + "802.1q or 802.1ad please correct this value", + ethtype_opt); + } } struct ofpact_push_vlan *push_vlan; diff --git a/ovn-nb.xml b/ovn-nb.xml index 46ff735a96..b2913bdd7a 100644 --- a/ovn-nb.xml +++ b/ovn-nb.xml @@ -1124,7 +1124,7 @@ Optional. VLAN EtherType field value for encapsulating VLAN - headers. Supported values: 802.11q (default), 802.11ad. + headers. Supported values: 802.1q (default), 802.1ad.