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: 509792 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp668865jao; Mon, 13 Sep 2021 08:34:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxObstdazf5LQ799Zh/a95umndBZpBYa2ho7AWLUw6oi4H2MPceE75r7M04YNKwGtdVe6Ln X-Received: by 2002:a17:906:f11:: with SMTP id z17mr13550826eji.385.1631547268623; Mon, 13 Sep 2021 08:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631547268; cv=none; d=google.com; s=arc-20160816; b=CZHUkq5I+MH88hzjTixVavcFtT2bnIWEaMskSucV8NOJUBlSMFFiMH4CfwSqjPo2Gs 38pS1QHx1IK0745qMeGxzfPSAujx6NSnpWKf7tHaNQd1S4yZcxkBT54SiHsPjQIqFqyA Iru8rr+fpSHBv38jg5npIFbdupsvP0YhjGgRcpACwgp7Ej/8nOiwBe3eqwo7dQp0qB6/ qSLZyjS47AVM5J+5J3FqS0d6uPlPDySG20L9xX6BIkXurbbjtuwv8dVkz6ftsydU9m2y hEBhKZ4hWlCSnRTqP5fMDRdMbaqJciYlrKutWTdof1W/ZwtS2m8/Gv8yqgncTeOLzAaj DtHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rl1GbWjgXVNoK+lm+llrr8EUhw0/WxVcLR5JyBH74Jo=; b=vH0ZMwj2F+sMifZtlvBvH+7Zk5qp9+HDjtmH3xjq9MdAIE0YqCPPQ89CWffKuEFC94 nvbZy2tV/dIrH37+Awx3aqzSd/PetZXYfOOSt16CFKcL3mEy8pGjykYzIWEGBxM55JlY l++2Xgu5jVyo0mSuqisJ0ikVjAD1Qoh9UCsLSkhOcSNX2GsD9FmZ30oivado0PEnsxfq 6SxbCRVFLojDs2ufaMDz6aWEEnehCHaaHi9blCQiR6CIEsgBPFVB1z1Z0VTck2IfQ+P1 Mspg2+AsUoasz55bKmLLbqawSE6mPzFJ6PW++lcPUb3AUwx8nOQUoOEMZrtamedN8MCR 93tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvBbLhTm; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si7844974eji.452.2021.09.13.08.34.28; Mon, 13 Sep 2021 08:34:28 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvBbLhTm; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242298AbhIMPfn (ORCPT + 8 others); 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-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 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(+) -- 2.31.1 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.