Re: [PATCH net-next v2 4/7] net: ti: icssg-prueth: Add support for HSR frame forward offload
From: Anwar, Md Danish
Date: Mon Aug 19 2024 - 06:51:57 EST
On 8/14/2024 8:24 PM, Anwar, Md Danish wrote:
>
>
> On 8/14/2024 7:32 PM, Andrew Lunn wrote:
>>> 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.
>>
Andrew, the functions are actually doing some configurations different
than EMAC mode which are needed for offloading the frames for switch as
well as HSR mode. icssg_init_emac_mode() doesn't do any configuration
related to offloading. Perhaps naming these APIs to
icssg_init_fw_offload_mode() will be a better fit?
Other Similar APIs can also be changed to use _fw_offload instead of
_switch. How does this sound?
> Sure Andrew, I will try to come up with a proper name for these APIs.
>
>>>>> 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
>
--
Thanks and Regards,
Md Danish Anwar