On Sun, Jan 24, 2021 at 11:29 AM Vladimir Oltean <olte...@gmail.com> wrote: > > On Fri, Jan 22, 2021 at 09:59:47AM -0600, George McCollister wrote: > > diff --git a/net/dsa/slave.c b/net/dsa/slave.c > > index f2fb433f3828..fc7e3ff11c5c 100644 > > --- a/net/dsa/slave.c > > +++ b/net/dsa/slave.c > > @@ -1924,6 +1924,19 @@ static int dsa_slave_changeupper(struct net_device > > *dev, > > dsa_port_lag_leave(dp, info->upper_dev); > > err = NOTIFY_OK; > > } > > + } else if (netif_is_hsr_master(info->upper_dev)) { > > + if (info->linking) { > > + err = dsa_port_hsr_join(dp, info->upper_dev); > > + if (err == -EOPNOTSUPP) { > > + NL_SET_ERR_MSG_MOD(info->info.extack, > > + "Offloading not > > supported"); > > + err = 0; > > + } > > + err = notifier_from_errno(err); > > + } else { > > + dsa_port_hsr_leave(dp, info->upper_dev); > > + err = NOTIFY_OK; > > + } > > } > > How is the RedBox use case handled with the Linux hsr driver (i.e. a > HSR-unaware SAN endpoint attached to a HSR ring)? I would expect > something like this: > > +---------+ > | | > | SAN | > | | > +---------+ > | > | > | > +-----------------+---------+------------------+ > | | | | > | Your | swp0 | | > | board | | | > | +---------+ | > | | ^ | > | | | | > | | | br0 | > | | | | > | v | | > | +-----------------------------+ | > | | | | > | | hsr0 | | > | | | | > | +---------+---------+---------+ | > | | | | | | > | | swp1 | DAN-H | swp2 | | > | | | | | | > +-------+---------+---------+---------+--------+ > | ^ | ^ > to/from | | | | to/from > ring | | | | ring > v | v | > > Therefore, aren't you interested in offloading this setup as well? > I.e. the case where the hsr0 interface joins a bridge that also > contains other DSA switch ports. This would be similar to the LAG > offload recently added by Tobias.
I'm familiar with this use case but I don't currently need to support it on products I'm working on and in fact my hardware doesn't support it because the fourth switch port isn't brought out on the boards. I've also never tested it in software. I suppose when an hsr is bridged with a non-HSR switch port it would need to figure out the hsr redundancy interfaces are on the same switch and configure the forwarding accordingly. It's also worth noting that on switches which don't support automatic insertion/deletion of the HSR/PRP tag (like the ksz9477 I think) this wouldn't be possible. If someone has hardware that supports this and wants to work with me to add support for it I'd certainly be open to it. Adding support for this in the future if demand arises seems like the best plan given what I have to work with.