net: ti: prueth_core: hsr/prp: add ethtool command to switch Ethenet type
PRUETH driver now supports Dual EMAC/HSR/PRP/SWITCH Ethernet types.
The user requires to switch between these Ethernet types at run time
without rebooting the device. This patch introduces Ethtool -K option to
switch the Ethernet types between Dual EMAC/HSR/PRP Ethernet types.
User first bring down the interface and then set the HSR or PRP offload
flag in the Ethernet device using ethtool -K option. Then bring up the
Ethernet interfaces and setup the HSR/PRP interface using ip link command.
For example to Switch from Dual EMAC to HSR, user do
ifconfig eth2 down
ifconfig eth3 down
ifconfig eth2 hw ether <MAC Addr>
ifconfig eth3 hw ether <MAC Addr>
ethtool -K eth2 hsr-rx-offload on
ethtool -K eth3 hsr-rx-offload on
Now ready to create hsr interface as
ip link add name hsr0 type hsr slave1 eth2 slave2 eth3 supervision 45
version 1
Similarly to switch from Dual EMAC to prp user do similar steps
ifconfig eth2 down
ifconfig eth3 down
ifconfig eth2 hw ether <MAC Addr>
ifconfig eth3 hw ether <MAC Addr>
ethtool -K eth2 prp-rx-offload on
ethtool -K eth3 prp-rx-offload on
ip link add name prp0 type hsr slave1 eth2 slave2 eth3 supervision 45
proto 1
To switch back to Dual EMAC, user clear the respective flags through
ethtool command and bring up the interface. Switching between HSR and
PRP is done in a similar way. First needs to reset the existing flag
and then set the new flag before creating the hsr/prp interface.
User is not allowed to switch between Switch and HSR/PRP. To switch,
user first needs to change to Dual EMAC eth type and then do the
switching of ethtype. Driver continues to support the existing method
for switching between Dual EMAC and Switch eth types.
Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
Please register or sign in to comment