twx-linux/include/uapi/linux
Tom Gundersen 685343fc3b net: add name_assign_type netdev attribute
Based on a patch by David Herrmann.

The name_assign_type attribute gives hints where the interface name of a
given net-device comes from. These values are currently defined:
  NET_NAME_ENUM:
    The ifname is provided by the kernel with an enumerated
    suffix, typically based on order of discovery. Names may
    be reused and unpredictable.
  NET_NAME_PREDICTABLE:
    The ifname has been assigned by the kernel in a predictable way
    that is guaranteed to avoid reuse and always be the same for a
    given device. Examples include statically created devices like
    the loopback device and names deduced from hardware properties
    (including being given explicitly by the firmware). Names
    depending on the order of discovery, or in any other way on the
    existence of other devices, must not be marked as PREDICTABLE.
  NET_NAME_USER:
    The ifname was provided by user-space during net-device setup.
  NET_NAME_RENAMED:
    The net-device has been renamed from userspace. Once this type is set,
    it cannot change again.
  NET_NAME_UNKNOWN:
    This is an internal placeholder to indicate that we yet haven't yet
    categorized the name. It will not be exposed to userspace, rather
    -EINVAL is returned.

The aim of these patches is to improve user-space renaming of interfaces. As
a general rule, userspace must rename interfaces to guarantee that names stay
the same every time a given piece of hardware appears (at boot, or when
attaching it). However, there are several situations where userspace should
not perform the renaming, and that depends on both the policy of the local
admin, but crucially also on the nature of the current interface name.

If an interface was created in repsonse to a userspace request, and userspace
already provided a name, we most probably want to leave that name alone. The
main instance of this is wifi-P2P devices created over nl80211, which currently
have a long-standing bug where they are getting renamed by udev. We label such
names NET_NAME_USER.

If an interface, unbeknown to us, has already been renamed from userspace, we
most probably want to leave also that alone. This will typically happen when
third-party plugins (for instance to udev, but the interface is generic so could
be from anywhere) renames the interface without informing udev about it. A
typical situation is when you switch root from an installer or an initrd to the
real system and the new instance of udev does not know what happened before
the switch. These types of problems have caused repeated issues in the past. To
solve this, once an interface has been renamed, its name is labelled
NET_NAME_RENAMED.

In many cases, the kernel is actually able to name interfaces in such a
way that there is no need for userspace to rename them. This is the case when
the enumeration order of devices, or in fact any other (non-parent) device on
the system, can not influence the name of the interface. Examples include
statically created devices, or any naming schemes based on hardware properties
of the interface. In this case the admin may prefer to use the kernel-provided
names, and to make that possible we label such names NET_NAME_PREDICTABLE.
We want the kernel to have tho possibilty of performing predictable interface
naming itself (and exposing to userspace that it has), as the information
necessary for a proper naming scheme for a certain class of devices may not
be exposed to userspace.

The case where renaming is almost certainly desired, is when the kernel has
given the interface a name using global device enumeration based on order of
discovery (ethX, wlanY, etc). These naming schemes are labelled NET_NAME_ENUM.

Lastly, a fallback is left as NET_NAME_UNKNOWN, to indicate that a driver has
not yet been ported. This is mostly useful as a transitionary measure, allowing
us to label the various naming schemes bit by bit.

v8: minor documentation fixes
v9: move comment to the right commit

