Subject: Re: [PATCH v4] net: hsr: Provide RedBox support (HSR-SAN)

From: Casper Andersson <[email-masked]>
Date: Wed, 03 Apr 2024 20:03:22 +0200

Hi,

Out of curiosity, are you planning to implement the remaining RedBox
modes too (PRP-SAN, HSR-HSR, HSR-PRP)?

On 2024-04-02 10:58 +0200, Lukasz Majewski wrote:
> Changes for v3:
>
> - Modify frame passed Port C (Interlink) to have RedBox's source address (SA)
>   This fixes issue with connecting L2 switch to Interlink Port as switches
>   drop frames with SA other than one registered in their (internal) routing
>   tables.

> +	/* When HSR node is used as RedBox - the frame received from HSR ring
> +	 * requires source MAC address (SA) replacement to one which can be
> +	 * recognized by SAN devices (otherwise, frames are dropped by switch)
> +	 */
> +	if (port->type == HSR_PT_INTERLINK)
> +		ether_addr_copy(eth_hdr(skb)->h_source,
> +				port->hsr->macaddress_redbox);

I'm not really understanding the reason for this change. Can you explain
it in more detail? The standard does not say to modify the SA. However,
it also does not say to *not* modify it in HSR-SAN mode like it does in
other places. In HSR-HSR and HSR-PRP mode modifying SA breaks the
duplicate discard. So keeping the same behavior for all modes would be
ideal.

I imagine any HW offloaded solutions will not modify the SA, so if
possible the SW should also behave as such.

BR,
Casper