On Monday 11 July 2005 13:32, Florian C. Smeets wrote:
> > As it is quite often used (e.g.: HP DL380 server), are there any plan to
> > support ALTQ on bge interface?
>
> bge has altq suppot in -CURRENT but it seems that it was never merged
> back to RELENG_5.

Here is a patch relative to RELENG_5.  Please take it for a spin and let me 
know if it works reliably.

-- 
/"\  Best regards,                      | [EMAIL PROTECTED]
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | [EMAIL PROTECTED]
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
Index: if_bge.c
===================================================================
RCS file: /usr/store/mlaier/fcvs/src/sys/dev/bge/if_bge.c,v
retrieving revision 1.72.2.13
diff -u -r1.72.2.13 if_bge.c
--- if_bge.c	22 May 2005 03:17:49 -0000	1.72.2.13
+++ if_bge.c	14 Jul 2005 20:30:14 -0000
@@ -2399,7 +2399,9 @@
 	ifp->if_watchdog = bge_watchdog;
 	ifp->if_init = bge_init;
 	ifp->if_mtu = ETHERMTU;
-	ifp->if_snd.ifq_maxlen = BGE_TX_RING_CNT - 1;
+	ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1;
+	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
+	IFQ_SET_READY(&ifp->if_snd);
 	ifp->if_hwassist = BGE_CSUM_FEATURES;
 	/* NB: the code for RX csum offload is disabled for now */
 	ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_HWTAGGING |
@@ -2997,7 +2999,7 @@
 	/* Re-enable interrupts. */
 	CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0);
 
-	if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
+	if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		bge_start_locked(ifp);
 
 	BGE_UNLOCK(sc);
@@ -3038,7 +3040,7 @@
 			if (bootverbose)
 				printf("bge%d: gigabit link up\n",
 				    sc->bge_unit);
-			if (ifp->if_snd.ifq_head != NULL)
+			if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 				bge_start_locked(ifp);
 		}
 		return;
@@ -3054,7 +3056,7 @@
 		    IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) &&
 		    bootverbose)
 			printf("bge%d: gigabit link up\n", sc->bge_unit);
-		if (ifp->if_snd.ifq_head != NULL)
+		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 			bge_start_locked(ifp);
 	}
 
@@ -3220,13 +3222,13 @@
 
 	sc = ifp->if_softc;
 
-	if (!sc->bge_link && ifp->if_snd.ifq_len < 10)
+	if (!sc->bge_link && IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		return;
 
 	prodidx = CSR_READ_4(sc, BGE_MBX_TX_HOST_PROD0_LO);
 
 	while(sc->bge_cdata.bge_tx_chain[prodidx] == NULL) {
-		IF_DEQUEUE(&ifp->if_snd, m_head);
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
 		if (m_head == NULL)
 			break;
 
@@ -3247,7 +3249,7 @@
 		    m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) {
 			if ((BGE_TX_RING_CNT - sc->bge_txcnt) <
 			    m_head->m_pkthdr.csum_data + 16) {
-				IF_PREPEND(&ifp->if_snd, m_head);
+				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
 				ifp->if_flags |= IFF_OACTIVE;
 				break;
 			}
@@ -3259,7 +3261,7 @@
 		 * for the NIC to drain the ring.
 		 */
 		if (bge_encap(sc, m_head, &prodidx)) {
-			IF_PREPEND(&ifp->if_snd, m_head);
+			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
 			ifp->if_flags |= IFF_OACTIVE;
 			break;
 		}

Attachment: pgpsjY4rY3egD.pgp
Description: PGP signature

Reply via email to