No, HBG_NIC_STATE_OPEN is not intended to ensure that hbg_net_open() andThat is an invalid assumption. You could be receiving line rate
hbg_net_stop() are mutually exclusive.
Actually, when the driver do reset or self-test(ethtool -t or ethtool --reset or FLR).
We hope that no other data is transmitted or received at this time.
broadcast traffic for example, because there is a broadcast storm
happening.
I assume for testing, you are configuring a loopback somewhere? PHY
loopback or PCS loopback? I've seen some PHYs do 'broken' loopback
where egress traffic is looped back, but ingress traffic is also still
received. Is this true for your hardware? Is this why you make this
assumption?
What is your use case for ethtool --reset? Are you working around
hardware bugs? Why not simply return -EBUSY if the user tries to use
--reset when the interface is admin up. You then know the interface is
down, you don't need open/close to be re-entrant safe.
Same for testing. Return -ENETDOWN if the user tries to do self test
on an interface which is admin down.
Andrew