• V
    s390/qeth: avoid using is_multicast_ether_addr_64bits on (u8 *)[6] · 9d0a58fb
    Vasily Gorbik 提交于
    *ether_addr*_64bits functions have been introduced to optimize
    performance critical paths, which access 6-byte ethernet address as u64
    value to get "nice" assembly. A harmless hack works nicely on ethernet
    addresses shoved into a structure or a larger buffer, until busted by
    Kasan on smth like plain (u8 *)[6].
    
    qeth_l2_set_mac_address calls qeth_l2_remove_mac passing
    u8 old_addr[ETH_ALEN] as an argument.
    
    Adding/removing macs for an ethernet adapter is not that performance
    critical. Moreover is_multicast_ether_addr_64bits itself on s390 is not
    faster than is_multicast_ether_addr:
    
    is_multicast_ether_addr(%r2) -> %r2
    llc	%r2,0(%r2)
    risbg	%r2,%r2,63,191,0
    
    is_multicast_ether_addr_64bits(%r2) -> %r2
    llgc	%r2,0(%r2)
    risbg	%r2,%r2,63,191,0
    
    So, let's just use is_multicast_ether_addr instead of
    is_multicast_ether_addr_64bits.
    
    Fixes: bcacfcbc ("s390/qeth: fix MAC address update sequence")
    Reviewed-by: NJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    9d0a58fb
qeth_l2_main.c 67.3 KB