hv_netvsc: automatically name slave VF network device
Subsystems (3)
PATCH v2 1/1 hv_netvsc: automatically name slave VF network device
Rename the VF device to ethX_vf based on the ethX as the synthetic device. This eliminates the need for delay on setup, and the PCI (udev based) naming is not reproducible on Hyper-V anyway. The name of the VF does not matter since all control operations take place the primary device. It does make the user experience better to associate the names.
Based on feedback from all.systems.go talk.
---
v2 - also handle case where synthetic device gets renamed
and the case where rename causes clash with pre-existing device name
drivers/net/hyperv/hyperv_net.h | 1 - drivers/net/hyperv/netvsc_drv.c | 84 +++++++++++++++++++++-------------------- net/core/dev.c | 1 + 3 files changed, 44 insertions(+), 42 deletions(-)
drivers/net/hyperv/hyperv_net.h +0 -1
@@ -762,7 +762,6 @@ struct net_device_context {/* State to manage the associated VF interface. */ struct net_device __rcu *vf_netdev;struct netvsc_vf_pcpu_stats __percpu *vf_stats; -struct delayed_work vf_takeover;/* 1: allocated, serial number is valid. 0: not allocated */ u32 vf_alloc;
drivers/net/hyperv/netvsc_drv.c +43 -41
146 lines not on this page · raw message
net/core/dev.c +1 -0
@@ -1238,6 +1238,7 @@ int dev_change_name(struct net_device *dev, const char *newname)return err; } +EXPORT_SYMBOL (dev_change_name);/** * dev_set_alias - change ifalias of a device
Signature · 1 line
2.11.0
Quoted 10 lines · Stephen Hemminger
Rename the VF device to
ethX_vfbased on the ethX as the synthetic device. This eliminates the need for delay on setup, and the PCI (udev based) naming is not reproducible on Hyper-V anyway. The name of the VF does not matter since all control operations take place the primary device. It does make the user experience better to associate the names.Based on feedback from all.systems.go talk.
Signed-off-by Stephen Hemminger <[email protected]>
I think you must have hit send before seeing my last reply on v1...
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Tue, 19 Dec 2017 15:59:30 -0800
Quoted 7 lines
Rename the VF device to
ethX_vfbased on the ethX as the synthetic device. This eliminates the need for delay on setup, and the PCI (udev based) naming is not reproducible on Hyper-V anyway. The name of the VF does not matter since all control operations take place the primary device. It does make the user experience better to associate the names.
Quoted 6 lines
Based on feedback from all.systems.go talk.
Signed-off-by Stephen Hemminger <[email protected]>---
v2 - also handle case where synthetic device gets renamed
and the case where rename causes clash with pre-existing device name
Besides Jakub's objections (which I agree with) it is just so unexpected that changing the name of device X has the side effect of changing the name of device Y.
This is why we do this policy stuff in userspace. The kernel has no business messing with these netdev names.
This patch means that if a user decides to add his own custom udev rules for the VF (for whatever reason, it doesn't have to make sense to you or me) we're just going to undo them. That's bad.