Signed-off-by: Tom Gundersen <teg@jklm.no>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-15 16:12:01 -07:00
..
byteorder
caif
can can: unify identifiers to ensure unique include processing 2014-05-19 09:38:24 +02:00
cifs cifs: Move and expand MAX_SERVER_SIZE definition 2013-09-08 14:34:22 -05:00
dvb
genwqe GenWQE PCI support, health monitoring and recovery 2013-12-18 16:51:15 -08:00
hdlc
hsi
isdn
mmc
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2014-05-30 17:54:47 -07:00
netfilter_arp
netfilter_bridge uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
netfilter_ipv4 uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
netfilter_ipv6
nfsd nfsd: clean up fh_auth usage 2014-05-08 12:43:03 -04:00
raid md: Change handling of save_raid_disk and metadata update during recovery. 2014-01-14 16:44:21 +11:00
spi spi: spidev: Add support for Dual/Quad SPI Transfers 2014-02-27 13:51:29 +09:00
sunrpc
tc_act net_sched: act: pick a different type for act_xt 2014-01-16 17:24:11 -08:00
tc_ematch
usb USB: cdc-wdm: properly include types.h 2014-05-27 16:32:10 -07:00
wimax uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
a.out.h
acct.h
adb.h
adfs_fs.h
affs_hardblocks.h
agpgart.h
aio_abi.h
apm_bios.h apm-emulation: add hibernation APM events to support suspend2disk 2014-01-07 13:50:28 +01:00
arcfb.h
atalk.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_tcp.h
atm_zatm.h
atm.h
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
audit.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-03 23:32:12 -07:00
auto_fs4.h
auto_fs.h
auxvec.h
ax25.h
b1lli.h
baycom.h
bcache.h bcache: Add bch_btree_keys_u64s_remaining() 2014-01-08 13:05:13 -08:00
bcm933xx_hcs.h
bfs_fs.h
binfmts.h
blkpg.h
blktrace_api.h
bpqether.h
bsg.h
btrfs.h btrfs: new ioctl TREE_SEARCH_V2 2014-06-13 09:52:19 -07:00
can.h can: unify identifiers to ensure unique include processing 2014-05-19 09:38:24 +02:00
capability.h audit: add netlink audit protocol bind to check capabilities on multicast join 2014-04-22 21:42:27 -04:00
capi.h isdn: capi: fix "CAPI_VERSION" comment 2014-03-20 14:55:18 +01:00
cciss_defs.h
cciss_ioctl.h
cdrom.h
cgroupstats.h
chio.h
cm4000_cs.h Omnikey Cardman 4000: pull in ioctl.h in user header 2013-08-28 19:26:38 -07:00
cn_proc.h
coda_psdev.h
coda.h
coff.h
connector.h
const.h
cramfs_fs.h
cuda.h
cyclades.h
cycx_cfm.h
dcbnl.h
dccp.h
dlm_device.h
dlm_netlink.h
dlm_plock.h
dlm.h
dlmconstants.h
dm-ioctl.h dm: allow remove to be deferred 2013-11-09 18:20:22 -05:00
dm-log-userspace.h dm log userspace: allow mark requests to piggyback on flush requests 2014-01-21 23:46:27 -05:00
dn.h include/uapi/linux/dn.h: pull in ioctl.h header 2014-01-23 16:36:55 -08:00
dqblk_xfs.h quota: Add a new quotactl command Q_XGETQSTATV 2013-08-20 16:53:58 -05:00
edd.h
efs_fs_sb.h
elf-em.h Drop remaining references to H8/300 architecture 2013-09-16 18:20:24 -07:00
elf-fdpic.h
elf.h
elfcore.h
errno.h
errqueue.h
ethtool.h ethtool: Improve explanation of the two arrays following struct ethtool_rxfh 2014-05-19 01:19:30 +01:00
eventpoll.h epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled 2013-12-03 15:35:52 +01:00
fadvise.h
falloc.h fs: Introduce FALLOC_FL_ZERO_RANGE flag for fallocate 2014-03-13 19:07:42 +11:00
fanotify.h
fb.h
fcntl.h
fd.h floppy: bail out in open() if drive is not responding to block0 read 2014-01-17 11:12:06 +01:00
fdreg.h
fib_rules.h fib_rules: fix suppressor names and default values 2013-08-03 10:40:23 -07:00
fiemap.h ext4: add support for extent pre-caching 2013-08-16 22:05:14 -04:00
filter.h filter: added BPF random opcode 2014-04-22 21:27:57 -04:00
firewire-cdev.h firewire: fix libdc1394/FlyCap2 iso event regression 2013-07-27 20:24:36 +02:00
firewire-constants.h
flat.h
fs.h vfs: add cross-rename 2014-04-01 17:08:43 +02:00
fsl_hypervisor.h
fuse.h fuse: add renameat2 support 2014-04-28 16:43:44 +02:00
futex.h
gameport.h
gen_stats.h
genetlink.h genetlink/pmcraid: use proper genetlink multicast API 2013-11-28 18:26:30 -05:00
gfs2_ondisk.h GFS2: remove transaction glock 2014-05-14 10:04:34 +01:00
gigaset_dev.h
hash_info.h crypto: provide single place for hash algo information 2013-10-25 17:14:03 -04:00
hdlc.h
hdlcdrv.h
hdreg.h
hid.h
hiddev.h
hidraw.h
hpet.h
hsr_netlink.h net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0) 2013-11-03 23:20:14 -05:00
hw_breakpoint.h
hyperv.h Tools: hv: Handle the case when the target file exists correctly 2014-04-16 14:10:36 -07:00
hysdn_if.h
i2c-dev.h
i2c.h
i2o-dev.h
i8k.h
icmp.h
icmpv6.h ICMPv6: treat dest unreachable codes 5 and 6 as EACCES, not EPROTO 2013-09-03 22:11:44 -04:00
if_addr.h ipv6 addrconf: add IFA_F_NOPREFIXROUTE flag to suppress creation of IP6 routes 2014-01-15 17:00:40 -08:00
if_addrlabel.h
if_alg.h
if_arcnet.h
if_arp.h net: if_arp: add ARPHRD_6LOWPAN type 2013-12-11 12:57:55 -08:00
if_bonding.h bonding: modify the old and add new xmit hash policies 2013-10-03 15:36:38 -04:00
if_bridge.h uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
if_cablemodem.h
if_eql.h
if_ether.h ether: add loopback type ETH_P_LOOPBACK 2014-03-14 22:20:57 -04:00
if_fc.h
if_fddi.h FDDI: Reformat <linux/if_fddi.h> for 8-character tabs 2014-04-27 19:08:06 -04:00
if_frad.h
if_hippi.h
if_infiniband.h
if_link.h ipv6: addrconf: implement address generation modes 2014-07-11 15:05:45 -07:00
if_ltalk.h
if_packet.h af_packet: Add Queue mapping mode to af_packet fanout operation 2014-01-22 17:35:50 -08:00
if_phonet.h
if_plip.h
if_ppp.h
if_pppol2tp.h
if_pppox.h pptp: fix byte order warnings 2013-08-13 15:10:22 -07:00
if_slip.h
if_team.h
if_tun.h tun: Get skfilter layout 2013-08-21 12:21:45 -07:00
if_tunnel.h ip_vti: fix sparse warnings for VTI_ISVTI 2014-06-11 15:39:19 -07:00
if_vlan.h
if_x25.h
if.h net: move net_device priv_flags out from UAPI 2014-02-27 15:59:09 -05:00
igmp.h
in6.h ipv6: Implement automatic flow label generation on transmit 2014-07-07 21:14:21 -07:00
in_route.h
in.h ipv4: yet another new IP_MTU_DISCOVER option IP_PMTUDISC_OMIT 2014-02-26 15:51:00 -05:00
inet_diag.h
inotify.h
input.h Merge branches 'for-3.16/i2c-hid', 'for-3.16/rmi4', 'for-3.16/sony' and 'for-3.16/thingm' into for-linus 2014-06-04 13:09:43 +02:00
ioctl.h
ip6_tunnel.h
ip_vs.h ipvs: fix the IPVS_CMD_ATTR_MAX definition 2013-10-15 10:36:01 +09:00
ip.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-08-26 16:37:08 -04:00
ipc.h
ipmi_msgdefs.h
ipmi.h
ipsec.h
ipv6_route.h
ipv6.h ipv6: Allow accepting RA from local IP addresses. 2014-07-01 12:16:24 -07:00
ipx.h
irda.h
irqnr.h
isdn_divertif.h
isdn_ppp.h
isdn.h
isdnif.h
iso_fs.h
ivtv.h
ivtvfb.h
ixjuser.h
jffs2.h
joystick.h
Kbuild ARM/ARM64: KVM: Add common header for PSCI related defines 2014-04-30 04:18:57 -07:00
kd.h
kdev_t.h
kernel-page-flags.h
kernel.h
kernelcapi.h
kexec.h m68k: Add kexec support 2013-12-08 11:01:47 +01:00
keyboard.h
keyctl.h KEYS: Add per-user_namespace registers for persistent per-UID kerberos caches 2013-09-24 10:35:19 +01:00
kvm_para.h MIPS: Add functions for hypervisor call 2014-05-30 21:01:11 +02:00
kvm.h Patch queue for ppc - 2014-05-30 2014-05-30 14:51:40 +02:00
l2tp.h l2tp: Add support for zero IPv6 checksums 2014-05-23 16:28:53 -04:00
libc-compat.h xattr: guard against simultaneous glibc header inclusion 2014-04-03 16:21:06 -07:00
limits.h
llc.h
loop.h
lp.h
magic.h Btrfs: add tests for find_lock_delalloc_range 2013-11-11 21:56:51 -05:00
major.h mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
map_to_7segment.h
matroxfb.h
mdio.h
media.h [media] media: Add pad flag MEDIA_PAD_FL_MUST_CONNECT 2013-12-04 14:59:20 -02:00
mei.h
mempolicy.h
meye.h
mic_common.h misc: mic: Fix endianness issues. 2013-11-27 11:03:38 -08:00
mic_ioctl.h misc: mic: fix possible signed underflow (undefined behavior) in userspace API 2014-02-07 15:30:34 -08:00
mii.h
minix_fs.h
mman.h
mmtimer.h
module.h
mpls.h UAPI: add MPLS label stack definition 2014-03-04 13:51:06 -05:00
mqueue.h uapi: Use __kernel_long_t in struct mq_attr 2014-01-20 14:45:33 -08:00
mroute6.h
mroute.h
msdos_fs.h fatfs: add FAT_IOCTL_GET_VOLUME_ID 2013-07-09 10:33:25 -07:00
msg.h uapi: Use __kernel_long_t in struct msgbuf 2014-01-20 14:44:50 -08:00
mtio.h
n_r3964.h
nbd.h
ncp_fs.h
ncp_mount.h
ncp_no.h
ncp.h
neighbour.h bridge: Add bridge ifindex to bridge fdb notify msgs 2014-06-02 17:58:55 -07:00
net_dropmon.h
net_tstamp.h net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
net.h
netconf.h netconf: rename PROXY_ARP to NEIGH_PROXY 2013-12-22 18:02:43 -05:00
netdevice.h net: add name_assign_type netdev attribute 2014-07-15 16:12:01 -07:00
netfilter_arp.h
netfilter_bridge.h
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netfilter.h netfilter: nf_tables: add "inet" table for IPv4/IPv6 2014-01-07 23:57:25 +01:00
netlink_diag.h diag: warn about missing first netlink attribute 2013-11-28 18:16:43 -05:00
netlink.h
netrom.h
nfc.h NFC: Add RAW socket type support for SOCKPROTO_RAW 2014-05-20 00:06:04 +02:00
nfs2.h
nfs3.h
nfs4_mount.h
nfs4.h uapi: convert u64 to __u64 in exported headers 2014-01-23 16:36:55 -08:00
nfs_fs.h
nfs_idmap.h
nfs_mount.h NFS: stop using NFS_MOUNT_SECFLAVOUR server flag 2013-10-28 15:37:56 -04:00
nfs.h
nfsacl.h
nl80211.h cfg80211: pass TDLS initiator in tdls_mgmt operations 2014-06-23 14:24:55 +02:00
nubus.h
nvme.h NVMe: Define Log Page constants 2014-06-13 10:53:49 -04:00
nvram.h
omap3isp.h
omapfb.h
oom.h
openvswitch.h openvswitch: Avoid assigning a NULL pointer to flow actions. 2014-05-22 16:27:34 -07:00
packet_diag.h diag: warn about missing first netlink attribute 2013-11-28 18:16:43 -05:00
param.h
parport.h
patchkey.h
pci_regs.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
pci.h
perf_event.h perf: Pass protection and flags bits through mmap2 interface 2014-06-09 12:21:04 +02:00
personality.h
pfkeyv2.h ipsec: add support of limited SA dump 2014-02-17 07:18:19 +01:00
pg.h
phantom.h
phonet.h
pkt_cls.h net: sched: cls_bpf: add BPF-based classifier 2013-10-29 17:33:17 -04:00
pkt_sched.h net: pkt_sched: PIE AQM scheme 2014-01-06 15:13:01 -05:00
pktcdvd.h
pmu.h
poll.h
posix_types.h
ppdev.h
ppp_defs.h
ppp-comp.h
ppp-ioctl.h include/uapi/linux/ppp-ioctl.h: pull in ppp_defs.h 2014-01-23 16:36:55 -08:00
pps.h
prctl.h mm, thp: add VM_INIT_DEF_MASK and PRCTL_THP_DISABLE 2014-04-07 16:35:52 -07:00
psci.h ARM/ARM64: KVM: Add common header for PSCI related defines 2014-04-30 04:18:57 -07:00
ptp_clock.h ptp: introduce programmable pins. 2014-03-21 14:21:13 -04:00
ptrace.h
qnx4_fs.h
qnxtypes.h
quota.h
radeonfb.h
random.h random32: move rnd_state to linux/random.h 2013-11-11 14:32:14 -05:00
raw.h
rds.h
reboot.h
reiserfs_fs.h
reiserfs_xattr.h xattr: Constify ->name member of "struct xattr". 2013-07-25 19:30:03 +10:00
resource.h uapi: Use __kernel_long_t/__kernel_ulong_t in <linux/resource.h> 2014-01-20 14:44:17 -08:00
rfkill.h
romfs_fs.h
rose.h
route.h
rtc.h
rtnetlink.h
scc.h
sched.h sched: Move SCHED_RESET_ON_FORK into attr::sched_flags 2014-01-16 09:27:17 +01:00
screen_info.h
sctp.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
sdla.h
seccomp.h
securebits.h
selinux_netlink.h
sem.h
serial_core.h serial: sc16is7xx 2014-04-25 10:08:48 -07:00
serial_reg.h serial: fix UART_IIR_ID 2014-04-24 16:16:33 -07:00
serial.h
serio.h
shm.h ipc,shm: document new limits in the uapi header 2014-06-06 16:08:14 -07:00
signal.h
signalfd.h
snmp.h tcp: snmp stats for Fast Open, SYN rtx, and data pkts 2014-03-03 15:58:03 -05:00
sock_diag.h
socket.h
sockios.h net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
som.h
sonet.h
sonypi.h
sound.h
soundcard.h
stat.h
stddef.h
string.h
suspend_ioctls.h
swab.h
synclink.h
sysctl.h ipv6: Allow accepting RA from local IP addresses. 2014-07-01 12:16:24 -07:00
sysinfo.h
taskstats.h
tcp_metrics.h tcp: switch rtt estimations to usec resolution 2014-02-26 17:08:40 -05:00
tcp.h tcp: add pacing_rate information into tcp_info 2014-02-14 16:09:43 -05:00
telephony.h
termios.h
time.h
times.h
timex.h uapi: Use __kernel_long_t in struct timex 2014-01-20 14:44:05 -08:00
tiocl.h
tipc_config.h tipc: bump max configurable window size 2014-06-25 18:03:41 -07:00
tipc.h tipc: add ioctl to fetch link names 2014-04-26 12:13:24 -04:00
toshiba.h
tty_flags.h
tty.h
types.h
udf_fs_i.h
udp.h net: Make enabling of zero UDP6 csums more restrictive 2014-05-23 16:28:53 -04:00
uhid.h HID: uhid: Add UHID_CREATE2 + UHID_INPUT2 2014-04-01 18:27:33 +02:00
uinput.h Input: uinput - add UI_GET_SYSNAME ioctl to retrieve the sysfs path 2014-02-12 15:00:34 -08:00
uio.h
ultrasound.h
un.h
unistd.h
unix_diag.h diag: warn about missing first netlink attribute 2013-11-28 18:16:43 -05:00
usbdevice_fs.h usbfs: Add support for allocating / freeing streams 2014-03-04 15:38:05 -08:00
utime.h
utsname.h
uuid.h
uvcvideo.h
v4l2-common.h [media] v4l2-common.h: remove __user annotation in struct v4l2_edid 2014-04-16 18:20:02 -03:00
v4l2-controls.h [media] v4l: add control for RF tuner PLL lock flag 2014-03-13 10:26:49 -03:00
v4l2-dv-timings.h [media] v4l2-dv-timings.h: add CEA-861-F 4K timings 2014-04-16 18:27:08 -03:00
v4l2-mediabus.h [media] v4l: Add 12-bit YUV 4:2:2 media bus pixel codes 2014-05-13 13:48:29 -03:00
v4l2-subdev.h [media] v4l: Add support for DV timings ioctls on subdev nodes 2014-05-25 12:47:55 -03:00
veth.h
vfio.h vfio/type1: Add extension to test DMA cache coherence of IOMMU 2014-02-26 11:38:37 -07:00
vhost.h
videodev2.h [media] v4l: Add pad-level DV timings subdev operations 2014-05-25 12:37:57 -03:00
virtio_9p.h
virtio_balloon.h
virtio_blk.h
virtio_config.h virtio: VIRTIO_F_ANY_LAYOUT feature 2013-07-09 10:47:45 +09:30
virtio_console.h
virtio_ids.h
virtio_net.h uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
virtio_pci.h
virtio_ring.h
virtio_rng.h
vm_sockets.h
vsp1.h [media] v4l: vsp1: Add LUT support 2013-12-11 09:25:20 -02:00
vt.h
wait.h
wanrouter.h
watchdog.h
wimax.h
wireless.h
x25.h
xattr.h xattr: guard against simultaneous glibc header inclusion 2014-04-03 16:21:06 -07:00
xfrm.h xfrm: rename struct xfrm_filter 2014-03-07 08:12:37 +01:00
zorro_ids.h zorro/UAPI: Disintegrate include/linux/zorro*.h 2013-11-26 11:09:08 +01:00
zorro.h zorro/UAPI: Use proper types (endianness/size) in <linux/zorro.h> 2013-11-26 11:09:09 +01:00