Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2009 19:50:03 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194259 - in head/sys: dev/cxgb net
Message-ID:  <200906151950.n5FJo3XY099669@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Mon Jun 15 19:50:03 2009
New Revision: 194259
URL: http://svn.freebsd.org/changeset/base/194259

Log:
  r193336 moved ifq_detach to if_free which broke if_alloc followed
  by if_free (w/o doing if_attach); move ifq_attach to if_alloc and
  rename ifq_attach/detach to ifq_init/ifq_delete to better identify
  their purpose
  
  Reviewed by:	jhb, kmacy

Modified:
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/net/if.c
  head/sys/net/if_var.h

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Mon Jun 15 19:26:34 2009	(r194258)
+++ head/sys/dev/cxgb/cxgb_sge.c	Mon Jun 15 19:50:03 2009	(r194259)
@@ -1719,7 +1719,7 @@ t3_free_qset(adapter_t *sc, struct sge_q
 		if (q->txq[i].txq_mr != NULL) 
 			buf_ring_free(q->txq[i].txq_mr, M_DEVBUF);
 		if (q->txq[i].txq_ifq != NULL) {
-			ifq_detach(q->txq[i].txq_ifq);
+			ifq_delete(q->txq[i].txq_ifq);
 			free(q->txq[i].txq_ifq, M_DEVBUF);
 		}
 	}
@@ -2289,7 +2289,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i
 			device_printf(sc->dev, "failed to allocate ifq\n");
 			goto err;
 		}
-		ifq_attach(q->txq[i].txq_ifq, pi->ifp);
+		ifq_init(q->txq[i].txq_ifq, pi->ifp);
 	}
 	init_qset_cntxt(q, id);
 	q->idx = id;

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Mon Jun 15 19:26:34 2009	(r194258)
+++ head/sys/net/if.c	Mon Jun 15 19:50:03 2009	(r194259)
@@ -554,6 +554,7 @@ if_alloc(u_char type)
 #ifdef MAC
 	mac_ifnet_init(ifp);
 #endif
+	ifq_init(&ifp->if_snd, ifp);
 
 	refcount_init(&ifp->if_refcount, 1);	/* Index reference. */
 	IFNET_WLOCK();
@@ -596,7 +597,7 @@ if_free_internal(struct ifnet *ifp)
 	knlist_destroy(&ifp->if_klist);
 	IF_AFDATA_DESTROY(ifp);
 	IF_ADDR_LOCK_DESTROY(ifp);
-	ifq_detach(&ifp->if_snd);
+	ifq_delete(&ifp->if_snd);
 	free(ifp, M_IFNET);
 }
 
@@ -655,7 +656,7 @@ if_rele(struct ifnet *ifp)
 }
 
 void
-ifq_attach(struct ifaltq *ifq, struct ifnet *ifp)
+ifq_init(struct ifaltq *ifq, struct ifnet *ifp)
 {
 	
 	mtx_init(&ifq->ifq_mtx, ifp->if_xname, "if send queue", MTX_DEF);
@@ -671,7 +672,7 @@ ifq_attach(struct ifaltq *ifq, struct if
 }
 
 void
-ifq_detach(struct ifaltq *ifq)
+ifq_delete(struct ifaltq *ifq)
 {
 	mtx_destroy(&ifq->ifq_mtx);
 }
@@ -742,8 +743,6 @@ if_attach_internal(struct ifnet *ifp, in
 			    net_cdevsw.d_name, ifp->if_index);
 		}
 
-		ifq_attach(&ifp->if_snd, ifp);
-
 		/*
 		 * Create a Link Level name for this device.
 		 */

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Mon Jun 15 19:26:34 2009	(r194258)
+++ head/sys/net/if_var.h	Mon Jun 15 19:50:03 2009	(r194259)
@@ -817,8 +817,8 @@ int	ifpromisc(struct ifnet *, int);
 struct	ifnet *ifunit(const char *);
 struct	ifnet *ifunit_ref(const char *);
 
-void	ifq_attach(struct ifaltq *, struct ifnet *ifp);
-void	ifq_detach(struct ifaltq *);
+void	ifq_init(struct ifaltq *, struct ifnet *ifp);
+void	ifq_delete(struct ifaltq *);
 
 struct	ifaddr *ifa_ifwithaddr(struct sockaddr *);
 struct	ifaddr *ifa_ifwithbroadaddr(struct sockaddr *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906151950.n5FJo3XY099669>