svn commit: r311083 - in stable/10/sys/dev/sfxge: . common
Andrew Rybchenko
arybchik at FreeBSD.org
Mon Jan 2 09:36:00 UTC 2017
Author: arybchik
Date: Mon Jan 2 09:35:58 2017
New Revision: 311083
URL: https://svnweb.freebsd.org/changeset/base/311083
Log:
MFC r310752
sfxge(4): allow to have no NIC handle on Rx datapath in DPDK PMD
It is required to minimize RxQ context in the driver or avoid chaising
for the NIC handle in adapter (global per-interface) structure.
Sponsored by: Solarflare Communications, Inc.
Modified:
stable/10/sys/dev/sfxge/common/efx.h
stable/10/sys/dev/sfxge/common/efx_rx.c
stable/10/sys/dev/sfxge/sfxge_rx.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/sfxge/common/efx.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx.h Mon Jan 2 09:34:45 2017 (r311082)
+++ stable/10/sys/dev/sfxge/common/efx.h Mon Jan 2 09:35:58 2017 (r311083)
@@ -1921,7 +1921,7 @@ efx_rx_scale_key_set(
extern __checkReturn uint32_t
efx_psuedo_hdr_hash_get(
- __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
__in efx_rx_hash_alg_t func,
__in uint8_t *buffer);
@@ -1929,7 +1929,7 @@ efx_psuedo_hdr_hash_get(
extern __checkReturn efx_rc_t
efx_psuedo_hdr_pkt_length_get(
- __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
__in uint8_t *buffer,
__out uint16_t *pkt_lengthp);
Modified: stable/10/sys/dev/sfxge/common/efx_rx.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_rx.c Mon Jan 2 09:34:45 2017 (r311082)
+++ stable/10/sys/dev/sfxge/common/efx_rx.c Mon Jan 2 09:35:58 2017 (r311083)
@@ -541,24 +541,30 @@ efx_rx_qdestroy(
__checkReturn efx_rc_t
efx_psuedo_hdr_pkt_length_get(
- __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
__in uint8_t *buffer,
__out uint16_t *lengthp)
{
+ efx_nic_t *enp = erp->er_enp;
const efx_rx_ops_t *erxop = enp->en_erxop;
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
return (erxop->erxo_prefix_pktlen(enp, buffer, lengthp));
}
#if EFSYS_OPT_RX_SCALE
__checkReturn uint32_t
efx_psuedo_hdr_hash_get(
- __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
__in efx_rx_hash_alg_t func,
__in uint8_t *buffer)
{
+ efx_nic_t *enp = erp->er_enp;
const efx_rx_ops_t *erxop = enp->en_erxop;
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
EFSYS_ASSERT3U(enp->en_hash_support, ==, EFX_RX_HASH_AVAILABLE);
return (erxop->erxo_prefix_hash(enp, func, buffer));
}
Modified: stable/10/sys/dev/sfxge/sfxge_rx.c
==============================================================================
--- stable/10/sys/dev/sfxge/sfxge_rx.c Mon Jan 2 09:34:45 2017 (r311082)
+++ stable/10/sys/dev/sfxge/sfxge_rx.c Mon Jan 2 09:35:58 2017 (r311083)
@@ -337,8 +337,9 @@ static void __sfxge_rx_deliver(struct sf
}
static void
-sfxge_rx_deliver(struct sfxge_softc *sc, struct sfxge_rx_sw_desc *rx_desc)
+sfxge_rx_deliver(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_desc)
{
+ struct sfxge_softc *sc = rxq->sc;
struct mbuf *m = rx_desc->mbuf;
int flags = rx_desc->flags;
int csum_flags;
@@ -352,7 +353,7 @@ sfxge_rx_deliver(struct sfxge_softc *sc,
/* The hash covers a 4-tuple for TCP only */
if (flags & EFX_PKT_TCP) {
m->m_pkthdr.flowid =
- efx_psuedo_hdr_hash_get(sc->enp,
+ efx_psuedo_hdr_hash_get(rxq->common,
EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
@@ -423,7 +424,7 @@ static void sfxge_lro_drop(struct sfxge_
KASSERT(!c->mbuf, ("found orphaned mbuf"));
if (c->next_buf.mbuf != NULL) {
- sfxge_rx_deliver(rxq->sc, &c->next_buf);
+ sfxge_rx_deliver(rxq, &c->next_buf);
LIST_REMOVE(c, active_link);
}
@@ -618,7 +619,7 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx
return (1);
deliver_buf_out:
- sfxge_rx_deliver(rxq->sc, rx_buf);
+ sfxge_rx_deliver(rxq, rx_buf);
return (1);
}
@@ -679,7 +680,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct
unsigned bucket;
/* Get the hardware hash */
- conn_hash = efx_psuedo_hdr_hash_get(sc->enp,
+ conn_hash = efx_psuedo_hdr_hash_get(rxq->common,
EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
@@ -765,7 +766,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct
sfxge_lro_new_conn(&rxq->lro, conn_hash, l2_id, nh, th);
deliver_now:
- sfxge_rx_deliver(sc, rx_buf);
+ sfxge_rx_deliver(rxq, rx_buf);
}
static void sfxge_lro_end_of_burst(struct sfxge_rxq *rxq)
@@ -842,7 +843,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq
if (rx_desc->flags & EFX_PKT_PREFIX_LEN) {
uint16_t tmp_size;
int rc;
- rc = efx_psuedo_hdr_pkt_length_get(sc->enp,
+ rc = efx_psuedo_hdr_pkt_length_get(rxq->common,
mtod(m, uint8_t *),
&tmp_size);
KASSERT(rc == 0, ("cannot get packet length: %d", rc));
@@ -891,7 +892,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq
(EFX_PKT_TCP | EFX_CKSUM_TCPUDP)))
sfxge_lro(rxq, prev);
else
- sfxge_rx_deliver(sc, prev);
+ sfxge_rx_deliver(rxq, prev);
}
prev = rx_desc;
continue;
@@ -912,7 +913,7 @@ discard:
(EFX_PKT_TCP | EFX_CKSUM_TCPUDP)))
sfxge_lro(rxq, prev);
else
- sfxge_rx_deliver(sc, prev);
+ sfxge_rx_deliver(rxq, prev);
}
/*
More information about the svn-src-stable
mailing list