Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2960C7EE2E for ; Mon, 12 Jun 2023 16:30:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F07F985DE2; Mon, 12 Jun 2023 18:29:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="lZArcb6B"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0777A85F0A; Mon, 12 Jun 2023 18:29:57 +0200 (CEST) Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E3F8F85893 for ; Mon, 12 Jun 2023 18:29:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-56d2b7a9465so12771947b3.3 for ; Mon, 12 Jun 2023 09:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1686587389; x=1689179389; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ceft5zjHCdPUCsSl8/1pfUH3RGyAPtyQ9sKt3ysFjYA=; b=lZArcb6Bhhq/hgz04o3/lyRAdpIrtfzsAqC3OaIEvLDaQ6+wCzJqqOGdz0k6sxyvG9 3SWb1tS3mSG3GaQFrcEzZnoVvAIDr3jQasXSINJy4Kct2IdRzbYqnOYR2c0ieFz21H+X gZzhLpJxfK8bt87x7of/rrrC6nCsUJgt0a54E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686587389; x=1689179389; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ceft5zjHCdPUCsSl8/1pfUH3RGyAPtyQ9sKt3ysFjYA=; b=P4stqiM2/Mm8GLMSq7hJpbiOHZxS9gf1t57S8LdyDjH64P6v+ewp/RCbAfyBNoa635 RfsZtJFLyGSH9RGDtDCpVEYUFrlfpa31T4OOKWCTIoMP99Xzu/5Wp5FceamM335RWK2v C0m3L+9Ff2MBVv0C3S5Xh6DkHYfrkYhNdvhWXIiazXEtXl25oBbtRmbzhJU5zO5QnBrl hca0f3Hi0Omb8TD8lph+Laqx4/402Ppfq+FCt6tgWplgZtmBZk6HzlsXS2/5bwe9PvSt oJGRq7PK+yF22EvOeCMaXLWAt6mMiv+Fjul+h2eZEWc6ySY9v8HsidJl2WNvE2Y63RxC bv6Q== X-Gm-Message-State: AC+VfDxinlFVUUWJ+sCJ0tPONGIy2BBCr/HYLjAV0ZhzZ74kzFZNdROc gHTQrSNhJYv+tv3rrzy8vx3+ZA== X-Google-Smtp-Source: ACHHUZ4QDldbfO4Rk4NqKbgCweDY5V4xSIPgqPiF7gzM4rgqMkjEpFaUsSc1lIE50+5AfFgmWaN/SQ== X-Received: by 2002:a0d:d106:0:b0:561:d21d:8ce3 with SMTP id t6-20020a0dd106000000b00561d21d8ce3mr9240507ywd.3.1686587389470; Mon, 12 Jun 2023 09:29:49 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-c45d-8da1-aa0c-86af.res6.spectrum.com. [2603:6081:7b00:6400:c45d:8da1:aa0c:86af]) by smtp.gmail.com with ESMTPSA id y63-20020a817d42000000b0056507de3d82sm2566241ywc.104.2023.06.12.09.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 09:29:48 -0700 (PDT) Date: Mon, 12 Jun 2023 12:29:46 -0400 From: Tom Rini To: Christian Gmeiner Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Stefan Roese , Joe Hershberger , Ramon Fried , open list , Thomas RIENOESSL Subject: Re: [PATCH v2 4/4] net: add NFSv1 support Message-ID: <20230612162946.GK835503@bill-the-cat> References: <20230310095155.29832-1-christian.gmeiner@gmail.com> <20230310095155.29832-5-christian.gmeiner@gmail.com> <20230611125424.3yxonqq5ddxxkoys@pali> <20230611151050.65treh5zfaer2gkc@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qHYTESARHbbxsBNy" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean --qHYTESARHbbxsBNy Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 11, 2023 at 05:24:50PM +0200, Christian Gmeiner wrote: > Am So., 11. Juni 2023 um 17:10 Uhr schrieb Pali Roh=E1r : > > > > On Sunday 11 June 2023 16:57:07 Christian Gmeiner wrote: > > > Hello > > > > > > > > > > > Hello! I must admit that this patch is broken and does not add any = NFSv1 > > > > support. Just look below.... > > > > > > > > > > So .. let see what happend here. > > > > > > > On Friday 10 March 2023 10:51:55 Christian Gmeiner wrote: > > > > > From: Thomas RIENOESSL > > > > > > > > > > NFSv1 support added by Christian Gmeiner, Thomas Rienoessl, > > > > > September 27, 2018. As of now, NFSv3 is the default choice. > > > > > if the server does not support NFSv3, we fall back to > > > > > versions 2 or 1. > > > > > > > > > > Signed-off-by: Thomas RIENOESSL > > > > > --- > > > > > net/nfs.c | 42 +++++++++++++++++++++++++++++++++--------- > > > > > 1 file changed, 33 insertions(+), 9 deletions(-) > > > > > > > > > > diff --git a/net/nfs.c b/net/nfs.c > > > > > index 21cae52f35..7a8887ef23 100644 > > > > > --- a/net/nfs.c > > > > > +++ b/net/nfs.c > > > > > @@ -26,6 +26,10 @@ > > > > > * NFSv2 is still used by default. But if server does not suppor= t NFSv2, then > > > > > * NFSv3 is used, if available on NFS server. */ > > > > > > > > > > +/* NOTE 5: NFSv1 support added by Christian Gmeiner, Thomas Rien= oessl, > > > > > + * September 27, 2018. As of now, NFSv3 is the default choice. I= f the server > > > > > + * does not support NFSv3, we fall back to versions 2 or 1. */ > > > > > + > > > > > #include > > > > > #include > > > > > #include > > > > > @@ -78,6 +82,7 @@ static char nfs_path_buff[2048]; > > > > > > > > > > enum nfs_version { > > > > > NFS_UNKOWN =3D 0, > > > > > + NFS_V1 =3D 1, > > > > > NFS_V2 =3D 2, > > > > > NFS_V3 =3D 3, > > > > > }; > > > > > @@ -192,6 +197,7 @@ static void rpc_req(int rpc_prog, int rpc_pro= c, uint32_t *data, int datalen) > > > > > switch (rpc_prog) { > > > > > case PROG_NFS: > > > > > switch (choosen_nfs_version) { > > > > > + case NFS_V1: > > > > > case NFS_V2: > > > > > rpc_pkt.u.call.vers =3D htonl(2); > > > > > > > > So if NFSv1 is chosen then this code uses NFSv2. This is either reb= asing > > > > problem or just prove that this patch does not add any NFSv1 suppor= t. > > > > > > > > > break; > > > > > @@ -205,8 +211,26 @@ static void rpc_req(int rpc_prog, int rpc_pr= oc, uint32_t *data, int datalen) > > > > > break; > > > > > } > > > > > break; > > > > > - case PROG_PORTMAP: > > > > > case PROG_MOUNT: > > > > > + switch (choosen_nfs_version) { > > > > > + case NFS_V1: > > > > > + rpc_pkt.u.call.vers =3D htonl(1); > > > > > + break; > > > > > > > > And later here for NFSv1 we are trying to use Mount Server, which N= FSv1 > > > > did not use at all. So this patch really does not have to work with= old > > > > NFSv1 servers. > > > > > > > > Instead NFSv1 uses NFSPROC_ROOT RPC call exported by NFS server. > > > > (See that this RPC call is deprecated in NFSv2 and MNT server is us= ed > > > > in NFSv2 instead.) > > > > > > > > MNTv1 is service used by the NFSv2 and it returns NFSv2 file handles > > > > (not NFSv1 file handles). MNTv2 is also used by NFSv2 and as additi= on to > > > > MNTv1, it adds DIRPATH rpc call. So if NFSv2 does not need to use > > > > DIRPATH then it is fine to use just MNTv1 in NFSv2. > > > > > > > > > + > > > > > + case NFS_V2: > > > > > + rpc_pkt.u.call.vers =3D htonl(2); > > > > > + break; > > > > > + > > > > > + case NFS_V3: > > > > > + rpc_pkt.u.call.vers =3D htonl(3); > > > > > + break; > > > > > + > > > > > + case NFS_UNKOWN: > > > > > + /* nothing to do */ > > > > > + break; > > > > > + } > > > > > + break; > > > > > + case PROG_PORTMAP: > > > > > default: > > > > > rpc_pkt.u.call.vers =3D htonl(2); /* portmapper is = version 2 */ > > > > > } > > > > > @@ -311,7 +335,7 @@ static void nfs_readlink_req(void) > > > > > p =3D &(data[0]); > > > > > p =3D rpc_add_credentials(p); > > > > > > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) { > > > > > + if (choosen_nfs_version !=3D NFS_V3) { > > > > > memcpy(p, filefh, NFS_FHSIZE); > > > > > p +=3D (NFS_FHSIZE / 4); > > > > > } else { /* NFS_V3 */ > > > > > @@ -340,7 +364,7 @@ static void nfs_lookup_req(char *fname) > > > > > p =3D &(data[0]); > > > > > p =3D rpc_add_credentials(p); > > > > > > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) { > > > > > + if (choosen_nfs_version !=3D NFS_V3) { > > > > > memcpy(p, dirfh, NFS_FHSIZE); > > > > > p +=3D (NFS_FHSIZE / 4); > > > > > *p++ =3D htonl(fnamelen); > > > > > @@ -380,7 +404,7 @@ static void nfs_read_req(int offset, int read= len) > > > > > p =3D &(data[0]); > > > > > p =3D rpc_add_credentials(p); > > > > > > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) { > > > > > + if (choosen_nfs_version !=3D NFS_V3) { > > > > > memcpy(p, filefh, NFS_FHSIZE); > > > > > p +=3D (NFS_FHSIZE / 4); > > > > > *p++ =3D htonl(offset); > > > > > @@ -410,13 +434,13 @@ static void nfs_send(void) > > > > > > > > > > switch (nfs_state) { > > > > > case STATE_PRCLOOKUP_PROG_MOUNT_REQ: > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) > > > > > + if (choosen_nfs_version !=3D NFS_V3) > > > > > rpc_lookup_req(PROG_MOUNT, 1); > > > > > else /* NFS_V3 */ > > > > > rpc_lookup_req(PROG_MOUNT, 3); > > > > > break; > > > > > case STATE_PRCLOOKUP_PROG_NFS_REQ: > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) > > > > > + if (choosen_nfs_version !=3D NFS_V3) > > > > > rpc_lookup_req(PROG_NFS, 2); > > > > > else /* NFS_V3 */ > > > > > rpc_lookup_req(PROG_NFS, 3); > > > > > @@ -457,7 +481,7 @@ static int rpc_handle_error(struct rpc_t *rpc= _pkt) > > > > > const int min =3D ntohl(rpc_pkt->u.reply.da= ta[0]); > > > > > const int max =3D ntohl(rpc_pkt->u.reply.da= ta[1]); > > > > > > > > > > - if (max < NFS_V2 || max > NFS_V3 || min > N= FS_V3) { > > > > > + if (max < NFS_V1 || max > NFS_V3 || min > N= FS_V3) { > > > > > puts("*** ERROR: NFS version not su= pported"); > > > > > debug(": Requested: V%d, accepted: = min V%d - max V%d\n", > > > > > choosen_nfs_version, > > > > > @@ -588,7 +612,7 @@ static int nfs_lookup_reply(uchar *pkt, unsig= ned len) > > > > > if (ret) > > > > > return ret; > > > > > > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) { > > > > > + if (choosen_nfs_version !=3D NFS_V3) { > > > > > if (((uchar *)&(rpc_pkt.u.reply.data[0]) - (uchar *= )(&rpc_pkt) + NFS_FHSIZE) > len) > > > > > return -NFS_RPC_DROP; > > > > > memcpy(filefh, rpc_pkt.u.reply.data + 1, NFS_FHSIZE= ); > > > > > @@ -712,7 +736,7 @@ static int nfs_read_reply(uchar *pkt, unsigne= d len) > > > > > if (!(nfs_offset % ((NFS_READ_SIZE / 2) * 10))) > > > > > putc('#'); > > > > > > > > > > - if (choosen_nfs_version =3D=3D NFS_V2) { > > > > > + if (choosen_nfs_version !=3D NFS_V3) { > > > > > rlen =3D ntohl(rpc_pkt.u.reply.data[18]); > > > > > data_ptr =3D (uchar *)&(rpc_pkt.u.reply.data[19]); > > > > > } else { /* NFS_V3 */ > > > > > -- > > > > > 2.39.2 > > > > > > > > > > > > > And looking at the other changes here, there is really _no_ code wh= ich > > > > adds NFSv1 support. > > > > > > > > So what is this patch doing? The only thing which it does is that f= or > > > > NFSv1 requests it does NFSv2 calls. On every place is just check th= at > > > > choosen_nfs_version is not NFS_V3. > > > > > > > > Which just basically duplicates NFSv2 to be used two times. > > > > > > > > I would suggest to revisit this patch (who reviewed it at all?) and > > > > either fix it or revert it. And of course properly test it. (And I > > > > really curious where you find NFSv1 server because Linux has already > > > > removed also NFSv2 support from userspace...) > > > > > > Soo. I had a look at RFC 1094 and this patch adds version one of the > > > mount protocol. > > > I am quite unhappy that we got into this state, but the company I > > > worked for uses the > > > term NFSv1 for this in all their configuration tools etc. > > > What would you suggest to improve this situation? > > > > Suggestion: Revert this one patch, then figure out what is needed to be > > supported (describe all details what kind of protocol and what packets > > needs to be send and received), find a way and discuss how to implement > > it and prepare patch for the review. >=20 > Here comes a big problem: "find a way and discuss how to implement it > and prepare patch for the review." > I am not sure if there is really someone interested in discussion > about this topic and it is > even harder to find someone that reviews U-Boot patches. And this is > not specific to networking stuff. >=20 > I can prepare a patch that reworks the current implementation (without > a revert) and send it out. >=20 > > > > If you, who sent this patch, are unhappy about this patch, and also Pet= er > > and me pointed issues, then this patch really should not have land into > > git master branch in this form. It means that nobody is happy with this > > patch. >=20 > To clarify a fact: I am happy with the patch. I am unhappy with the > wrong "naming" that my old > employer used and influenced this patch. Also the company is shipping > thousands of devices per > year where these patches are used. Further clean-ups and clarifications to the support here in terms of what it does and doesn't provide are good. But to the point on reviews, yes, I do wish we had more people interested in various areas, and with time to devote to reviewing code as well. Sadly, we don't always, and I took this particular set of patches as being small enough of a global impact while (hopefully!) making future contributions both in this area and the related platforms using it more likely. --=20 Tom --qHYTESARHbbxsBNy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmSHR/oACgkQFHw5/5Y0 tywyWgv/Vx+Ydx5K+9ScoWKBwjfmNV1XrWcArD4C7sER44pYAKrblW4Zqh2wKa4d fcAxbgbkMLs4wrYRccjw2QhSvZo7EJAhJg8mfMyj062f8rOGc2H6kux29XK3lxOJ lQ/d1sbE8v99fUe2Qp6+ZUJfQFHy/YStiYf4ENhSxVHuMNMJuPXpzVOgnRM3pSoe 38/NBCi6hK+SVtDg4n4QrNtHR0rbsjAa3Vt6JYxmShc29XoWRQERfCJqhEaAhYTl 1faX8oakTax6ZsUELOQXQw9NTkn+2Z2bgGZMfNHwH8hIh8Elpq1UCeRRReDjinsv im7FCYv3kqbfLnPhIp2AznQT6wyioVdj8fREsHJ88Pfc8GxT0mXSerEbEXnuTHhP k/w1FT3zU849CQ2gB1iNJ+Tf1lVjHJFuJg7VR+hVW3idUtYyCC38AIDWCIHofJ6k 2KLVhfl0tZj6NxVpdIHhsTUUpOUuZMLi/y9CGrtpCKkUe9oHKI4McSjM9wHhQRe7 Zu/DLEQL =/E4n -----END PGP SIGNATURE----- --qHYTESARHbbxsBNy--