Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp232016pxb; Thu, 2 Sep 2021 02:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw94L/hAAuo+9mvSnije41BCPjtv7xz0EdycroWrfM865VhH52lORq2WEUmP8PDN1qs8d84 X-Received: by 2002:a05:6602:1503:: with SMTP id g3mr2065503iow.25.1630576684704; Thu, 02 Sep 2021 02:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630576684; cv=none; d=google.com; s=arc-20160816; b=yIWk1IWK2jp8xeUJkKugChrhcRecjDow4SkDhvZxmuk96++4Hg1Z2EGeZYOS3cCZXu Vdf0bDYm/fVHNNirVzlIYQQ7ZgAJwaDtEvq52OLJpLEQPl9gTJj8BOyouGg8B5D8gCQR jua6EK7JMju8jtp5IwMbJyXludK5eR7u99In+scoFxbp8Dc7X7+xciB+cLSRKqvaL7vq mM/+p1Z+NRx3ObTa+3PD7hDo+fBUJtSnVfzj1ABj6DbNtEuAZfDki2LCKtRJs/FfvVAd 5zn6KE/0XIWW0hDepsK/rJzQ/ql43/HNGE6YrYVO90O59SHhnXNykpRXABxWB4c7qxtX eLZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=zOwhVCNlalDvrlX5tBU822fa5JvADOBS0sKXrfxTsg8=; b=q4KvdEdlTZvXXBKwOD753eof+DUKHf6FYza3I5jbABmkqFm1/9Tz9aZm+gH6RTE0JO +C0vWjQjD7ALRSm/dfLSeO6NNJ9/KBTqudZRUns862PI/sg1I0zXjhkRRvXKnNK7Y9Cb 2c925uBHjEe4zSFSGbfQdXvy1v8yzOFRw6C2TELg0ImQGk0uvsbK16pNMKWcsD4zCPbP I/C5GfKlWRXabZ0MA/xfcdbxDRUtnx2rBJpf2Wu6AnLB7/0dZ7cy6gi5FBDx2THshW6F SYpfbUpCNesKOppvFhwnP9IaifwOzian5KSwhUClkIoxY5Y+KBIE75fuEZAvzKjP3Knb ldMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si1683982iln.95.2021.09.02.02.57.47; Thu, 02 Sep 2021 02:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237129AbhIBF5g (ORCPT + 99 others); Thu, 2 Sep 2021 01:57:36 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:50534 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237077AbhIBF5f (ORCPT ); Thu, 2 Sep 2021 01:57:35 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 1057C1C0BA1; Thu, 2 Sep 2021 07:56:36 +0200 (CEST) Date: Thu, 2 Sep 2021 07:56:35 +0200 From: Pavel Machek To: "Keller, Jacob E" Cc: Pavel Machek , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , "Brelinski, TonyX" , "Nguyen, Anthony L" , Jakub Kicinski , Sasha Levin Subject: Re: [PATCH 5.10 026/103] ice: do not abort devlink info if board identifier cant be found Message-ID: <20210902055635.GA17629@duo.ucw.cz> References: <20210901122300.503008474@linuxfoundation.org> <20210901122301.400339475@linuxfoundation.org> <20210901194236.GA8962@duo.ucw.cz> <20210901201046.GC8962@duo.ucw.cz> <8168c579-9ba7-2c31-42b3-9ad88760110a@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <8168c579-9ba7-2c31-42b3-9ad88760110a@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >>> The devlink dev info command reports version information about the > >>> device and firmware running on the board. This includes the "board.id" > >>> field which is supposed to represent an identifier of the board desig= n. > >>> The ice driver uses the Product Board Assembly identifier for this. > >>> > >>> In some cases, the PBA is not present in the NVM. If this happens, > >>> devlink dev info will fail with an error. Instead, modify the > >>> ice_info_pba function to just exit without filling in the context > >>> buffer. This will cause the board.id field to be skipped. Log a dev_d= bg > >>> message in case someone wants to confirm why board.id is not showing = up > >>> for them. > >> > >> Will it cause field to be skipped? I believe buffer will not be > >> initialized which will result in some confusion... > >=20 > > IOW I believe this is good idea. >=20 > It's not necessary, but I agree its not obvious without the full > context. The caller of ice_info_pba memsets the buffer before calling > each info reporter. Its already a known semantics that leaving the > buffer alone will skip the entry. >=20 > See the code below for what we do. >=20 > > memset(ctx->buf, 0, sizeof(ctx->buf)); > >=20 > > err =3D ice_devlink_versions[i].getter(pf, ctx); > > if (err) { > > NL_SET_ERR_MSG_MOD(extack, "Unable to obtain ve= rsion info"); > > goto out_free_ctx; > > } That memset is not present in 5.10 I was reviewing. I agree that backporting the memset to 5.10 is better then my patch. > We memset the buffer, call the getter, and if that doesn't modify the > buffer, we call the fallack, and then check again if its still empty. >=20 > Because we memset each time, we don't need to assign *buf =3D 0. >=20 > I guess its more clear that we're doing the correct thing here, but > these functions are build-for-purpose to use as pointers in this API and > aren't public, so I think it is fine to leave it as is. Yes, code is okay in mainline, but the memset is not present in 5.10-stable. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYTBnkwAKCRAw5/Bqldv6 8tEyAJ9PNrc5497CjlPnJuiOG+D4+LsLmACgpcGl1owPvR5qQtMEucZrXP90e0g= =8Mxd -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP--