From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796454676; b=hpDqUdf2gzdQwRORyjoqp+cNNM4PHzmGV3XXmFFbiX0hAAOf2dKhrhnZjOL7p+oUO1Xi VbIf9qgznmj3/wtEB4i8VpQiR3lowrz9Fwno4zagmUVVBtbuPVgskNTpIlQsyrxgqn+yE 2wJ+t3vU22kwUOwouSBjwd2h9BYiZS8OTMKkxAXmik5NQ6idFYFwCWb99Gm7xen1sVMrS JVuu76wPsXb/zJUaO8JR/e4eeU1n8q6Um8xb3vkx8jyx/lgoP3UhJo1I+Yb6tSciEoTkc nR1nLakgcpKgMDYJCHervjNJiFrPgHjIRwif6wnzXR+s9gkb+HyP075NbBD2BQdoy4w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796454676; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=2AX3W0N0HqFEGCJhVxauPfRwlkqfBC/hwX7o54CEzKs=; b=DlSqsuERUBQLpnw5PFeqQR0stm2ghQCEHS5g7Gk2Zhj4lzJxpZwTX/Emk6y4y2vOgER6 1/+M3TF8n+Cu2Actyz1Sg1VhZLDzdaImA4ELm1e8vZrUe7tb8XvK2rCk5AGoghYQ2Kgr5 jGB8cTAic+TEwHt1Al9sMcUZYuiIu2YfCnUq1ug8+S3gTevEoiCSZrvr48kjadGWJYZU/ rC06IIh39a6eq9dvWvSpPWV1qt5fjqnUvu+yPpfLgLz9fXMpuP3h77F2X/ZpaBzHQbWZD aYpNaEd7vAT/p1MJvnYNPEeJgcS+9VG3DxULZ4khDLZJWpd2wEpM8qlkG0nWzvXNXnQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YlDqEsP3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D40D7606A322 for ; Sat, 5 Dec 2026 07:11:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YlDqEsP3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 538A01F0092B; Sat, 5 Dec 2026 07:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796454676; bh=2AX3W0N0HqFEGCJhVxauPfRwlkqfBC/hwX7o54CEzKs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=YlDqEsP3dXz3E2lfEfcS3zu20pH3O9skhvAcWbU6yDcHoIlzI3lbKepHMj3NOpxaZ 0BDDuiJwL5Y82a79CvM1QwG8uBRatlVK7X06AFbrywIdVBXz/kUM1LR5YxzSAyM4vI 3N3r44X7/P9eM0shvp/OXFuKqssBLiz1YWyI0arE6mHIpElqh0VyijaA8nh79DKXZc kWvPQJZVBTkVBrGWonKdLxvtvEJ7QCOB2oCiaXc2LUx7Um5DPEKAe7h6FeWpxxxg/3 tywQcCWdCvKNpcuXlRzviorOl5uJu2ihtEOHsr9IgmP2dfYwcct/5WyCRdE8HwnCSF E/+d5yRPChDYQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next 04/14] net: enetc: decouple FDBT logical config from hardware wire format Reply-To: sashiko-reviews@lists.linux.dev To: wei.fang@oss.nxp.com Cc: imx@lists.linux.dev, Frank.Li@kernel.org In-Reply-To: <20261204071410.692071-5-wei.fang@oss.nxp.com> References: <20261204071410.692071-1-wei.fang@oss.nxp.com> <20261204071410.692071-5-wei.fang@oss.nxp.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 07:11:15 +0000 X-Mailing-List: imx@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] net: enetc: ntmp_fdbt_search_port_entry() uses swcbd.size for NTMP_REQ_LEN -- commit 1eaf3a5180328e94fddc03214caeb25cfcd150d7 Author: Wei Fang net: enetc: decouple FDBT logical config from hardware wire format This commit turns struct fdbt_entry_data into a version-agnostic logical config, moves the wire structures to ntmp_private.h, and introduces ntmp_get_fdbt_ops() with pack/unpack callbacks. It also updates the FDBT API and the netc DSA switch driver callers to use the new interface. > diff --git a/drivers/net/ethernet/freescale/enetc/ntmp.c b/drivers/net/et= hernet/freescale/enetc/ntmp.c > index 6143e8b5c6b1f..801e4e7bb8314 100644 > --- a/drivers/net/ethernet/freescale/enetc/ntmp.c > +++ b/drivers/net/ethernet/freescale/enetc/ntmp.c [ ... ] > @@ -929,20 +989,24 @@ int ntmp_fdbt_search_port_entry(struct ntmp_user *u= ser, int port, > u32 len; > int err; > =20 > - swcbd.size =3D sizeof(*req); > + ops =3D ntmp_get_fdbt_ops(version); > + if (!ops) > + return -EOPNOTSUPP; > + > + swcbd.size =3D max_t(u32, sizeof(*req), ops->resp_query_len); > err =3D ntmp_alloc_data_mem(user->dev, &swcbd, (void **)&req); > if (err) > return err; > =20 > /* Request data */ > - ntmp_fill_crd(&req->crd, user->tbl_ver[NTMP_FDBT_ID], 0, 0); > - req->ak.search.resume_eid =3D cpu_to_le32(*resume_entry_id); > + ntmp_fill_crd(&req->crd, version, 0, 0); > + req->ak.search.resume_eid =3D cpu_to_le32(entry->status); > req->ak.search.cfge.port_bitmap =3D cpu_to_le32(BIT(port)); > /* Match CFGE_DATA[PORT_BITMAP] field */ > req->ak.search.cfge_mc =3D FDBT_CFGE_MC_PORT_BITMAP; > =20 > /* Request header */ > - len =3D NTMP_LEN(swcbd.size, sizeof(*resp)); > + len =3D NTMP_LEN(swcbd.size, ops->resp_query_len); [Severity: Low] Should this pass sizeof(*req) instead of swcbd.size as the request length to NTMP_LEN()? Now that swcbd.size is max_t(u32, sizeof(*req), ops->resp_query_len), a future FDBT version with a larger query response than struct fdbt_req_qd would encode ops->resp_query_len as the request length, causing hardware to reject or misparse the search command. For comparison, ntmp_fdbt_add_entry() passes ops->req_ua_len rather than swcbd.size. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204071410.6920= 71-1-wei.fang@oss.nxp.com?part=3D4