From patchwork Mon Aug 30 21:48: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: 504340 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2191539jai; Mon, 30 Aug 2021 14:52:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXxLbnhs2bRHRhcBAJtzfdiXmNz0Bf2ZhhVXD4VBB4UGb+ecQOpMsELG4MXWCkI4LY5d7/ X-Received: by 2002:a6b:8f4e:: with SMTP id r75mr20260972iod.172.1630360377701; Mon, 30 Aug 2021 14:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630360377; cv=none; d=google.com; s=arc-20160816; b=JmnaeoVukbAy9FRWvRs0+uN0Lwuem99xp9mW40I859CGj0kgfRWmxc6DPqQ5589lDo FCLeoeXE+pngEUHOEknibJATnfDC6A6tdb9PrJXMfBO7NPCM2Odykm162M41QG3VOlNG 0IUd6SC6kk0h995dAxINi2Qcp+LL6g2UckqE6wXtGNw6qmvdp/RLnKAV7vtuHbrXoysg 84DwDBbnr82N3HewO5UVXnzAmCDgmD75qogKEfVZmHwb0HCEjwhaBKcomnbkm+TvlxEa k0iVthf/q8ypSYlRGIG+VfvKHy6ySHhXbG+7Myw8SemG4NK5WOq0z/RIl63nrbSmmoX1 Ho7A== 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=DZmYKsknRg8+p+PrSI/9VzJHFxsV1mevtKXxas2+qRE=; b=CtzgJzSJulWDXKQ/OPb1uiTvSwlWl1xiHTY8W5A0yx1Kv6jSbdykQt1XDpWEkZFBPE k61LB7odm2qsGQwd8aRQ7SZuSvdWZaZir+i2EX/1ZiryE+OLmFRLvHN3chmLlSgMdae0 WJJXhtyF6xla2GadDg3ECYcBsmTUNrDbi/8kAJ0HQPM624CG1rwjXzRlS/yZSLJEk9ux 3EkEX8L63COHjSCXc25H59D75fuplH68Z79HGPU3fWpolKoCzoXi2qa0THhhkdwZEYe7 L8onWR9d07mHUIM8JK5qjd/PoDADTbsSTovdjyPtvONmh/8JaC95CZ8lUyUYZWDO7MY5 KmAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YCRhg/hF"; 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 h10si15195253ioe.21.2021.08.30.14.52.57; Mon, 30 Aug 2021 14:52:57 -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="YCRhg/hF"; 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 S238797AbhH3Vxu (ORCPT + 8 others); Mon, 30 Aug 2021 17:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237167AbhH3Vxq (ORCPT ); Mon, 30 Aug 2021 17:53:46 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93AF2C061575 for ; Mon, 30 Aug 2021 14:52:52 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id j4so34173673lfg.9 for ; Mon, 30 Aug 2021 14:52:52 -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=DZmYKsknRg8+p+PrSI/9VzJHFxsV1mevtKXxas2+qRE=; b=YCRhg/hFGWS3B+HgVZ6sJUt7m9xoZbqyJwbONPnxudagRD3tYL+Pu1YOtyseuoTtSQ p9Sk17R+4qFVveWaFQu6PxB5Jf0mnpGf4rfGWPC9Z/3KGgNaqoiw8MnMRSdd391cUv/u jHrm/L/jCEsTTG2P9WVLbmEDnfJac2I6TpWCeIf7iQX6Gpue8f/hBAoVrLRk3aH5kDxZ veJUk3Y6/2YseKAUFpKtgQqm5qKq/t7FqGJSlw2Ovvw9rZdTXECoCfNpNDzkMZbt4853 wKYiUYsfYuvvTE3GXV5+b8lgtTM5ZyeO6FgUJPL7ok5Iq1EjBwn07khtxHgq6eaIewKN Yj1A== 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=DZmYKsknRg8+p+PrSI/9VzJHFxsV1mevtKXxas2+qRE=; b=qiSiNnm9Ik3N1EJm7b49vlR2hljxUSg7XcT4n8vt4O+Mz0d6uM55oUUQchEFjZASXD ZZ10hHaIrPhNvN+egBibmEpNYNFhVhueBAHpTPATMNhmIpkBccTQATgIOwzMKKcawrjt SM/qvkofsHKx9OkoTCaTCoFY2uLvitHKMxc9H3s+LsYWDDflrX6K+FiSqp2CUzNFbC8z /Ffe7UCr3IfRx1Tk/PT+YLSeFD+AacN6bLZtfNaOBIStLw4T3DMllsJgUekLpaGpJIEY z3Aa+k5Vj97niB+IgX1lOO3+Mx85b7QoHIW89KYgnMUhG5WWebCvIywMpHVBbO2bYkGd HCpg== X-Gm-Message-State: AOAM530VDCnm9HSn8yG5dPio6rYN3TyuzF3uJw4JTxRPWYqSXijN4C2a yOl9BwDBNhIU2WolL0MbtsWjMA== X-Received: by 2002:a05:6512:15e:: with SMTP id m30mr6002331lfo.82.1630360370994; Mon, 30 Aug 2021 14:52:50 -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 h4sm1514049lft.184.2021.08.30.14.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 14:52:50 -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 , =?utf-8?q?Alvin_=C5=A0ipraga?= , Mauri Sandberg , DENG Qingfang Subject: [PATCH net-next 2/5 v2] net: dsa: rtl8366: Drop custom VLAN set-up Date: Mon, 30 Aug 2021 23:48:56 +0200 Message-Id: <20210830214859.403100-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210830214859.403100-1-linus.walleij@linaro.org> References: <20210830214859.403100-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This hacky default VLAN setup was done in order to direct packets to the right ports and provide port isolation, both which we now support properly using custom tags and proper bridge port isolation. We can drop the custom VLAN code and leave all VLAN handling alone, as users expect things to be. We can also drop ds->configure_vlan_while_not_filtering = false; and let the core deal with any VLANs it wants. Cc: Vladimir Oltean Cc: Alvin Šipraga Cc: Mauri Sandberg Cc: DENG Qingfang Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - No changes. --- drivers/net/dsa/realtek-smi-core.h | 1 - drivers/net/dsa/rtl8366.c | 48 ------------------------------ drivers/net/dsa/rtl8366rb.c | 4 +-- 3 files changed, 1 insertion(+), 52 deletions(-) -- 2.31.1 Reviewed-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Reviewed-by: Florian Fainelli diff --git a/drivers/net/dsa/realtek-smi-core.h b/drivers/net/dsa/realtek-smi-core.h index fcf465f7f922..c8fbd7b9fd0b 100644 --- a/drivers/net/dsa/realtek-smi-core.h +++ b/drivers/net/dsa/realtek-smi-core.h @@ -129,7 +129,6 @@ int rtl8366_set_pvid(struct realtek_smi *smi, unsigned int port, int rtl8366_enable_vlan4k(struct realtek_smi *smi, bool enable); int rtl8366_enable_vlan(struct realtek_smi *smi, bool enable); int rtl8366_reset_vlan(struct realtek_smi *smi); -int rtl8366_init_vlan(struct realtek_smi *smi); int rtl8366_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, struct netlink_ext_ack *extack); int rtl8366_vlan_add(struct dsa_switch *ds, int port, diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c index 75897a369096..59c5bc4f7b71 100644 --- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -292,54 +292,6 @@ int rtl8366_reset_vlan(struct realtek_smi *smi) } EXPORT_SYMBOL_GPL(rtl8366_reset_vlan); -int rtl8366_init_vlan(struct realtek_smi *smi) -{ - int port; - int ret; - - ret = rtl8366_reset_vlan(smi); - if (ret) - return ret; - - /* Loop over the available ports, for each port, associate - * it with the VLAN (port+1) - */ - for (port = 0; port < smi->num_ports; port++) { - u32 mask; - - if (port == smi->cpu_port) - /* For the CPU port, make all ports members of this - * VLAN. - */ - mask = GENMASK((int)smi->num_ports - 1, 0); - else - /* For all other ports, enable itself plus the - * CPU port. - */ - mask = BIT(port) | BIT(smi->cpu_port); - - /* For each port, set the port as member of VLAN (port+1) - * and untagged, except for the CPU port: the CPU port (5) is - * member of VLAN 6 and so are ALL the other ports as well. - * Use filter 0 (no filter). - */ - dev_info(smi->dev, "VLAN%d port mask for port %d, %08x\n", - (port + 1), port, mask); - ret = rtl8366_set_vlan(smi, (port + 1), mask, mask, 0); - if (ret) - return ret; - - dev_info(smi->dev, "VLAN%d port %d, PVID set to %d\n", - (port + 1), port, (port + 1)); - ret = rtl8366_set_pvid(smi, port, (port + 1)); - if (ret) - return ret; - } - - return rtl8366_enable_vlan(smi, true); -} -EXPORT_SYMBOL_GPL(rtl8366_init_vlan); - int rtl8366_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, struct netlink_ext_ack *extack) { diff --git a/drivers/net/dsa/rtl8366rb.c b/drivers/net/dsa/rtl8366rb.c index 50ee7cd62484..8b040440d2d4 100644 --- a/drivers/net/dsa/rtl8366rb.c +++ b/drivers/net/dsa/rtl8366rb.c @@ -986,7 +986,7 @@ static int rtl8366rb_setup(struct dsa_switch *ds) return ret; } - ret = rtl8366_init_vlan(smi); + ret = rtl8366_reset_vlan(smi); if (ret) return ret; @@ -1000,8 +1000,6 @@ static int rtl8366rb_setup(struct dsa_switch *ds) return -ENODEV; } - ds->configure_vlan_while_not_filtering = false; - return 0; }