kern/72748: em0 problems on t41 after updating to 5.3

Bruce M Simpson bms at spc.org
Fri Oct 15 18:25:47 PDT 2004


[Cc: to current@ as this could be a show-stopper for RELENG_5_3]

Could you please try the attached patch, which reverts the ALTQ
changes introduced on the RELENG_5 branch, and let me know if this
resolves the issue?

Thanks,
BMS
-------------- next part --------------
Index: if_em.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v
retrieving revision 1.44.2.2
diff -u -p -r1.44.2.2 if_em.c
--- if_em.c	15 Oct 2004 22:12:59 -0000	1.44.2.2
+++ if_em.c	16 Oct 2004 00:30:26 -0000
@@ -610,15 +610,15 @@ em_start_locked(struct ifnet *ifp)
         if (!adapter->link_active)
                 return;
 
-        while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
+        while (ifp->if_snd.ifq_head != NULL) {
 
-                IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
+                IF_DEQUEUE(&ifp->if_snd, m_head);
                 
                 if (m_head == NULL) break;
                         
 		if (em_encap(adapter, m_head)) { 
 			ifp->if_flags |= IFF_OACTIVE;
-			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
+			IF_PREPEND(&ifp->if_snd, m_head);
 			break;
                 }
 
@@ -949,7 +949,7 @@ em_poll_locked(struct ifnet *ifp, enum p
                 em_clean_transmit_interrupts(adapter);
         }
 	
-        if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+        if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
                 em_start_locked(ifp);
 }
         
@@ -1019,7 +1019,7 @@ em_intr(void *arg)
                 loop_cnt--;
         }
                  
-        if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+        if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
                 em_start_locked(ifp);
 
 	EM_UNLOCK(adapter);
@@ -1892,9 +1892,7 @@ em_setup_interface(device_t dev, struct 
 	ifp->if_ioctl = em_ioctl;
 	ifp->if_start = em_start;
 	ifp->if_watchdog = em_watchdog;
-	IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1);
-	ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1;
-	IFQ_SET_READY(&ifp->if_snd);
+	ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 1;
 
 #if __FreeBSD_version < 500000
         ether_ifattach(ifp, ETHER_BPF_SUPPORTED);


More information about the freebsd-current mailing list