From 3c51d1544a44eae7cf72b9d23976d8564e8bf127 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Fri, 22 Jun 2012 22:59:42 +0000 Subject: [PATCH] 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 --- sys/dev/cxgbe/t4_main.c | 19 ++++++++++++------- sys/dev/cxgbe/t4_sge.c | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 849c80e8b63..1dea24e48a4 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1308,10 +1308,12 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, 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: diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index cbbb82dff2d..fc223a3df1c 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1031,7 +1031,7 @@ get_fl_payload(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, 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