summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2014-05-06 02:22:52 +0000
committernp <np@FreeBSD.org>2014-05-06 02:22:52 +0000
commit3942b0b24cecb754b3f7c7259fd595d86a35a9b6 (patch)
tree8d22f51ed707c328f6a034e9d099bd7465c4d889
parentf850b5a0a263901c7eff2cfff5dd1bce0e5ef61a (diff)
downloadFreeBSD-src-3942b0b24cecb754b3f7c7259fd595d86a35a9b6.zip
FreeBSD-src-3942b0b24cecb754b3f7c7259fd595d86a35a9b6.tar.gz
MFC r261533, r261536, r261537, and r263457.
r261533: cxgbe(4): Use the port's tx channel to identify it to t4_clr_port_stats. r261536: cxgbe(4): The T5 allows for a different freelist starvation threshold for queues with buffer packing. Use the correct value to calculate a freelist's low water mark. r261537: cxgbe(4): Use the rx channel map (instead of the tx channel map) as the congestion channel map. r263457: cxgbe(4): Recognize the "spider" configuration where a T5 card's 40G QSFP port is presented as 4 distinct 10G SFP+ ports to the driver.
-rw-r--r--sys/dev/cxgbe/adapter.h2
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c1
-rw-r--r--sys/dev/cxgbe/t4_main.c5
-rw-r--r--sys/dev/cxgbe/t4_sge.c12
4 files changed, 15 insertions, 5 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index d13bbd1..b7a9cce 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -204,6 +204,7 @@ struct port_info {
uint8_t mod_type;
uint8_t port_id;
uint8_t tx_chan;
+ uint8_t rx_chan_map; /* rx MPS channel bitmap */
/* These need to be int as they are used in sysctl */
int ntxq; /* # of tx queues */
@@ -512,6 +513,7 @@ struct sge {
int timer_val[SGE_NTIMERS];
int counter_val[SGE_NCOUNTERS];
int fl_starve_threshold;
+ int fl_starve_threshold2;
int eq_s_qpp;
int iq_s_qpp;
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index 2fc1c1f..a602ead 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -5647,6 +5647,7 @@ int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf)
p->viid = ret;
p->tx_chan = j;
+ p->rx_chan_map = get_mps_bg_map(adap, j);
p->lport = j;
p->rss_size = rss_size;
t4_os_set_hw_addr(adap, p->port_id, addr);
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 66f147a..f7563fa 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -2622,6 +2622,7 @@ build_medialist(struct port_info *pi)
ifmedia_set(media, m | IFM_10G_CX4);
break;
+ case FW_PORT_TYPE_QSFP_10G:
case FW_PORT_TYPE_SFP:
case FW_PORT_TYPE_FIBER_XFI:
case FW_PORT_TYPE_FIBER_XAUI:
@@ -7754,11 +7755,11 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
if (port_id >= sc->params.nports)
return (EINVAL);
+ pi = sc->port[port_id];
/* MAC stats */
- t4_clr_port_stats(sc, port_id);
+ t4_clr_port_stats(sc, pi->tx_chan);
- pi = sc->port[port_id];
if (pi->flags & PORT_INIT_DONE) {
struct sge_rxq *rxq;
struct sge_txq *txq;
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 4fdc820..f4662b3 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -568,6 +568,10 @@ 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_t4(sc))
+ s->fl_starve_threshold2 = s->fl_starve_threshold;
+ else
+ s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1;
/* egress queues: log2 of # of doorbells per BAR2 page */
r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF);
@@ -2232,7 +2236,9 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
return (rc);
}
fl->needed = fl->cap;
- fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8);
+ fl->lowat = fl->flags & FL_BUF_PACKING ?
+ roundup2(sc->sge.fl_starve_threshold2, 8) :
+ roundup2(sc->sge.fl_starve_threshold, 8);
c.iqns_to_fl0congen |=
htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) |
@@ -2467,7 +2473,7 @@ tnl_cong(struct port_info *pi)
else if (cong_drop == 1)
return (0);
else
- return (1 << pi->tx_chan);
+ return (pi->rx_chan_map);
}
static int
@@ -2574,7 +2580,7 @@ alloc_ofld_rxq(struct port_info *pi, struct sge_ofld_rxq *ofld_rxq,
char name[16];
rc = alloc_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx,
- 1 << pi->tx_chan);
+ pi->rx_chan_map);
if (rc != 0)
return (rc);
OpenPOWER on IntegriCloud