Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1758747rda; Tue, 24 Oct 2023 02:16:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHky9UzVZy1PnLTO16K5XGkne6TnHtguPuP64DNSMaYnBuW9pZWhmP5Qd8laqx6HBuAPlGj X-Received: by 2002:a05:6359:2f41:b0:168:dd27:a069 with SMTP id rr1-20020a0563592f4100b00168dd27a069mr5369104rwb.19.1698138995797; Tue, 24 Oct 2023 02:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698138995; cv=none; d=google.com; s=arc-20160816; b=y0PHPw+DPwf8yXlyNU6cEyorjX9FeKflirED8an2XbzC+42PHx3/XQBvrWCS01lUQr QQL2tTyiq4JaPilJgKq2hCO/nkKjvTUAE+hSTwJPJplfF15eHqGizXRMRVH45Hpkvlbt cEtFDRVnyNEUymYRqliwHRc4r1Bmkv6n0ZPMXYDqvIIFLawj+qemMR5KggYssXHoHBDh crJxc6ww8axPfkj7EjjKbh3NWO21tIFg1RKmC7+930IF/NAGXvA8wuEs/aTSX5qg5f1d wjSoR8YWXMxNqmOshWqWU1nG5DUCEdT5WYcAHlUx6kmZHou2HrqufdQrk93KdL59cF6R Cbcw== 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=md6/yyZqKkyjUlet2bPLNG/W7nE8H467rQvEuNTnneo=; fh=aaZnsuOZEKavFpWUX9RCNRYpW0PXKCCHL/zpU8nvab8=; b=bNfcHrDTxMycBYuU31BxJWS3R3+Rf2o2B4ZlPr63IEVeIEvEtvZD+8xr2SsQoAlv+d AV8BEgybm54mIESiRuKedsfF6EHE6CkRDC54k2wCGCUqHn6UzExV6QpQjRIrhkQQ/8FO 3K+j5NaiysjzM9rHYDsBbi+j5vu6n4pNzXFrUnV/l1C01RsQoZGWNfHtr0OnPoJ8rCrd k6Liel9ONJnaYsO+5I1/6z5mMisnt3yVUJcc3dt0axNTEt89z5wclDT21ZqAvZ/9RdMl QJ14SYYPz2+mnSUhYQpo334/jOpA0RVCkXMHEMunfcAqLCpFsNB6QsxG6rI35i4Kag/2 jT0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="BXfZq//4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r9-20020a632b09000000b00573fbbb7803si7845093pgr.613.2023.10.24.02.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 02:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="BXfZq//4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id B367F80A2219; Tue, 24 Oct 2023 02:16:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233905AbjJXJQX (ORCPT + 99 others); Tue, 24 Oct 2023 05:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233989AbjJXJQU (ORCPT ); Tue, 24 Oct 2023 05:16:20 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1CF133; Tue, 24 Oct 2023 02:16:15 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 42A0660004; Tue, 24 Oct 2023 09:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698138974; 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=md6/yyZqKkyjUlet2bPLNG/W7nE8H467rQvEuNTnneo=; b=BXfZq//4KXiali7NIh5LYiazMLA56n3s3V/t1dnc7sGhlbBzgd80H8ksKkYdkb++IlGnvC tVUuGfQOfnKD28g+ViRq0MGt8wcTPf/moe4+SMB6UIuhYJcpbl+zbr2gtPX/EwlZMXIPsl FzT0unj13nA5QPdZJVyFA5u1713cK1kjQlQX/rIrP9zB/rzsi+vJggfr6Zx7JTbNi26/x3 fPXErPC2j2Jvxlf12sqn4twV81QKVzEE2/nPGVJ4YJkP5EaLMn18nyNFRuBxnVDtq0o7sJ ZdgbeNB6UW+Ir1UKd2/HrGLcDtVlrHueSgm8KDMmtPEDoY+nVOwYfNpTW8cQSA== Date: Tue, 24 Oct 2023 11:16:27 +0200 (CEST) From: Romain Gantois To: Andrew Lunn 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, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko , Andy Gross , Bjorn Andersson , Konrad Dybcio , Maxime Chevallier Subject: Re: [PATCH net-next 3/5] net: ipqess: introduce the Qualcomm IPQESS driver In-Reply-To: Message-ID: References: <20231023155013.512999-1-romain.gantois@bootlin.com> <20231023155013.512999-4-romain.gantois@bootlin.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.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 24 Oct 2023 02:16:33 -0700 (PDT) Hello Andrew, On Mon, 23 Oct 2023, Andrew Lunn wrote: [...] > > + struct qca8k_priv *priv = port->sw->priv; > > + struct ipqess_port_dump_ctx dump = { > > + .dev = dev, > > + .skb = skb, > > + .cb = cb, > > + .idx = *idx, > > + }; > > And with a little bit of refactoring, you should be able to use the > core of qca8k_port_fdb_dump(). All that seems to differ is how you get > to the struct qca8k_priv *priv. > > That then makes me wounder if there is more code here which could be > removed with a little refactoring of the DSA driver? Yes, I think this should be possible for a few more functions, I'll look into it for the v2. > > +static int ipqess_port_get_eeprom_len(struct net_device *dev) > > +{ > > + return 0; > > +} > > Is this actually useful? What does it default to if not provided? 42? It's not, I'll remove it. > > > + for (c = 0; c < priv->info->mib_count; c++) { > > + mib = &ar8327_mib[c]; > > + reg = QCA8K_PORT_MIB_COUNTER(port->index) + mib->offset; > > + > > + ret = qca8k_read(priv, reg, &val); > > + if (ret < 0) > > + continue; > > Given the switch is built in, is this fast? The 8k driver avoids doing > register reads for this. Sorry, I don't quite understand what you mean. Are you referring to the existing QCA8k DSA driver? From what I've seen, it calls qca8k_get_ethtool_stats defined in qca8k-common.c and this uses the same register read. Thanks, Romain