netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>,
	DENG Qingfang <dqfext@gmail.com>
Subject: [net-next PATCH 5/5] net: dsa: rtl8366: Use top VLANs for default
Date: Tue,  2 Jun 2020 22:54:56 +0200	[thread overview]
Message-ID: <20200602205456.2392024-5-linus.walleij@linaro.org> (raw)
In-Reply-To: <20200602205456.2392024-1-linus.walleij@linaro.org>

The RTL8366 DSA switches will not work unless we set
up a default VLAN for each port. We are currently using
e.g. VLAN 1..6 for a 5-port switch as default VLANs.

This is not very helpful for users, move it to allocate
the top VLANs for default instead, for example on
RTL8366RB there are 16 VLANs so instead of using
VLAN 1..6 as default use VLAN 10..15 so VLAN 1
thru VLAN 9 is available for users.

Cc: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/net/dsa/rtl8366.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c
index 7f0691a6da13..4e7562b41598 100644
--- a/drivers/net/dsa/rtl8366.c
+++ b/drivers/net/dsa/rtl8366.c
@@ -260,8 +260,8 @@ static int rtl8366_set_default_vlan_and_pvid(struct realtek_smi *smi,
 	u16 vid;
 	int ret;
 
-	/* This is the reserved default VLAN for this port */
-	vid = port + 1;
+	/* Use the top VLANs for per-port default VLAN */
+	vid = smi->num_vlan_mc - smi->num_ports + port;
 
 	if (port == smi->cpu_port)
 		/* For the CPU port, make all ports members of this
-- 
2.26.2


  parent reply	other threads:[~2020-06-02 20:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 20:54 [net-next PATCH 1/5] net: dsa: tag_rtl4_a: Implement Realtek 4 byte A tag Linus Walleij
2020-06-02 20:54 ` [net-next PATCH 2/5] net: dsa: rtl8366rb: Support the CPU DSA tag Linus Walleij
2020-06-02 20:54 ` [net-next PATCH 3/5] net: dsa: rtl8366: Split out default VLAN config Linus Walleij
2020-06-02 20:54 ` [net-next PATCH 4/5] net: dsa: rtl8366: VLAN 0 as disable tagging Linus Walleij
2020-06-02 20:54 ` Linus Walleij [this message]
2020-06-03  2:19   ` [net-next PATCH 5/5] net: dsa: rtl8366: Use top VLANs for default DENG Qingfang
2020-06-03  8:33     ` Linus Walleij
2020-06-02 22:48 ` [net-next PATCH 1/5] net: dsa: tag_rtl4_a: Implement Realtek 4 byte A tag David Miller
2020-06-03  8:32   ` Linus Walleij
2020-06-03 13:52 ` Andrew Lunn
2020-06-03 22:01   ` Linus Walleij
2020-06-04  0:54     ` Andrew Lunn
2020-06-04  7:52       ` Linus Walleij
2020-06-04 11:22         ` Vladimir Oltean
2020-06-17  8:06           ` Linus Walleij
2020-06-18  3:17             ` DENG Qingfang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200602205456.2392024-5-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=andrew@lunn.ch \
    --cc=dqfext@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).