summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-10-20 16:45:01 +0000
committernp <np@FreeBSD.org>2013-10-20 16:45:01 +0000
commitb36ea7524500e7b946ee61a3d580644d0e9320cd (patch)
tree9508a1e41cb94eeb5bcea98352a0261d240c79c9
parent6de0bdec97a101f87cbb605001de11d9d4c5c9d7 (diff)
downloadFreeBSD-src-b36ea7524500e7b946ee61a3d580644d0e9320cd.zip
FreeBSD-src-b36ea7524500e7b946ee61a3d580644d0e9320cd.tar.gz
MFC r256477:
cxgbe(4): Store the log2 of the # of doorbells per BAR2 page for both ingress and egress queues, and for both T4 and T5. These values are used by the T4/T5 iWARP driver. Approved by: re (glebius)
-rw-r--r--sys/dev/cxgbe/adapter.h3
-rw-r--r--sys/dev/cxgbe/t4_sge.c19
2 files changed, 14 insertions, 8 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 89358d2..801ab90 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -510,7 +510,8 @@ struct sge {
int timer_val[SGE_NTIMERS];
int counter_val[SGE_NCOUNTERS];
int fl_starve_threshold;
- int s_qpp;
+ int eq_s_qpp;
+ int iq_s_qpp;
int nrxq; /* total # of Ethernet rx queues */
int ntxq; /* total # of Ethernet tx tx queues */
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index cbb37b3..65550bc 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -569,12 +569,17 @@ t4_read_chip_settings(struct adapter *sc)
r = t4_read_reg(sc, A_SGE_CONM_CTRL);
s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1;
- if (is_t5(sc)) {
- r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF);
- r >>= S_QUEUESPERPAGEPF0 +
- (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * sc->pf;
- s->s_qpp = r & M_QUEUESPERPAGEPF0;
- }
+ /* egress queues: log2 of # of doorbells per BAR2 page */
+ r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF);
+ r >>= S_QUEUESPERPAGEPF0 +
+ (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * sc->pf;
+ s->eq_s_qpp = r & M_QUEUESPERPAGEPF0;
+
+ /* ingress queues: log2 of # of doorbells per BAR2 page */
+ r = t4_read_reg(sc, A_SGE_INGRESS_QUEUES_PER_PAGE_PF);
+ r >>= S_QUEUESPERPAGEPF0 +
+ (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * sc->pf;
+ s->iq_s_qpp = r & M_QUEUESPERPAGEPF0;
t4_init_tp_params(sc);
@@ -2799,7 +2804,7 @@ alloc_eq(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
if (isset(&eq->doorbells, DOORBELL_UDB) ||
isset(&eq->doorbells, DOORBELL_UDBWC) ||
isset(&eq->doorbells, DOORBELL_WCWR)) {
- uint32_t s_qpp = sc->sge.s_qpp;
+ uint32_t s_qpp = sc->sge.eq_s_qpp;
uint32_t mask = (1 << s_qpp) - 1;
volatile uint8_t *udb;
OpenPOWER on IntegriCloud