From patchwork Mon Jul 6 20:52:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 234891 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp307895ilg; Mon, 6 Jul 2020 13:53:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ+TjlHayQ3ORB2ED9AYiXfun/kCziLuBIvVNKK8Jho+tr7Eb9H2QWvvmf6JRZqrX7Qxxk X-Received: by 2002:a17:906:19c7:: with SMTP id h7mr43653548ejd.403.1594068788687; Mon, 06 Jul 2020 13:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594068788; cv=none; d=google.com; s=arc-20160816; b=We+mTE1bwDY65gv80q4JRiXxTvJQXRmvGBCJf64jAmBXWMQaRDvBTLZjPJ+vjNY9u6 J5bsDzRmSGrqI3YIdj0LxDChZWJAzRmW5+bwtGx2MMb3sr2fquZCqxdQSV8ai+9DRlEf 8lySHiYlZdYcttFFEHixj8a+QT0hhPM0U3dNMxVct4r5snH736Gqy09XXV313OVlixGF 2JDtjTnzQe9JOchLXgMDHQBOB4k7wB461yI9WGsUqObf+iTG7KzC98jQZrdJ9n2fIY4q SNxzn9qhHs9WHXTAFCvR5PdwI5xDbL6+ToU4p820quPyekX2jVUHneiYW//6jg2/n0rq fgnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f4F27NvYH7YHeuYKRHbuc0Pqyyr+0B+jF6d12ClwIkI=; b=QNarXGFSZeD5iMEwJm4w9r2pM8tifROqgZYa0DR/Eu4c84Tqi4Y9do2+vdB728SpKC uvr1LZMOlxMw+UIIWOJnZwx3dawwy0oJfyMI13Mc37rYhjG+9CGegdmEQ3Ya/vKJhgi+ iwI1fLPupEX7oDf71UpfRQ5kJVqEJxLf2llIAbEcb8w7gdjWniRCYIMEc09KkuPURjzL JsFHWCwi+oW5WD6Au/BEd2vW4cQsrMQ2+hDt4InsoYlgnRlKF0PgDcUms8jLVZl+utvJ zvJgDRqmBqo03WWWxl2ZGOT7FU+MFlgjG8RtS/130MkcFXdjnQkSxvCSQzOMF8GH4V4O qHtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lOW1Wg/P"; 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 k2si13319295eds.173.2020.07.06.13.53.08; Mon, 06 Jul 2020 13:53:08 -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="lOW1Wg/P"; 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 S1727104AbgGFUxH (ORCPT + 9 others); Mon, 6 Jul 2020 16:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbgGFUxG (ORCPT ); Mon, 6 Jul 2020 16:53:06 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDEE6C08C5DF for ; Mon, 6 Jul 2020 13:53:05 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id y18so23436667lfh.11 for ; Mon, 06 Jul 2020 13:53:05 -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=f4F27NvYH7YHeuYKRHbuc0Pqyyr+0B+jF6d12ClwIkI=; b=lOW1Wg/PzgJlEH+GqjhrxmTv3li0t626WCwwPoL6jeD55GR1+mIMCvoF8Thzf2T5sK rLJxpMmZ+sS6+PIzU3TwaiH4y+/FQyfsIxPpTXUocUxF0H9/v9NUr670HttAabkNfvfq Yj76IHiRc4an4LNkLTkRaTbpTGOuZQine0yUk25XXrtJHWQaPNoK+grfuhhf2MrHTqx4 cgkgbdoKyM1ZadeGrUWVA4rNcg8A08Uf0fDOhFc8erb0hz3NcckZNUkCX+1vNdFh+bVh ksx6Y7+P0VIRAJ3z1lwgk2WH80GLIadVYwbtWQ5MBXwn8MkUpQrrvSNiLVfcYdPwORwH aA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f4F27NvYH7YHeuYKRHbuc0Pqyyr+0B+jF6d12ClwIkI=; b=kiqE57bGGBnVqpgY65rxQ5FHKhB21zE5GRxz0H2C6g2JxNXT2g3T/4Kn8KNGV4t2cm 1OyAJRvbMdsw6VuYVmyv3wyvGkiFAnUTJpiEQlvXWV3i4LWBsbG3OQobLoJDhuby7SLm bOtpNAtoFL2HzDGJPZP98xzDprTgN9cbzeLsxCT2P5og/n8xuzYVcwlr3SO90VKvl/LL KcU+zlVrCjp+INlgHUju6I9BV87bx6iOO48oQt6IsJVWc15xfNDvVMG6j67F6/az/DDe MIEzym4cawn/KBKKsANLms2Ys0e+5idK3aNYDaItEIrG1JEMxEdWdS/E4eu8+w1drFNq PRlw== X-Gm-Message-State: AOAM530pgodsI+yNgPgMiX24doJkwwMKYAiPgPWWV5itljHNIdlKmrWA 5Fu8qAHpBzTXNorf33EPRJWuSQ== X-Received: by 2002:ac2:5593:: with SMTP id v19mr30767322lfg.43.1594068784389; Mon, 06 Jul 2020 13:53:04 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id t10sm624714ljg.60.2020.07.06.13.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 13:53:03 -0700 (PDT) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org, "David S . Miller" Cc: Linus Walleij , DENG Qingfang , Mauri Sandberg Subject: [net-next PATCH 5/5 v4] net: dsa: rtl8366: Use top VLANs for default Date: Mon, 6 Jul 2020 22:52:45 +0200 Message-Id: <20200706205245.937091-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706205245.937091-1-linus.walleij@linaro.org> References: <20200706205245.937091-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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 Cc: Mauri Sandberg Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Resend with the rest ChangeLog v2->v3: - Collect Andrew's reviewed-by. ChangeLog v1->v2: - Rebase on v5.8-rc1. --- drivers/net/dsa/rtl8366.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.26.2 diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c index a000d458d121..06adcf68ff8d 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