svn commit: r199975 - head/sys/net

John Baldwin jhb at FreeBSD.org
Mon Nov 30 21:25:58 UTC 2009


Author: jhb
Date: Mon Nov 30 21:25:57 2009
New Revision: 199975
URL: http://svn.freebsd.org/changeset/base/199975

Log:
  Remove if_timer/if_watchdog now that they are no longer used.  The space
  used by if_timer is reserved for expanding if_index to an int in the
  future.
  
  Reviewed by:	rwatson, brooks

Modified:
  head/sys/net/if.c
  head/sys/net/if_dead.c
  head/sys/net/if_var.h

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Mon Nov 30 21:03:44 2009	(r199974)
+++ head/sys/net/if.c	Mon Nov 30 21:25:57 2009	(r199975)
@@ -96,8 +96,6 @@ struct ifindex_entry {
 	struct  ifnet *ife_ifnet;
 };
 
-static int slowtimo_started;
-
 SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
 SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
 
@@ -125,10 +123,8 @@ static int	ifconf(u_long, caddr_t);
 static void	if_freemulti(struct ifmultiaddr *);
 static void	if_init(void *);
 static void	if_grow(void);
-static void	if_check(void *);
 static void	if_route(struct ifnet *, int flag, int fam);
 static int	if_setflag(struct ifnet *, int, int, int *, int);
-static void	if_slowtimo(void *);
 static int	if_transmit(struct ifnet *ifp, struct mbuf *m);
 static void	if_unroute(struct ifnet *, int flag, int fam);
 static void	link_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
@@ -185,11 +181,6 @@ struct sx ifnet_sxlock;
 static	if_com_alloc_t *if_com_alloc[256];
 static	if_com_free_t *if_com_free[256];
 
-/*
- * System initialization
- */
-SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_check, NULL);
-
 MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals");
 MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address");
 MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address");
@@ -375,18 +366,6 @@ if_grow(void)
 	V_ifindex_table = e;
 }
 
-static void
-if_check(void *dummy __unused)
-{
-
-	/*
-	 * If at least one interface added during boot uses
-	 * if_watchdog then start the timer.
-	 */
-	if (slowtimo_started)
-		if_slowtimo(0);
-}
-
 /*
  * Allocate a struct ifnet and an index for an interface.  A layer 2
  * common structure will also be allocated if an allocation routine is
@@ -670,18 +649,6 @@ if_attach_internal(struct ifnet *ifp, in
 
 	/* Announce the interface. */
 	rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
-
-	if (!vmove && ifp->if_watchdog != NULL) {
-		if_printf(ifp,
-		    "WARNING: using obsoleted if_watchdog interface\n");
-
-		/*
-		 * Note that we need if_slowtimo().  If this happens after
-		 * boot, then call if_slowtimo() directly.
-		 */
-		if (atomic_cmpset_int(&slowtimo_started, 0, 1) && !cold)
-			if_slowtimo(0);
-	}
 }
 
 static void
@@ -1973,39 +1940,6 @@ if_qflush(struct ifnet *ifp)
 }
 
 /*
- * Handle interface watchdog timer routines.  Called
- * from softclock, we decrement timers (if set) and
- * call the appropriate interface routine on expiration.
- *
- * XXXRW: Note that because timeouts run with Giant, if_watchdog() is called
- * holding Giant.
- */
-static void
-if_slowtimo(void *arg)
-{
-	VNET_ITERATOR_DECL(vnet_iter);
-	struct ifnet *ifp;
-	int s = splimp();
-
-	VNET_LIST_RLOCK_NOSLEEP();
-	IFNET_RLOCK_NOSLEEP();
-	VNET_FOREACH(vnet_iter) {
-		CURVNET_SET(vnet_iter);
-		TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
-			if (ifp->if_timer == 0 || --ifp->if_timer)
-				continue;
-			if (ifp->if_watchdog)
-				(*ifp->if_watchdog)(ifp);
-		}
-		CURVNET_RESTORE();
-	}
-	IFNET_RUNLOCK_NOSLEEP();
-	VNET_LIST_RUNLOCK_NOSLEEP();
-	splx(s);
-	timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
-}
-
-/*
  * Map interface name to interface structure pointer, with or without
  * returning a reference.
  */

Modified: head/sys/net/if_dead.c
==============================================================================
--- head/sys/net/if_dead.c	Mon Nov 30 21:03:44 2009	(r199974)
+++ head/sys/net/if_dead.c	Mon Nov 30 21:25:57 2009	(r199975)
@@ -70,12 +70,6 @@ ifdead_ioctl(struct ifnet *ifp, u_long c
 	return (ENXIO);
 }
 
-static void
-ifdead_watchdog(struct ifnet *ifp)
-{
-
-}
-
 static int
 ifdead_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
     struct sockaddr *sa)
@@ -107,7 +101,6 @@ if_dead(struct ifnet *ifp)
 	ifp->if_input = ifdead_input;
 	ifp->if_start = ifdead_start;
 	ifp->if_ioctl = ifdead_ioctl;
-	ifp->if_watchdog = ifdead_watchdog;
 	ifp->if_resolvemulti = ifdead_resolvemulti;
 	ifp->if_qflush = ifdead_qflush;
 	ifp->if_transmit = ifdead_transmit;

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Mon Nov 30 21:03:44 2009	(r199974)
+++ head/sys/net/if_var.h	Mon Nov 30 21:25:57 2009	(r199975)
@@ -141,7 +141,7 @@ struct ifnet {
 	struct	carp_if *if_carp;	/* carp interface structure */
 	struct	bpf_if *if_bpf;		/* packet filter structure */
 	u_short	if_index;		/* numeric abbreviation for this if  */
-	short	if_timer;		/* time 'til if_watchdog called */
+	short	if_index_reserved;	/* spare space to grow if_index */
 	struct  ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
 	int	if_flags;		/* up/down, broadcast, etc. */
 	int	if_capabilities;	/* interface features & capabilities */
@@ -161,8 +161,6 @@ struct ifnet {
 		(struct ifnet *);
 	int	(*if_ioctl)		/* ioctl routine */
 		(struct ifnet *, u_long, caddr_t);
-	void	(*if_watchdog)		/* timer routine */
-		(struct ifnet *);
 	void	(*if_init)		/* Init routine */
 		(void *);
 	int	(*if_resolvemulti)	/* validate/resolve multicast */


More information about the svn-src-all mailing list