summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2015-03-25 13:50:38 +0000
committerarybchik <arybchik@FreeBSD.org>2015-03-25 13:50:38 +0000
commitb931488dad9178423ccae9bcf70615910424f084 (patch)
tree7b3deae824ad44d03afb88c617e577849e7b3f9e /sys/dev
parent9287ef4b211f14eaa1bf3542c7aa473812165ab9 (diff)
downloadFreeBSD-src-b931488dad9178423ccae9bcf70615910424f084.zip
FreeBSD-src-b931488dad9178423ccae9bcf70615910424f084.tar.gz
MFC: 280376
sfxge: remove obsolete Tx non-multi queue support Tx multi queue is added in FreeBSD 8.0. So, the changeset drops earlier versions support. Sponsored by: Solarflare Communications, Inc. Original Differential Revision: https://reviews.freebsd.org/D2081
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sfxge/sfxge.c11
-rw-r--r--sys/dev/sfxge/sfxge.h15
-rw-r--r--sys/dev/sfxge/sfxge_rx.c5
-rw-r--r--sys/dev/sfxge/sfxge_tx.c101
-rw-r--r--sys/dev/sfxge/sfxge_tx.h22
5 files changed, 5 insertions, 149 deletions
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c
index ab8416f..4096a86 100644
--- a/sys/dev/sfxge/sfxge.c
+++ b/sys/dev/sfxge/sfxge.c
@@ -329,19 +329,8 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
ether_ifattach(ifp, encp->enc_mac_addr);
-#ifdef SFXGE_HAVE_MQ
ifp->if_transmit = sfxge_if_transmit;
ifp->if_qflush = sfxge_if_qflush;
-#else
- ifp->if_start = sfxge_if_start;
- IFQ_SET_MAXLEN(&ifp->if_snd, sc->txq_entries - 1);
- ifp->if_snd.ifq_drv_maxlen = sc->txq_entries - 1;
- IFQ_SET_READY(&ifp->if_snd);
-
- snprintf(sc->tx_lock_name, sizeof(sc->tx_lock_name),
- "%s:tx", device_get_nameunit(sc->dev));
- mtx_init(&sc->tx_lock, sc->tx_lock_name, NULL, MTX_DEF);
-#endif
if ((rc = sfxge_port_ifmedia_init(sc)) != 0)
goto fail;
diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h
index e2ccc20..03f2d45 100644
--- a/sys/dev/sfxge/sfxge.h
+++ b/sys/dev/sfxge/sfxge.h
@@ -66,12 +66,6 @@
#ifndef IFM_10G_KX4
#define IFM_10G_KX4 IFM_10G_CX4
#endif
-#if __FreeBSD_version >= 800054
-/* Networking core is multiqueue aware. We can manage our own TX
- * queues and use m_pkthdr.flowid.
- */
-#define SFXGE_HAVE_MQ
-#endif
#if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \
__FreeBSD_version >= 900003
#define SFXGE_HAVE_DESCRIBE_INTR
@@ -242,11 +236,7 @@ struct sfxge_softc {
struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX];
unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX];
-#ifdef SFXGE_HAVE_MQ
struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX];
-#else
- struct sfxge_txq *txq[SFXGE_TXQ_NTYPES];
-#endif
struct ifmedia media;
@@ -254,11 +244,6 @@ struct sfxge_softc {
size_t rx_buffer_size;
uma_zone_t rx_buffer_zone;
-#ifndef SFXGE_HAVE_MQ
- struct mtx tx_lock __aligned(CACHE_LINE_SIZE);
- char tx_lock_name[SFXGE_LOCK_NAME_MAX];
-#endif
-
unsigned int evq_count;
unsigned int rxq_count;
unsigned int txq_count;
diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c
index 334fcd8..9f1f734 100644
--- a/sys/dev/sfxge/sfxge_rx.c
+++ b/sys/dev/sfxge/sfxge_rx.c
@@ -326,14 +326,12 @@ sfxge_rx_deliver(struct sfxge_softc *sc, struct sfxge_rx_sw_desc *rx_desc)
if (rx_desc->flags & EFX_CKSUM_TCPUDP)
csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
-#ifdef SFXGE_HAVE_MQ
/* The hash covers a 4-tuple for TCP only */
if (rx_desc->flags & EFX_PKT_TCP) {
m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
m->m_flags |= M_FLOWID;
}
-#endif
m->m_data += sc->rx_prefix_size;
m->m_len = rx_desc->size - sc->rx_prefix_size;
m->m_pkthdr.len = m->m_len;
@@ -380,10 +378,9 @@ sfxge_lro_deliver(struct sfxge_lro_state *st, struct sfxge_lro_conn *c)
memcpy(c_th + 1, c->th_last + 1, optlen);
}
-#ifdef SFXGE_HAVE_MQ
m->m_pkthdr.flowid = c->conn_hash;
m->m_flags |= M_FLOWID;
-#endif
+
m->m_pkthdr.csum_flags = csum_flags;
__sfxge_rx_deliver(sc, m);
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index 6fdf60f..cfc0cb4 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$");
#define SFXGE_TXQ_BLOCK_LEVEL(_entries) \
(EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC)
-#ifdef SFXGE_HAVE_MQ
#define SFXGE_PARAM_TX_DPL_GET_MAX SFXGE_PARAM(tx_dpl_get_max)
static int sfxge_tx_dpl_get_max = SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT;
@@ -109,8 +108,6 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN,
&sfxge_tx_dpl_put_max, 0,
"Maximum number of any packets in deferred packet put-list");
-#endif
-
/* Forward declarations. */
static void sfxge_tx_qdpl_service(struct sfxge_txq *txq);
@@ -160,8 +157,6 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq)
}
}
-#ifdef SFXGE_HAVE_MQ
-
static unsigned int
sfxge_is_mbuf_non_tcp(struct mbuf *mbuf)
{
@@ -225,8 +220,6 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq *txq)
stdp->std_get_non_tcp_count += non_tcp_count;
}
-#endif /* SFXGE_HAVE_MQ */
-
static void
sfxge_tx_qreap(struct sfxge_txq *txq)
{
@@ -401,8 +394,6 @@ reject:
return (rc);
}
-#ifdef SFXGE_HAVE_MQ
-
/*
* Drain the deferred packet list into the transmit queue.
*/
@@ -708,88 +699,6 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m)
return (rc);
}
-#else /* !SFXGE_HAVE_MQ */
-
-static void sfxge_if_start_locked(struct ifnet *ifp)
-{
- struct sfxge_softc *sc = ifp->if_softc;
- struct sfxge_txq *txq;
- struct mbuf *mbuf;
- unsigned int pushed[SFXGE_TXQ_NTYPES];
- unsigned int q_index;
-
- if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
- IFF_DRV_RUNNING)
- return;
-
- if (!sc->port.link_up)
- return;
-
- for (q_index = 0; q_index < SFXGE_TXQ_NTYPES; q_index++) {
- txq = sc->txq[q_index];
- pushed[q_index] = txq->added;
- }
-
- while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
- IFQ_DRV_DEQUEUE(&ifp->if_snd, mbuf);
- if (mbuf == NULL)
- break;
-
- ETHER_BPF_MTAP(ifp, mbuf); /* packet capture */
-
- /* Pick the desired transmit queue. */
- if (mbuf->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO))
- q_index = SFXGE_TXQ_IP_TCP_UDP_CKSUM;
- else if (mbuf->m_pkthdr.csum_flags & CSUM_DELAY_IP)
- q_index = SFXGE_TXQ_IP_CKSUM;
- else
- q_index = SFXGE_TXQ_NON_CKSUM;
- txq = sc->txq[q_index];
-
- if (sfxge_tx_queue_mbuf(txq, mbuf) != 0)
- continue;
-
- if (txq->blocked) {
- ifp->if_drv_flags |= IFF_DRV_OACTIVE;
- break;
- }
-
- /* Push the fragments to the hardware in batches. */
- if (txq->added - pushed[q_index] >= SFXGE_TX_BATCH) {
- efx_tx_qpush(txq->common, txq->added);
- pushed[q_index] = txq->added;
- }
- }
-
- for (q_index = 0; q_index < SFXGE_TXQ_NTYPES; q_index++) {
- txq = sc->txq[q_index];
- if (txq->added != pushed[q_index])
- efx_tx_qpush(txq->common, txq->added);
- }
-}
-
-void sfxge_if_start(struct ifnet *ifp)
-{
- struct sfxge_softc *sc = ifp->if_softc;
-
- SFXGE_TXQ_LOCK(sc->txq[0]);
- sfxge_if_start_locked(ifp);
- SFXGE_TXQ_UNLOCK(sc->txq[0]);
-}
-
-static void
-sfxge_tx_qdpl_service(struct sfxge_txq *txq)
-{
- struct ifnet *ifp = txq->sc->ifnet;
-
- SFXGE_TXQ_LOCK_ASSERT_OWNED(txq);
- ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- sfxge_if_start_locked(ifp);
- SFXGE_TXQ_UNLOCK(txq);
-}
-
-#endif /* SFXGE_HAVE_MQ */
-
/*
* Software "TSO". Not quite as good as doing it in hardware, but
* still faster than segmenting in the stack.
@@ -1378,9 +1287,7 @@ sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index)
sc->txq[index] = NULL;
-#ifdef SFXGE_HAVE_MQ
SFXGE_TXQ_LOCK_DESTROY(txq);
-#endif
free(txq, M_SFXGE);
}
@@ -1394,10 +1301,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
struct sysctl_oid *txq_node;
struct sfxge_txq *txq;
struct sfxge_evq *evq;
-#ifdef SFXGE_HAVE_MQ
struct sfxge_tx_dpl *stdp;
struct sysctl_oid *dpl_node;
-#endif
efsys_mem_t *esmp;
unsigned int nmaps;
int rc;
@@ -1456,7 +1361,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
(rc = tso_init(txq)) != 0)
goto fail3;
-#ifdef SFXGE_HAVE_MQ
if (sfxge_tx_dpl_get_max <= 0) {
log(LOG_ERR, "%s=%d must be greater than 0",
SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max);
@@ -1506,7 +1410,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO,
"put_hiwat", CTLFLAG_RD | CTLFLAG_STATS,
&stdp->std_put_hiwat, 0, "");
-#endif
txq->type = type;
txq->evq_index = evq_index;
@@ -1613,11 +1516,7 @@ sfxge_tx_init(struct sfxge_softc *sc)
KASSERT(intr->state == SFXGE_INTR_INITIALIZED,
("intr->state != SFXGE_INTR_INITIALIZED"));
-#ifdef SFXGE_HAVE_MQ
sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc;
-#else
- sc->txq_count = SFXGE_TXQ_NTYPES;
-#endif
sc->txqs_node = SYSCTL_ADD_NODE(
device_get_sysctl_ctx(sc->dev),
diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h
index 3a2677b..67068e3 100644
--- a/sys/dev/sfxge/sfxge_tx.h
+++ b/sys/dev/sfxge/sfxge_tx.h
@@ -128,12 +128,6 @@ enum sfxge_txq_type {
#define SFXGE_TX_BATCH 64
-#ifdef SFXGE_HAVE_MQ
-#define SFXGE_TX_LOCK(txq) (&(txq)->lock)
-#else
-#define SFXGE_TX_LOCK(txq) (&(txq)->sc->tx_lock)
-#endif
-
#define SFXGE_TXQ_LOCK_INIT(_txq, _ifname, _txq_index) \
do { \
struct sfxge_txq *__txq = (_txq); \
@@ -147,13 +141,13 @@ enum sfxge_txq_type {
#define SFXGE_TXQ_LOCK_DESTROY(_txq) \
mtx_destroy(&(_txq)->lock)
#define SFXGE_TXQ_LOCK(_txq) \
- mtx_lock(SFXGE_TX_LOCK(_txq))
+ mtx_lock(&(_txq)->lock)
#define SFXGE_TXQ_TRYLOCK(_txq) \
- mtx_trylock(SFXGE_TX_LOCK(_txq))
+ mtx_trylock(&(_txq)->lock)
#define SFXGE_TXQ_UNLOCK(_txq) \
- mtx_unlock(SFXGE_TX_LOCK(_txq))
+ mtx_unlock(&(_txq)->lock)
#define SFXGE_TXQ_LOCK_ASSERT_OWNED(_txq) \
- mtx_assert(SFXGE_TX_LOCK(_txq), MA_OWNED)
+ mtx_assert(&(_txq)->lock, MA_OWNED)
struct sfxge_txq {
@@ -186,13 +180,9 @@ struct sfxge_txq {
/* The following fields change more often, and are used mostly
* on the initiation path
*/
-#ifdef SFXGE_HAVE_MQ
struct mtx lock __aligned(CACHE_LINE_SIZE);
struct sfxge_tx_dpl dpl; /* Deferred packet list. */
unsigned int n_pend_desc;
-#else
- unsigned int n_pend_desc __aligned(CACHE_LINE_SIZE);
-#endif
unsigned int added;
unsigned int reaped;
/* Statistics */
@@ -226,11 +216,7 @@ extern int sfxge_tx_start(struct sfxge_softc *sc);
extern void sfxge_tx_stop(struct sfxge_softc *sc);
extern void sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq);
extern void sfxge_tx_qflush_done(struct sfxge_txq *txq);
-#ifdef SFXGE_HAVE_MQ
extern void sfxge_if_qflush(struct ifnet *ifp);
extern int sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m);
-#else
-extern void sfxge_if_start(struct ifnet *ifp);
-#endif
#endif
OpenPOWER on IntegriCloud