Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2656881rdb; Wed, 15 Nov 2023 07:07:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCKHMsbE4Omn8aLo5AxMdKBJm02/bVL/cCb17/xf2KAOeBxbi+rPq3f5ajrw87NSi6e8h6 X-Received: by 2002:a05:6a21:1208:b0:187:6de5:4c5b with SMTP id oe8-20020a056a21120800b001876de54c5bmr1518256pzb.49.1700060875813; Wed, 15 Nov 2023 07:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700060875; cv=none; d=google.com; s=arc-20160816; b=ZATuZmLy5yoUwdiHNX5YY0kmr6bKRZXzIdHsBQuu0fIQX5kO3jVUlH9FcsNP0il0gH ygOeKy4L++tGSvwVOZuMPLZACZcmrZJ1LHiBX1aQR9CSDag4B/XLQt3LV1Ua0nyyv63i j4RL+C7zWC2UkEQF9hyN1i6/nAEJAywD7I9Gk+t2+AYlmgFr4Q2L1d3NYbTEA8NmC6AC la4hn/8xgDg+OmRZ2sqAl5J56IcWCnkt9uNuUhWTitCQHNthlivHSuQxlRrAL7Np4Y9m TrCFAZLDdukRxouNDipLMoqqKibs502NkHY8UjQHpaHvCpPaPIX1y1NZ5ZYkC7qH2VR1 PHyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=9dy5Pt08X+zZERsZIfegEmYR9OttXODBuhXhRa0MCI8=; fh=2tlww+FArFlM2d8csB+YsM6TvXXSnvJNo6zCvpDnV3o=; b=Uc2TVokc7sZK1KZClq4G/9Uo4jjWmw89EOLZuiVOdHTRwW45DLoq/JM9BOtqeuwpvm Es+/AATs9Sh8ORQNUfrPKrXQorKPWKQCACG5+tjUicXj3aQkagzdmj9Z4krjzAOLDy4s zS5wa0USjfvpj9SBRQiieG1S6POkSRNLFBzLwL4ZaV7j6HusCjpd1ckHom514hcf00BL I7gAHo9RT+1OhZ8Jf3w9x1ouuAynYFjNvXE6TZhnphblQbMEy4FCc/urFhKLjvT3ryUU 7KO2Lv8sT2yzn8wpe9ZU6YFpEvoNDV3zuJs/vP3TmQxvyLbMTKrEX6E8/AUV9Dzd+pDJ zAVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jcZbQDDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o26-20020a635d5a000000b005be03f0da65si10150631pgm.720.2023.11.15.07.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 07:07:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jcZbQDDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id AB3CA801B7BC; Wed, 15 Nov 2023 07:07:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344353AbjKOPH2 (ORCPT + 99 others); Wed, 15 Nov 2023 10:07:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344352AbjKOPH1 (ORCPT ); Wed, 15 Nov 2023 10:07:27 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65605125; Wed, 15 Nov 2023 07:07:22 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 12BBC24000C; Wed, 15 Nov 2023 15:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700060840; 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: in-reply-to:in-reply-to:references:references; bh=9dy5Pt08X+zZERsZIfegEmYR9OttXODBuhXhRa0MCI8=; b=jcZbQDDDhYGFHk72VXnxdjYiNDUyrCQ/WJb2qldiqupZ+jnENFi6d7pXZXPO7zaOXqZN3n Z4UOhaIhkVC0nXMh7vH5oTL0/A06nc1Txuz7OmqMXjFECAuutFDIXTdSMJnAfYB8UnmMZe ttvMHMAJWf0cvaeB8X0L6KngKx0ZRIaZk9xXtWdkDQfUBJhitM4g2/Jbs8COQHx07UPjoo xfezyffYVPzr6Mtk1f7i/r+PEdAxk8EAWmkanywsqEyVwyx3fvhrbNXW76JSBg6B4Z+dM6 nC9XZV4NrBVjciM+ew12qhG8KmvR/dsxMEt7PvLivSOyDLVDu/zKCnN3L15jSA== Date: Wed, 15 Nov 2023 16:07:32 +0100 (CET) From: Romain Gantois To: Wojciech Drewek cc: Romain Gantois , davem@davemloft.net, Rob Herring , Krzysztof Kozlowski , Jakub Kicinski , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko , Andy Gross , Bjorn Andersson , Konrad Dybcio Subject: Re: [PATCH net-next v3 3/8] net: qualcomm: ipqess: introduce the Qualcomm IPQESS driver In-Reply-To: <59e1edc3-2ebc-40a9-a05b-cab02e8b0c10@intel.com> Message-ID: References: <20231114105600.1012056-1-romain.gantois@bootlin.com> <20231114105600.1012056-4-romain.gantois@bootlin.com> <59e1edc3-2ebc-40a9-a05b-cab02e8b0c10@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-GND-Sasl: romain.gantois@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 07:07:50 -0800 (PST) On Wed, 15 Nov 2023, Wojciech Drewek wrote: ... > > +static int ipqess_port_vlan_rx_add_vid(struct net_device *dev, __be16 proto, > > + u16 vid) > > +{ > > + struct ipqess_port *port = netdev_priv(dev); > > + struct switchdev_obj_port_vlan vlan = { > > + .obj.id = SWITCHDEV_OBJ_ID_PORT_VLAN, > > + .vid = vid, > > + /* This API only allows programming tagged, non-PVID VIDs */ > > + .flags = 0, > > + }; > > + struct netlink_ext_ack extack = {0}; > > + int ret; > > + > > + /* User port... */ > > + ret = ipqess_port_do_vlan_add(port->sw->priv, port->index, &vlan, &extack); > > + if (ret) { > > + if (extack._msg) > > + netdev_err(dev, "%s\n", extack._msg); > > + return ret; > > + } > > + > > + /* And CPU port... */ > > + ret = ipqess_port_do_vlan_add(port->sw->priv, 0, &vlan, &extack); > > + if (ret) { > > Should we delete vlan from user port if this fails? I'll have to look into how and when this API is called in more detail but I think this would indeed make sense. > > + > > + /* Flush the FDB table */ > > + qca8k_fdb_flush(priv); > > + > > + if (ret < 0) > > + goto devlink_free; > > + > > + /* set Port0 status */ > > + reg = QCA8K_PORT_STATUS_LINK_AUTO; > > + reg |= QCA8K_PORT_STATUS_DUPLEX; > > + reg |= QCA8K_PORT_STATUS_SPEED_1000; > > + reg |= QCA8K_PORT_STATUS_RXFLOW; > > + reg |= QCA8K_PORT_STATUS_TXFLOW; > > + reg |= QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC; > > + qca8k_write(priv, QCA8K_REG_PORT_STATUS(0), reg); > > + sw->port0_enabled = true; > > + > > + return 0; > > + > > +devlink_free: > > Why is it called devlink_free, I don't see any connection to devlink. I think this is leftover from a previous version of this function, where it interacted with devlink. I'll rename it to error. Best, -- Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com