Permalink
Browse files

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
  • Loading branch information...
1 parent 489ec9e commit 98ce14079033185d04b0884380ca8c107ce3e0c6 np committed Jun 22, 2012
Showing with 13 additions and 8 deletions.
  1. +12 −7 sys/dev/cxgbe/t4_main.c
  2. +1 −1 sys/dev/cxgbe/t4_sge.c
View
@@ -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 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g,
}
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 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g,
}
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 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g,
*/
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:
View
@@ -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

0 comments on commit 98ce140

Please sign in to comment.