• Yufeng Mo's avatar
    net: hns3: not allow SSU loopback while execute ethtool -t dev · dd2956ea
    Yufeng Mo authored
    The current loopback mode is to add 0x1F to the SMAC address
    as the DMAC address and enable the promiscuous mode.
    However, if the VF address is the same as the DMAC address,
    the loopback test fails.
    
    Loopback can be enabled in three places: SSU, MAC, and serdes.
    By default, SSU loopback is enabled, so if the SMAC and the DMAC
    are the same, the packets are looped back in the SSU. If SSU loopback
    is disabled, packets can reach MAC even if SMAC is the same as DMAC.
    
    Therefore, this patch disables the SSU loopback before the loopback
    test. In this way, the SMAC and DMAC can be the same, and the
    promiscuous mode does not need to be enabled. And this is not
    valid in version 0x20.
    
    This patch also uses a macro to replace 0x1F.
    
    Fixes: c39c4d98 ("net: hns3: Add mac loopback selftest support in hns3 driver")
    Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
    Reviewed-by: default avatarPeng Li <lipeng321@huawei.com>
    Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    dd2956ea
hclge_main.h 27 KB