Message ID | 20230922133108.2090612-4-lukma@denx.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 5e5db71a92c537ff37149b58bba6a8b2588a46f0 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: dsa: hsr: Enable HSR HW offloading for KSZ9477 | expand |
diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index ea100bd25939..3632e47dea9e 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -293,6 +293,14 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb, if (is_link_local_ether_addr(hdr->h_dest)) val |= KSZ9477_TAIL_TAG_OVERRIDE; + if (dev->features & NETIF_F_HW_HSR_DUP) { + struct net_device *hsr_dev = dp->hsr_dev; + struct dsa_port *other_dp; + + dsa_hsr_foreach_port(other_dp, dp->ds, hsr_dev) + val |= BIT(other_dp->index); + } + *tag = cpu_to_be16(val); return ksz_defer_xmit(dp, skb);