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=1796487009; b=xOGreQbYEiEfyB8MvRZVlJIzETw56EqHD+g7DVLF7uv90wrgA62Pg/uxe9k72qZpseOB YQr3uJ0hHZkOnEbcA0zE41j+uazB7aapg2ENKZGKDEYXelLKSL1iVNuz61b/xOZdXl1lD iCG6X9jO+/UnVwGANhi0adXu/Tcg+xEfK0d25TZxe16he4rFa4xETyraGB9g7wzzZENNm pzD3kvI2ZUL/14ZTuj+yd5txLVyPlqK5zVkR+gAvu69yuAROaQqTKDvQR6YqgE9VTHHgM Ouod9ddHGSgp2iMTR1E2w+9Hz6tXhlXkwca5X4Ilg1xUL6PFwrf38PZyS+TJokv2P0A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796487009; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+WuBovkobssujkTnt4NChI5Cdw2fmyLOwUC1tS7vUfE=; b=5IPOcHGHE30MEgRx/MCBUijGRrbJbHPqdXV/nsXsF8F5pecQnxkV7OMRdJmIbuVA1S8r nrCEDtzmiE6hs8sUJZWaCxDqOh7O7dr4PsYb+Ktn8SNEApOgQw+BNLSMmQPI0uAWdLK9l oUGckvtLeQr7hcToS82KYws5rtXj7jlEofzZ4P2JpFqlVrYjWhaDBtjOx/RJ25SvWiBcg nWgtO6QqW1ngRmgF83RUXFoeMpf8lXm83J4HsbLGxYjwCg0GERzZliruEKNsUOS1foqvP sMHFq5y17FVT8JiqdzOGMeSAwBriUN3I/tKGhNO7pHGEHmnXh6wazEPQkA3CkHyAVXw== 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=TqPS9kDW; 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 2F933606A33A for ; Sat, 5 Dec 2026 16:10:09 +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=TqPS9kDW Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC6FF1F00A12; Sat, 5 Dec 2026 16:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796487009; bh=+WuBovkobssujkTnt4NChI5Cdw2fmyLOwUC1tS7vUfE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TqPS9kDWVM2tcXZDCZ/WO1qRfkWC0iX7ncAeHgFoLHvLPIe7Zu6VOifWWox7kz1sK EDVbM3VMrti4tPtX0cOkPAx+OWZq5Sdav2UldhvuTFhVGvj+sfsyRhuoTky/MrDcGG /eekja74DM+gfZvGNzmQToS1dghd0YcNAow+n9Isk7aTSFClM+1BnYVaAGBrZRGjWP RC3rk9M1ygEBE4DjXM8BqpRMszN/UqEm6P/IIFII6mHRUk8niEiAO2J2xaH2BQvQgc VXiPGyLcZyoMun9hIjGmStsaO3DKHMAZLVplbEfYtXA74X/UtByYVYu+lR9G3gie0V 08RJz2E3nTVCg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RDMA v2 05/13] RDMA/bng_re: Add GID verbs Reply-To: sashiko-reviews@lists.linux.dev To: "Siva Reddy Kallam" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261204155249.1002019-6-siva.kallam@broadcom.com> References: <20261204155249.1002019-1-siva.kallam@broadcom.com> <20261204155249.1002019-6-siva.kallam@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 16:10:08 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] RDMA/bng_re: bng_sp_add_sgid() ignores source MAC during SGID deduplication - [Medium] RDMA/bng_re: bng_sp_del_sgid() leaves cmdq_delete_gid.host_gid_index unset -- commit e8609d412a7d5ef6891fa0552518f46fa0e772cb Author: Sachin Holla RDMA/bng_re: Add GID verbs This commit adds the bng_re_add_gid and bng_re_del_gid verbs along with SGID table allocation, cleanup, and firmware ADD_GID/DELETE_GID helpers. > diff --git a/drivers/infiniband/hw/bng_re/bng_sp.c b/drivers/infiniband/h= w/bng_re/bng_sp.c > index 622cba5e4927e..83921f23a4230 100644 > --- a/drivers/infiniband/hw/bng_re/bng_sp.c > +++ b/drivers/infiniband/hw/bng_re/bng_sp.c [ ... ] > +int bng_sp_add_sgid(struct bng_re_sgid_tbl *sgid_tbl, > + struct bng_re_gid *gid, const u8 *smac, u16 vlan_id, > + bool update, u32 *index, bool is_ugid, u32 stats_ctx_id) > +{ > + struct bng_re_res *res =3D to_bng_re_res(sgid_tbl, sgid_tbl); > + struct bng_re_dev *rdev =3D to_bng_re_dev(res, bng_res); > + int i, free_idx; > + > + free_idx =3D sgid_tbl->max; > + for (i =3D 0; i < sgid_tbl->max; i++) { > + if (!memcmp(&sgid_tbl->tbl[i].gid, gid, sizeof(*gid)) && > + sgid_tbl->tbl[i].vlan_id =3D=3D vlan_id) { > + dev_dbg(&res->pdev->dev, > + "SGID entry already exist in entry %d!\n", > + i); > + *index =3D i; > + return -EALREADY; > + } [Severity: Medium] Should bng_sp_add_sgid() also compare smac before returning -EALREADY? struct bng_re_gid_info only stores gid and vlan_id, even though bng_sp_add_sgid() programs smac into req.src_mac in the firmware ADD_GID command. When bng_re_add_gid() gets -EALREADY, it increments refcnt and shares the existing slot without checking the MAC address. Because ib_core allows distinct GID entries per netdev (such as macvlan upper devices on the same port), two interfaces with different MAC addresses configured with the same IP and VLAN ID will alias onto the same hardware GID slot. The second interface then sends RoCE traffic with the first interface's source MAC, breaking L2 connectivity and MAC isolation. Storing smac in struct bng_re_gid_info and comparing it here avoids the aliasing. [ ... ] > +int bng_sp_del_sgid(struct bng_re_sgid_tbl *sgid_tbl, u32 index, bool up= date) [ ... ] > + bng_re_rcfw_cmd_prep((struct cmdq_base *)&req, > + CMDQ_BASE_OPCODE_DELETE_GID, sizeof(req)); > + req.gid_index =3D cpu_to_le16(hw_id); > + bng_re_fill_cmdqmsg(&msg, &req, &resp, NULL, > + sizeof(req), sizeof(resp), 0); [Severity: Medium] Does bng_sp_del_sgid() also need to set req.host_gid_index to cpu_to_le16(index)? struct cmdq_delete_gid defines host_gid_index alongside gid_index, and bng_sp_add_sgid() populates req.host_gid_index =3D cpu_to_le16(free_idx). Leaving req.host_gid_index as 0 on every DELETE_GID command creates an asymmetry whenever a non-zero SGID slot is deleted. If firmware validates or tracks host_gid_index during deletion, removing non-zero entries will fail and leak firmware GIDs, or corrupt host-index tracking for slot 0. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204155249.1002= 019-1-siva.kallam@broadcom.com?part=3D5