Message ID | 20230511170202.742087-2-alexis.lothore@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4538372vqo; Thu, 11 May 2023 10:13:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kqs00J1hmMl6dR07LeE1M4PM8Ge/RQ/2Zq165XT6PEq27J0O8mJOEMf2uHqtB0HsK4HYJ X-Received: by 2002:a17:90a:2d6:b0:252:a2e5:4c3f with SMTP id d22-20020a17090a02d600b00252a2e54c3fmr1072169pjd.25.1683825239305; Thu, 11 May 2023 10:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683825239; cv=none; d=google.com; s=arc-20160816; b=hdFrOgb8btK+fv2lzG2uSHLczDA5pwmbXmTwBj9BMboIfVIqiA6cPsO3nAyaRLkq9H I2zw3yoIo/SzhAszvsT7P/uRfndFdzgDmeRlBL1O0ILljc4ZBnFr+g6YzScqv4TXOkZL 2TJgfc6JQvoJpQWtpy67KSECJFX+MkAvITfA9bfdr2n8B5W9xUHRIJZ4MBMWD2jrQimD gs8xkT1wCSzEFt7107fWQ14koAx70hwhBATXV3yaP/ow0AxF8yv96z1jnFvwIhiIE63w JIzL/FSGjKDD8RV3Bp3XtOw9tXUNRhhk9xB62ekJ2JuLCB0Xj/PFOqKqQm7CrKot/YX7 YHfw== 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=xDcai/HHLRGOgXUWow6VVexAi1qET6F32H65gRi8ZmI=; b=hyCI+g16w8PzFrt9x3RU9ULYSApymUYi6EMDIFsj/Rrs+K3GSvT9ZskJUofSfsLGxj 0x9uLwAaz+UUMMSV8ZMVldMZHTvmx0FotRQqDNJGmQXoLJVjTi+ng3O2tKkB7roAbpsJ h4vm20XXsrio7c70nPeCia2v2vPLNu3moa2SYVeDjxwWDHjEjNqRZXQVuUcmz0iXuZVH 2Dn7Cr7XSNkuQFTsVviaGxtMFZwYY0TJ4g3qOSgs6LgoA0yKldq4ZQIPKu+7cnwvYy7U Af2kW/gZub8jPs4Mdo5kNPZlIUsGqAokCZcAhT4BFMcFyEmNNOmgB+GL9F6iS6h2rpLe eHew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="mX9/fYWV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a17090a72c700b00246d164fd7asi19077692pjk.159.2023.05.11.10.13.45; Thu, 11 May 2023 10:13:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="mX9/fYWV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238819AbjEKRCE (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Thu, 11 May 2023 13:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238774AbjEKRB5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 11 May 2023 13:01:57 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74E645247; Thu, 11 May 2023 10:01:50 -0700 (PDT) Received: (Authenticated sender: alexis.lothore@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E59EE240012; Thu, 11 May 2023 17:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1683824509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xDcai/HHLRGOgXUWow6VVexAi1qET6F32H65gRi8ZmI=; b=mX9/fYWVNQ5B9b3iFail4YJVJZDs63Rx1BOyexOB01aClpU5KQv8hSRsSRsyvo57inXtgZ FgU+hlWQBJn5AjjMQV1U5jivNFI88KViXmIhZs6DEUwGFffWL1IFLUI1n8nwKR0uKWlgni KYTrxYxA8ZQHkjnVDVw5j9vpnZs820BxWLJu1+vk6BSQHpBJtLk4bJnMiEe/xyjv+3gIys tq8KjAZ/cwltpri0ENDT8yVDMHJ6c21yskPoJbkM1Q0i46dYcGD36geb2IaONiGOYanE3s h5fWw21CKIX/TYXtwhRBT/SeoB82CZtRh3gTTlZ1tVXcoVYKvl9lixsOxiOBOg== From: alexis.lothore@bootlin.com To: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, herve.codina@bootlin.com, miquel.raynal@bootlin.com, milan.stevanovic@se.com, jimmy.lalande@se.com, pascal.eberhard@se.com Subject: [PATCH net v2 1/3] net: dsa: rzn1-a5psw: enable management frames for CPU port Date: Thu, 11 May 2023 19:02:00 +0200 Message-Id: <20230511170202.742087-2-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230511170202.742087-1-alexis.lothore@bootlin.com> References: <20230511170202.742087-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765618734022190907?= X-GMAIL-MSGID: =?utf-8?q?1765618734022190907?= |
Series |
net: dsa: rzn1-a5psw: disabled learning for standalone ports and fix STP support
|
|
Commit Message
Alexis Lothoré
May 11, 2023, 5:02 p.m. UTC
From: Clément Léger <clement.leger@bootlin.com> Currently, management frame were discarded before reaching the CPU port due to a misconfiguration of the MGMT_CONFIG register. Enable them by setting the correct value in this register in order to correctly receive management frame and handle STP. Fixes: 888cdb892b61 ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver") Signed-off-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> --- drivers/net/dsa/rzn1_a5psw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, May 11, 2023 at 07:02:00PM +0200, alexis.lothore@bootlin.com wrote: > From: Clément Léger <clement.leger@bootlin.com> > > Currently, management frame were discarded before reaching the CPU port due > to a misconfiguration of the MGMT_CONFIG register. Enable them by setting > the correct value in this register in order to correctly receive management > frame and handle STP. > > Fixes: 888cdb892b61 ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver") > Signed-off-by: Clément Léger <clement.leger@bootlin.com> > Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Hi, kernel test robot noticed the following build errors: [auto build test ERROR on net/main] url: https://github.com/intel-lab-lkp/linux/commits/alexis-lothore-bootlin-com/net-dsa-rzn1-a5psw-enable-management-frames-for-CPU-port/20230512-010530 base: net/main patch link: https://lore.kernel.org/r/20230511170202.742087-2-alexis.lothore%40bootlin.com patch subject: [PATCH net v2 1/3] net: dsa: rzn1-a5psw: enable management frames for CPU port config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20230512/202305121153.NMzdkguI-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/1a3acdd4d7ad50be9d4df989592327668610b13a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review alexis-lothore-bootlin-com/net-dsa-rzn1-a5psw-enable-management-frames-for-CPU-port/20230512-010530 git checkout 1a3acdd4d7ad50be9d4df989592327668610b13a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202305121153.NMzdkguI-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/net/dsa/rzn1_a5psw.c: In function 'a5psw_setup': >> drivers/net/dsa/rzn1_a5psw.c:676:32: error: 'A5PSW_MGMT_CFG_ENABLE' undeclared (first use in this function); did you mean 'A5PSW_MGMT_TAG_CFG_ENABLE'? 676 | reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_ENABLE; | ^~~~~~~~~~~~~~~~~~~~~ | A5PSW_MGMT_TAG_CFG_ENABLE drivers/net/dsa/rzn1_a5psw.c:676:32: note: each undeclared identifier is reported only once for each function it appears in vim +676 drivers/net/dsa/rzn1_a5psw.c 659 660 static int a5psw_setup(struct dsa_switch *ds) 661 { 662 struct a5psw *a5psw = ds->priv; 663 int port, vlan, ret; 664 struct dsa_port *dp; 665 u32 reg; 666 667 /* Validate that there is only 1 CPU port with index A5PSW_CPU_PORT */ 668 dsa_switch_for_each_cpu_port(dp, ds) { 669 if (dp->index != A5PSW_CPU_PORT) { 670 dev_err(a5psw->dev, "Invalid CPU port\n"); 671 return -EINVAL; 672 } 673 } 674 675 /* Configure management port */ > 676 reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_ENABLE; 677 a5psw_reg_writel(a5psw, A5PSW_MGMT_CFG, reg); 678 679 /* Set pattern 0 to forward all frame to mgmt port */ 680 a5psw_reg_writel(a5psw, A5PSW_PATTERN_CTRL(A5PSW_PATTERN_MGMTFWD), 681 A5PSW_PATTERN_CTRL_MGMTFWD); 682 683 /* Enable port tagging */ 684 reg = FIELD_PREP(A5PSW_MGMT_TAG_CFG_TAGFIELD, ETH_P_DSA_A5PSW); 685 reg |= A5PSW_MGMT_TAG_CFG_ENABLE | A5PSW_MGMT_TAG_CFG_ALL_FRAMES; 686 a5psw_reg_writel(a5psw, A5PSW_MGMT_TAG_CFG, reg); 687 688 /* Enable normal switch operation */ 689 reg = A5PSW_LK_ADDR_CTRL_BLOCKING | A5PSW_LK_ADDR_CTRL_LEARNING | 690 A5PSW_LK_ADDR_CTRL_AGEING | A5PSW_LK_ADDR_CTRL_ALLOW_MIGR | 691 A5PSW_LK_ADDR_CTRL_CLEAR_TABLE; 692 a5psw_reg_writel(a5psw, A5PSW_LK_CTRL, reg); 693 694 ret = readl_poll_timeout(a5psw->base + A5PSW_LK_CTRL, reg, 695 !(reg & A5PSW_LK_ADDR_CTRL_CLEAR_TABLE), 696 A5PSW_LK_BUSY_USEC_POLL, A5PSW_CTRL_TIMEOUT); 697 if (ret) { 698 dev_err(a5psw->dev, "Failed to clear lookup table\n"); 699 return ret; 700 } 701 702 /* Reset learn count to 0 */ 703 reg = A5PSW_LK_LEARNCOUNT_MODE_SET; 704 a5psw_reg_writel(a5psw, A5PSW_LK_LEARNCOUNT, reg); 705 706 /* Clear VLAN resource table */ 707 reg = A5PSW_VLAN_RES_WR_PORTMASK | A5PSW_VLAN_RES_WR_TAGMASK; 708 for (vlan = 0; vlan < A5PSW_VLAN_COUNT; vlan++) 709 a5psw_reg_writel(a5psw, A5PSW_VLAN_RES(vlan), reg); 710 711 /* Reset all ports */ 712 dsa_switch_for_each_port(dp, ds) { 713 port = dp->index; 714 715 /* Reset the port */ 716 a5psw_reg_writel(a5psw, A5PSW_CMD_CFG(port), 717 A5PSW_CMD_CFG_SW_RESET); 718 719 /* Enable only CPU port */ 720 a5psw_port_enable_set(a5psw, port, dsa_port_is_cpu(dp)); 721 722 if (dsa_port_is_unused(dp)) 723 continue; 724 725 /* Enable egress flooding for CPU port */ 726 if (dsa_port_is_cpu(dp)) 727 a5psw_flooding_set_resolution(a5psw, port, true); 728 729 /* Enable management forward only for user ports */ 730 if (dsa_port_is_user(dp)) 731 a5psw_port_mgmtfwd_set(a5psw, port, true); 732 } 733 734 return 0; 735 } 736
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index 919027cf2012..8a419e2ffe2a 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -673,7 +673,7 @@ static int a5psw_setup(struct dsa_switch *ds) } /* Configure management port */ - reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_DISCARD; + reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_ENABLE; a5psw_reg_writel(a5psw, A5PSW_MGMT_CFG, reg); /* Set pattern 0 to forward all frame to mgmt port */