Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1923707rdh; Tue, 26 Sep 2023 07:29:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPtLmVQ4VNPndQgyHLULBD3otqvWhfo7SF2HvAzbovK/PeEHRYycdFzHFtJujRLgi12wuX X-Received: by 2002:a17:90b:128a:b0:271:9c5f:fc42 with SMTP id fw10-20020a17090b128a00b002719c5ffc42mr7505946pjb.31.1695738552222; Tue, 26 Sep 2023 07:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695738552; cv=none; d=google.com; s=arc-20160816; b=nkpYaQj+06HjtMXVp2T7F6+G27uhUu7GAOgSFYcjia6hQ772G0BFHeBH4DXWtZL17S 0sLz0FnCmuguXmnVZB6wd0WcIVT1sB2WcKQOBL57deymUMw8Pqg8CSulJv+Jdhrdf45i MmjMxBDVsENIaF4iXQKGx7LasICjVV1r10R1yDD32hrnpRgMjKIE9j+BpbmxY5iSgEio lKO74KN52/CshRK2F6x5sF2dybDMnO1w6x8fTh2DP2QulEAvhw3whAjo7U+1g8Jt/iqe MamZwYRF7BAccVOGzuOSpRmwC4fWd+/q77HWq9hbmyzIBUHUkW7s2JB3s/SWDjjxrhv2 aHtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=61aVUGOGTN3aSD7gJdb94H+TJu9K7lHrgxrABi+aRKY=; fh=DAjwaKHaeLzWMblZahxB0msZdfn1iIRQuZjn/6MV/PM=; b=BxmgWE4BCzJGvKALITFe6mYilyxj9Nr6KEwyjl8r5WiH9FixVXbSisR7o9Xsjq2No3 dT+4ZbNgQCH2syxgInJF6LBrENsmiEDKMh+endksKeSxw0xgpOEwnh20Bl2lSNkpRZfK GhYltYbqms3jOBkNjvY+z8Edw9tOrFjkJENxYhm04l/ozKcEWKHAK9zKAFm9GR1NmYw5 u8Cm4zTqEePYuyi6jY9KkCzQ8ai7qekrU5933qhFvgwtS6PMmm8TvK4SCWXRHOSYtd/a pbvNo3eVYYE/j1myamF68Ki5FsZdDZp1nHPObvBNplfmniOAEIVyy4RdysbpAEe4WRbt fs4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jSMHuDHH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id oo14-20020a17090b1c8e00b002683f507990si5882110pjb.109.2023.09.26.07.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 07:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jSMHuDHH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 16A5180C9A78; Mon, 25 Sep 2023 23:45:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbjIZGo5 (ORCPT + 99 others); Tue, 26 Sep 2023 02:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjIZGok (ORCPT ); Tue, 26 Sep 2023 02:44:40 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBF7FE6 for ; Mon, 25 Sep 2023 23:44:33 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-59bf1dde73fso102643727b3.3 for ; Mon, 25 Sep 2023 23:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695710673; x=1696315473; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=61aVUGOGTN3aSD7gJdb94H+TJu9K7lHrgxrABi+aRKY=; b=jSMHuDHHhLMYzR8SM9T18DzBuzzc6pVCCsGzjMPHXAc2pSyVD11hPmwBKSDqhcc6f7 ChEqoDpo29wgWlXBCa5hlGxaraqdzfL5pxNV5K2q96x/qUAiJMZgZZSibU+ZplD8UF2i cW1bTuBHW9DmBmkxINtZupECyTarCQW/Kijwep28ftyoZHNhYMrmlYWCRJpgNuaUFuq+ vF1Btnumqr6woN8SpqfWnRu2M55s/XHP4ea1k17RdbL4eDMy0yc6vFVmxpyAqG5CAOdh tT27EKxQNr3n3gJcfq7J6eO/u0jlLoJVrKeEEWcKLDLxXcWH29nZrEN44L9DLNq6aMI9 RqfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695710673; x=1696315473; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=61aVUGOGTN3aSD7gJdb94H+TJu9K7lHrgxrABi+aRKY=; b=qWOsX0qwQ4YKTPUR8/GK20DYK8z1MePyITcmAjbpRyP5fYVNXVP8Zy5yvi9bXNDvK1 odDejoWfQdhaG6L0EDKIfsxgHZp13p5A5FQFmYkun7NZeVgAVnNrRKb1t0bTZnhaE+NS QyaezqSHWPqvUu3ZXMBQtjkXEjc2UdlNkGXh82jlt/1ugbpgRj5tweyo2FHo9Hp2OP0A dzC2O5F7W8NEmeVFEpbRrU9RTMOazy3NuZGkBqCzjlI4YBmhYu75I4vB18sTifxLITS8 tZ97f9moRBqubrMC19eSH0ODP67RYZuCT0ca2cbTZU/qNW7x5onL1wboZXT83l0p3eni kH1A== X-Gm-Message-State: AOJu0Yz/n6vwdVS5lNnlaAv9Vubt2O3/8zEnIqrT5aEAfz+jvbBfBYsT xYAw8ksnCmWTxVI936XGbDuIPjzaull/nqzEyhT7yw== X-Received: by 2002:a25:b283:0:b0:d78:1502:9330 with SMTP id k3-20020a25b283000000b00d7815029330mr7481834ybj.7.1695710673001; Mon, 25 Sep 2023 23:44:33 -0700 (PDT) MIME-Version: 1.0 References: <20230925-ixp4xx-eth-mtu-v2-1-393caab75cb0@linaro.org> In-Reply-To: From: Linus Walleij Date: Tue, 26 Sep 2023 08:44:20 +0200 Message-ID: Subject: Re: [PATCH net-next v2] net: ixp4xx_eth: Support changing the MTU To: Jacob Keller Cc: Krzysztof Halasa , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Williams Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 25 Sep 2023 23:45:02 -0700 (PDT) On Tue, Sep 26, 2023 at 12:29=E2=80=AFAM Jacob Keller wrote: > > +/* MRU is said to be 14320 in a code dump, the SW manual says that > > + * MRU/MTU is 16320 and includes VLAN and ethernet headers. > > + * See "IXP400 Software Programmer's Guide" section 10.3.2, page 161. > > + * > > + * FIXME: we have chosen the safe default (14320) but if you can test > > + * jumboframes, experiment with 16320 and see what happens! > > + */ > > Ok, so you're choosing a conservative upper limit that is known to work > while leaving the higher 16320 value for later if/when someone cares? Mostly if someone can test it. But maybe I can have authoritative information from Intel that the statement in the Software Programmers Guide is correct? ;) > > +static int ixp4xx_do_change_mtu(struct net_device *dev, int new_mtu) > > +{ > > + struct port *port =3D netdev_priv(dev); > > + struct npe *npe =3D port->npe; > > + struct msg msg; > > + /* adjust for ethernet headers */ > > + int framesize =3D new_mtu + VLAN_ETH_HLEN; > > + /* max rx/tx 64 byte chunks */ > > + int chunks =3D DIV_ROUND_UP(framesize, 64); > > + > > netdev coding style wants all of the declarations in "reverse christmas > tree" ordering. Assign to the local variables after the block if > necessary. Something like: > > struct port *port =3D netdev_priv(dev); > struct npe *npe =3D port->npe; > int framesize, chunks; > struct msg msg; > > /* adjust for ethernet headers */ > framesize =3D new_mtu + VLAN_ETH_HLEN; > /* max rx/tx 64 byte chunks */ > chunks =3D DIV_ROUND_UP(framesize, 64); Right, I fix! > > + memset(&msg, 0, sizeof(msg)); > > You could also use "struct msg msg =3D {}" instead of memset here. OK > > + msg.cmd =3D NPE_SETMAXFRAMELENGTHS; > > + msg.eth_id =3D port->id; > > + > > + /* Firmware wants to know buffer size in 64 byte chunks */ > > + msg.byte2 =3D chunks << 8; > > + msg.byte3 =3D chunks << 8; > > I am not sure I follow the "<< 8" here. I actually only have this vendor code, but clearly <<8 is not "multiply by 256" in this case, rather that the number of 64 byte chunks is in the second byte. The software manual just describes a "OS abstraction layer" used by both VXworks and Linux, and since that wasn't acceptable in the Linux driver, someone has ripped out the code to talk directly to the NPE firmware, and that is what we are seeing. If you have the source code to the abstraction layer "ixEthAcc" or the source code to the NPE microcode, I think the answer is in there... (I have neither, maybe you can check internally, hehe. Dan Williams used to work with this hardware!) > Reviewed-by: Jacob Keller Thanks! > > base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d > > change-id: 20230923-ixp4xx-eth-mtu-c041d7efe932 > > Curious what this change-id thing represents I've never seen it before.. > I know base-commit is used by git. Would be interested in an explanation > if you happen to know! :D It's metadata generated by b4 which is the tool we use for kernel mailing list handling: https://people.kernel.org/monsieuricon/sending-a-kernel-patch-with-b4-part-= 1 I think this change ID cross-references mails I send with my git branch, so it's easy to collect review tags etc. Yours, Linus Walleij