summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2016-04-28 06:20:43 +0000
committerarybchik <arybchik@FreeBSD.org>2016-04-28 06:20:43 +0000
commitd95042832b1b7a78248968385f591871a7d5ed98 (patch)
tree026b8d0a1053be987440b63cade08bb222035e7c /sys/dev
parent0f9e825508458c813f18229807b32e823cbc1e41 (diff)
downloadFreeBSD-src-d95042832b1b7a78248968385f591871a7d5ed98.zip
FreeBSD-src-d95042832b1b7a78248968385f591871a7d5ed98.tar.gz
sfxge(4): do not use RxQ index as label
Labels are limitted by 32 on EF10. It is not sufficient on powerful hosts. Since only one RxQ is running over each EvQ, zero label may be used. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days PR: 208267 Differential Revision: https://reviews.freebsd.org/D6121
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sfxge/sfxge_ev.c57
-rw-r--r--sys/dev/sfxge/sfxge_rx.c2
2 files changed, 26 insertions, 33 deletions
diff --git a/sys/dev/sfxge/sfxge_ev.c b/sys/dev/sfxge/sfxge_ev.c
index 4536e0a..96908f3 100644
--- a/sys/dev/sfxge/sfxge_ev.c
+++ b/sys/dev/sfxge/sfxge_ev.c
@@ -84,6 +84,21 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq, boolean_t eop)
sfxge_rx_qcomplete(rxq, eop);
}
+static struct sfxge_rxq *
+sfxge_get_rxq_by_label(struct sfxge_evq *evq, uint32_t label)
+{
+ struct sfxge_rxq *rxq;
+
+ KASSERT(label == 0, ("unexpected rxq label != 0"));
+
+ rxq = evq->sc->rxq[evq->index];
+
+ KASSERT(rxq != NULL, ("rxq == NULL"));
+ KASSERT(evq->index == rxq->index, ("evq->index != rxq->index"));
+
+ return (rxq);
+}
+
static boolean_t
sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size,
uint16_t flags)
@@ -103,11 +118,7 @@ sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size,
if (evq->exception)
goto done;
- rxq = sc->rxq[label];
- KASSERT(rxq != NULL, ("rxq == NULL"));
- KASSERT(evq->index == rxq->index,
- ("evq->index != rxq->index"));
-
+ rxq = sfxge_get_rxq_by_label(evq, label);
if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED))
goto done;
@@ -216,7 +227,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint32_t rxq_index)
evq = sc->evq[index];
- label = rxq_index;
+ label = 0;
KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level"));
magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label;
@@ -250,7 +261,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uint32_t rxq_index)
index = rxq->index;
evq = sc->evq[index];
- label = rxq_index;
+ label = 0;
KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label,
("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label"));
magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label;
@@ -369,36 +380,18 @@ sfxge_ev_software(void *arg, uint16_t magic)
magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK;
switch (magic) {
- case SFXGE_MAGIC_RX_QFLUSH_DONE: {
- struct sfxge_rxq *rxq = sc->rxq[label];
-
- KASSERT(rxq != NULL, ("rxq == NULL"));
- KASSERT(evq->index == rxq->index,
- ("evq->index != rxq->index"));
-
- sfxge_rx_qflush_done(rxq);
+ case SFXGE_MAGIC_RX_QFLUSH_DONE:
+ sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label));
break;
- }
- case SFXGE_MAGIC_RX_QFLUSH_FAILED: {
- struct sfxge_rxq *rxq = sc->rxq[label];
- KASSERT(rxq != NULL, ("rxq == NULL"));
- KASSERT(evq->index == rxq->index,
- ("evq->index != rxq->index"));
-
- sfxge_rx_qflush_failed(rxq);
+ case SFXGE_MAGIC_RX_QFLUSH_FAILED:
+ sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label));
break;
- }
- case SFXGE_MAGIC_RX_QREFILL: {
- struct sfxge_rxq *rxq = sc->rxq[label];
-
- KASSERT(rxq != NULL, ("rxq == NULL"));
- KASSERT(evq->index == rxq->index,
- ("evq->index != rxq->index"));
- sfxge_rx_qrefill(rxq);
+ case SFXGE_MAGIC_RX_QREFILL:
+ sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label));
break;
- }
+
case SFXGE_MAGIC_TX_QFLUSH_DONE: {
struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label);
diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c
index d4e4fd4..876bd1f 100644
--- a/sys/dev/sfxge/sfxge_rx.c
+++ b/sys/dev/sfxge/sfxge_rx.c
@@ -1024,7 +1024,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int index)
return (rc);
/* Create the common code receive queue. */
- if ((rc = efx_rx_qcreate(sc->enp, index, index, EFX_RXQ_TYPE_DEFAULT,
+ if ((rc = efx_rx_qcreate(sc->enp, index, 0, EFX_RXQ_TYPE_DEFAULT,
esmp, sc->rxq_entries, rxq->buf_base_id, evq->common,
&rxq->common)) != 0)
goto fail;
OpenPOWER on IntegriCloud