Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Setting `ds->max_num_bridges = 1` restricts system-wide bridge allocation and fails to reject a second bridge.
--
--- Patch [17]: [PATCH 17/20] net: dsa: xilinx: opt into TX forwarding offload on bridge join ---
commit 966c03a5b5314441d2f4752f9cd9e4603af2f3e5
Author: Nagadheeraj Rottela <[email protected]>
net: dsa: xilinx: opt into TX forwarding offload on bridge join
This commit sets tx_fwd_offload to true in port_bridge_join to let the
fabric handle per-port replication. It also sets ds->max_num_bridges to 1
with the intention of rejecting a second bridge.
> diff --git a/drivers/net/dsa/xilinx/xilinx_tsn.c b/drivers/net/dsa/xilinx/xilinx_tsn.c
> --- a/drivers/net/dsa/xilinx/xilinx_tsn.c
> +++ b/drivers/net/dsa/xilinx/xilinx_tsn.c
[ ... ]
> @@ -786,6 +800,9 @@ static int xlnx_tsn_probe(struct platform_device *pdev)
> ds->phylink_mac_ops = &xlnx_tsn_phylink_mac_ops;
> ds->priv = sw;
>
> + /* The fabric offloads a single bridge across the user ports. */
> + ds->max_num_bridges = 1;
[Severity: High]
Will setting ds->max_num_bridges to 1 cause system-wide bridge allocation
issues or silent hardware merging?
In a multi-switch system where another switch has already allocated bridge
ID 1, dsa_bridge_num_get() will assign ID 2. Since 2 is greater than
max_num_bridges, it fails with -EOPNOTSUPP, preventing this switch from
offloading even its first bridge.
Furthermore, if a user creates a second bridge, dsa_port_bridge_create()
returns -EOPNOTSUPP. In dsa_user_changeupper(), this error is masked to 0,
which allows the OS to bridge the port in software. Since the hardware
lacks isolation and will continue to flood packets across all ports, does
this silently merge the two networks?
> +
> platform_set_drvdata(pdev, sw);
>
> return dsa_register_switch(ds);
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=17
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.