[PATCH net-next v2 4/7] net: ti: icssg-prueth: Add support for HSR frame forward offload
Andrew Lunn
andrew at lunn.ch
Wed Aug 14 07:02:30 PDT 2024
> Yes, the icssg_init_ and many other APIs are common for switch and hsr.
> They can be renamed to indicate that as well.
>
> How does icssg_init_switch_or_hsr_mode() sound?
I would say it is too long. And when you add the next thing, say
bonding, will it become icssg_init_switch_or_hsr_or_bond_mode()?
Maybe name the function after what it actually does, not why you call
it.
> >> static struct icssg_firmwares icssg_switch_firmwares[] = {
> >> {
> >> .pru = "ti-pruss/am65x-sr2-pru0-prusw-fw.elf",
> >> @@ -152,6 +168,8 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
> >>
> >> if (prueth->is_switch_mode)
> >> firmwares = icssg_switch_firmwares;
> >> + else if (prueth->is_hsr_offload_mode)
> >> + firmwares = icssg_hsr_firmwares;
> >
> > Documentation/networking/netdev-features.rst
> >
> > * hsr-fwd-offload
> >
> > This should be set for devices which forward HSR (High-availability Seamless
> > Redundancy) frames from one port to another in hardware.
> >
> > To me, this suggests if the flag is not set, you should keep in dual
> > EMACS or switchdev mode and perform HSR in software.
>
>
> Correct. This is the expected behavior. If the flag is not set we remain
> in dual EMAC firmware and do HSR in software. Please see
> prueth_hsr_port_link() for detail on this.
O.K.
Andrew
More information about the linux-arm-kernel
mailing list