linux/drivers/net/ethernet
Yufeng Mo dd2956eab1 net: hns3: not allow SSU loopback while execute ethtool -t dev
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: c39c4d98dc ("net: hns3: Add mac loopback selftest support in hns3 driver")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Reviewed-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-29 16:57:44 -07:00
..
3com net: 3com: 3c59x: Use dev_get_drvdata 2019-07-23 13:02:41 -07:00
8390 net: 8390: Fix manufacturer name in Kconfig help text 2019-08-01 13:45:48 -04:00
adaptec
aeroflex Build fixes for skb_frag_size conversion 2019-07-24 11:46:03 -07:00
agere Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
alacritech
allwinner net: ethernet: sun4i-emac: Support phy-handle property for finding PHYs 2019-08-06 11:29:16 -07:00
alteon
altera
amazon
amd ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
apm net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
apple net: delete "register" keyword 2019-08-08 18:03:42 -07:00
aquantia
arc
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
aurora net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
broadcom bnxt_en: Fix allocation of zero statistics block size regression. 2019-08-24 16:34:41 -07:00
brocade net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
cadence
calxeda net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
chelsio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
cirrus cirrus: cs89x0: remove set but not used variable 'lp' 2019-08-25 19:48:59 -07:00
cisco
cortina net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
davicom net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
dec
dlink
emulex be2net: eliminate enable field from be_aic_obj 2019-08-18 14:14:33 -07:00
ezchip ezchip: nps_enet: use devm_platform_ioremap_resource() to simplify code 2019-08-21 13:42:13 -07:00
faraday net: ftgmac100: Select ASPEED MDIO driver for the AST2600 2019-08-02 17:56:28 -07:00
freescale dpaa2-eth: Add pause frame support 2019-08-29 16:52:12 -07:00
fujitsu
google gve: Copy and paste bug in gve_get_stats() 2019-08-21 20:50:26 -07:00
hisilicon net: hns3: not allow SSU loopback while execute ethtool -t dev 2019-08-29 16:57:44 -07:00
hp
huawei net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
i825xx
ibm ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
intel ice: fix adminq calls during remove 2019-08-26 23:54:29 -07:00
marvell pxa168_eth: use devm_platform_ioremap_resource() to simplify code 2019-08-21 13:52:33 -07:00
mediatek net: mediatek: remove set but not used variable 'status' 2019-08-27 20:47:56 -07:00
mellanox mlxsw: spectrum_ptp: Add counters for GC events 2019-08-28 18:24:04 -07:00
micrel ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
microchip ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
moxa
mscc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-27 14:23:31 -07:00
myricom Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
natsemi
neterion ethernet: remove redundant memset 2019-07-15 11:06:27 -07:00
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-27 14:23:31 -07:00
ni net: nixge: Spelling s/Instrument/Instruments/ 2019-08-01 13:45:49 -04:00
nuvoton net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
nvidia forcedeth: Use dev_get_drvdata where possible 2019-07-24 11:44:46 -07:00
nxp
oki-semi
packetengines ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
pasemi
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-27 14:23:31 -07:00
qualcomm ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
rdc
realtek r8169: improve DMA handling in rtl_rx 2019-08-26 14:33:28 -07:00
renesas ravb: Fix use-after-free ravb_tstamp_skb 2019-08-18 14:19:14 -07:00
rocker rocker: fix memory leaks of fib_work on two error return paths 2019-07-29 10:58:06 -07:00
samsung net: sxgbe: use devm_platform_ioremap_resource() to simplify code 2019-08-21 13:42:12 -07:00
seeq
sfc sfc: falcon: don't score irq moderation points for GRO 2019-08-08 18:22:29 -07:00
sgi ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
silan
sis sis900: add support for ethtool's EEPROM dump 2019-07-26 14:24:48 -07:00
smsc ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
socionext net: socionext: use devm_platform_ioremap_resource() to simplify code 2019-08-21 13:42:12 -07:00
stmicro net: stmmac: setup higher frequency clk support for EHL & TGL 2019-08-27 21:59:38 -07:00
sun ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
synopsys net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
tehuti net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-27 14:23:31 -07:00
toshiba net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx 2019-08-11 21:41:48 -07:00
tundra net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context 2019-08-08 22:43:34 -07:00
via via-rhine: use devm_platform_ioremap_resource() to simplify code 2019-08-21 13:42:12 -07:00
wiznet
xilinx
xircom
xscale net: ixp4xx: Spelling s/XSacle/XScale/ 2019-08-01 13:45:49 -04:00
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c net: Remove dev_err() usage after platform_get_irq() 2019-07-30 14:37:35 -07:00
Makefile
netx-eth.c