Author: np
Date: Fri Jun 22 22:59:42 2012
New Revision: 237463
URL: http://svn.freebsd.org/changeset/base/237463

Log:
  Do not allocate extra vectors when adapter is not TOE
  capable (or toecaps have been disallowed by the user).
  
  + one very minor unrelated cleanup in t4_sge.c

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c        Fri Jun 22 22:50:50 2012        
(r237462)
+++ head/sys/dev/cxgbe/t4_main.c        Fri Jun 22 22:59:42 2012        
(r237463)
@@ -1308,10 +1308,12 @@ cfg_itype_and_nqueues(struct adapter *sc
        iaq->nrxq10g = nrxq10g = t4_nrxq10g;
        iaq->nrxq1g = nrxq1g = t4_nrxq1g;
 #ifdef TCP_OFFLOAD
-       iaq->nofldtxq10g = t4_nofldtxq10g;
-       iaq->nofldtxq1g = t4_nofldtxq1g;
-       iaq->nofldrxq10g = nofldrxq10g = t4_nofldrxq10g;
-       iaq->nofldrxq1g = nofldrxq1g = t4_nofldrxq1g;
+       if (is_offload(sc)) {
+               iaq->nofldtxq10g = t4_nofldtxq10g;
+               iaq->nofldtxq1g = t4_nofldtxq1g;
+               iaq->nofldrxq10g = nofldrxq10g = t4_nofldrxq10g;
+               iaq->nofldrxq1g = nofldrxq1g = t4_nofldrxq1g;
+       }
 #endif
 
        for (itype = INTR_MSIX; itype; itype >>= 1) {
@@ -1380,7 +1382,8 @@ restart:
                                }
                                iaq->nrxq10g = min(n, nrxq10g);
 #ifdef TCP_OFFLOAD
-                               iaq->nofldrxq10g = min(n, nofldrxq10g);
+                               if (is_offload(sc))
+                                       iaq->nofldrxq10g = min(n, nofldrxq10g);
 #endif
                        }
 
@@ -1395,7 +1398,8 @@ restart:
                                }
                                iaq->nrxq1g = min(n, nrxq1g);
 #ifdef TCP_OFFLOAD
-                               iaq->nofldrxq1g = min(n, nofldrxq1g);
+                               if (is_offload(sc))
+                                       iaq->nofldrxq1g = min(n, nofldrxq1g);
 #endif
                        }
 
@@ -1408,7 +1412,8 @@ restart:
                 */
                iaq->nirq = iaq->nrxq10g = iaq->nrxq1g = 1;
 #ifdef TCP_OFFLOAD
-               iaq->nofldrxq10g = iaq->nofldrxq1g = 1;
+               if (is_offload(sc))
+                       iaq->nofldrxq10g = iaq->nofldrxq1g = 1;
 #endif
 
 allocate:

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c Fri Jun 22 22:50:50 2012        (r237462)
+++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 22 22:59:42 2012        (r237463)
@@ -1031,7 +1031,7 @@ get_fl_payload(struct adapter *sc, struc
 static int
 t4_eth_rx(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m0)
 {
-       struct sge_rxq *rxq = (void *)iq;
+       struct sge_rxq *rxq = iq_to_rxq(iq);
        struct ifnet *ifp = rxq->ifp;
        const struct cpl_rx_pkt *cpl = (const void *)(rss + 1);
 #ifdef INET
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to