]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Mechanical cleanup of epoch(9) usage in network stack.
authorglebius <glebius@FreeBSD.org>
Wed, 9 Jan 2019 01:11:19 +0000 (01:11 +0000)
committerglebius <glebius@FreeBSD.org>
Wed, 9 Jan 2019 01:11:19 +0000 (01:11 +0000)
commit6d8cc191f953b3680c5e5911afc66b7c1f8e6c4b
treef5bb270ef868e474632d85d470c6f571f63fbe1a
parent2e6756f35d74ea04ef06e3db27679104018cecdd
Mechanical cleanup of epoch(9) usage in network stack.

- Remove macros that covertly create epoch_tracker on thread stack. Such
  macros a quite unsafe, e.g. will produce a buggy code if same macro is
  used in embedded scopes. Explicitly declare epoch_tracker always.

- Unmask interface list IFNET_RLOCK_NOSLEEP(), interface address list
  IF_ADDR_RLOCK() and interface AF specific data IF_AFDATA_RLOCK() read
  locking macros to what they actually are - the net_epoch.
  Keeping them as is is very misleading. They all are named FOO_RLOCK(),
  while they no longer have lock semantics. Now they allow recursion and
  what's more important they now no longer guarantee protection against
  their companion WLOCK macros.
  Note: INP_HASH_RLOCK() has same problems, but not touched by this commit.

This is non functional mechanical change. The only functionally changed
functions are ni6_addrs() and ni6_store_addrs(), where we no longer enter
epoch recursively.

Discussed with: jtl, gallatin
40 files changed:
sys/compat/linuxkpi/common/include/linux/inetdevice.h
sys/dev/wtap/if_wtap.c
sys/net/altq/altq_subr.c
sys/net/bridgestp.c
sys/net/if.c
sys/net/if_llatbl.c
sys/net/if_var.h
sys/net/if_vlan.c
sys/net/route.c
sys/net/rtsock.c
sys/netinet/if_ether.c
sys/netinet/igmp.c
sys/netinet/in.c
sys/netinet/in_mcast.c
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/ip_carp.c
sys/netinet/ip_divert.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet/ip_mroute.c
sys/netinet/ip_options.c
sys/netinet/ip_output.c
sys/netinet/netdump/netdump_client.c
sys/netinet/sctp_bsd_addr.c
sys/netinet6/icmp6.c
sys/netinet6/in6.c
sys/netinet6/in6_ifattach.c
sys/netinet6/in6_mcast.c
sys/netinet6/in6_pcb.c
sys/netinet6/in6_var.h
sys/netinet6/mld6.c
sys/netinet6/nd6.c
sys/netinet6/nd6_nbr.c
sys/netinet6/nd6_rtr.c
sys/netinet6/raw_ip6.c
sys/netinet6/scope6.c
sys/netpfil/pf/pf_if.c
sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c