From patchwork Mon Sep 13 14:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12489743 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A87BC433EF for ; Mon, 13 Sep 2021 15:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5917760249 for ; Mon, 13 Sep 2021 15:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242298AbhIMPfn (ORCPT ); Mon, 13 Sep 2021 11:35:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237922AbhIMPf2 (ORCPT ); Mon, 13 Sep 2021 11:35:28 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82D6C028BEC for ; Mon, 13 Sep 2021 07:45:40 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id s10so21623203lfr.11 for ; Mon, 13 Sep 2021 07:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rl1GbWjgXVNoK+lm+llrr8EUhw0/WxVcLR5JyBH74Jo=; b=fvBbLhTmvrjsv6008yISDXLZ8bxvuq5Z1YRK4b1wu4yXmtYLvjZ9CGr56IRUKVrmIx mMtElrRHZm3wGcUpt2R4A3VF5h2XPGB1g5B6BmWI5cYnuITAfKcJWFjTcBFmAPFW7f2b CwOKS4ePguXVXeQQ5tynnbWphorBjrAEIjK2puk+y1LaN7adH1pyF+aWQ7jwRaQhddSG zEMt8E7W1CN7ffpdZ58+Oc3RisSTL2UlUsSvcg84m5pBeZn6wAOT/GooLEWC3RgG+l1G /ZwH6ufgsO7DsYGYvrKOfIGF7cuA8qSU7zk2BMCi2uDonxxeYJSp6XvK3/xjw39MMAay aa7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rl1GbWjgXVNoK+lm+llrr8EUhw0/WxVcLR5JyBH74Jo=; b=kaGKjiRT7n4P0FbAf8NAKYUxbSY7r5q9Oy+fhdhPf9SJZqk7nwF73Li4ZQKyg+Eyf2 qob4pWiNXqFnjRnM3Cxt2r8gXoaPqx4PXAW/Xlc83lpMpRAAr3GymQqpfe6cq8CfW0J2 s7hZG+7prcObAbLuEcxEAyVkk+Uazxyx7R9oCfuV6brugBCCRvsSfFKGcxj3azknW9Y2 8JllMHeUugIWlkBKy0Z8Dw4GSkF7TYk1TL6zNp/Wh+K1QNg/RKmy9zfGbgi57ysgY4C9 4TY8oT9O0FytJ6LO4vf4qaiOstwr0vlxgZs2VjjJLr85hnvlY4wkixXh7UX4HnRaNlsv 7BKA== X-Gm-Message-State: AOAM5321HeIpE8MzslxAPMrP59c6Vt6fNL+1ZDHE/6cl3LlRwK7hXXTx Y/k7sNs/RJ7xcIlmCvYIIBG5LQ== X-Google-Smtp-Source: ABdhPJzLwuGLabZO/8BJ2sTxI0M0rFUN7MJoZOprsVOV89AFGDQBgaAhglv7057Zv8Ar6xzXMQH5xQ== X-Received: by 2002:ac2:599b:: with SMTP id w27mr9224290lfn.0.1631544337834; Mon, 13 Sep 2021 07:45:37 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id i12sm849825lfb.301.2021.09.13.07.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:45:37 -0700 (PDT) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Linus Walleij , Mauri Sandberg , =?utf-8?q?Alvin_=C5=A0ipraga?= , DENG Qingfang Subject: [PATCH net-next 4/8] net: dsa: rtl8366rb: Always treat VLAN 0 as untagged Date: Mon, 13 Sep 2021 16:42:56 +0200 Message-Id: <20210913144300.1265143-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210913144300.1265143-1-linus.walleij@linaro.org> References: <20210913144300.1265143-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org VLAN 0 shall always be treated as untagged, as per example from other drivers (I guess from the spec). Cc: Vladimir Oltean Cc: Mauri Sandberg Cc: Alvin Šipraga Cc: Florian Fainelli Cc: DENG Qingfang Signed-off-by: Linus Walleij --- ChangeLog v1->v4: - New patch after noting that other drivers always sets VLAN 0 as untagged. --- drivers/net/dsa/rtl8366.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c index 0672dd56c698..fae14c448fe4 100644 --- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -308,6 +308,11 @@ int rtl8366_vlan_add(struct dsa_switch *ds, int port, return -EINVAL; } + /* Note that VLAN 0 shall always be treated as untagged */ + if (vlan->vid == 0) + untagged = true; + + /* Enable VLAN in the hardware * FIXME: what's with this 4k business? * Just rtl8366_enable_vlan() seems inconclusive.