Date: Sun, 1 Jan 2017 19:13:53 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311020 - in stable/11/sys/dev/sfxge: . common Message-ID: <201701011913.v01JDrq0048682@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Sun Jan 1 19:13:53 2017 New Revision: 311020 URL: https://svnweb.freebsd.org/changeset/base/311020 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/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_rx.c stable/11/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sun Jan 1 19:11:31 2017 (r311019) +++ stable/11/sys/dev/sfxge/common/efx.h Sun Jan 1 19:13:53 2017 (r311020) @@ -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/11/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_rx.c Sun Jan 1 19:11:31 2017 (r311019) +++ stable/11/sys/dev/sfxge/common/efx_rx.c Sun Jan 1 19:13:53 2017 (r311020) @@ -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/11/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_rx.c Sun Jan 1 19:11:31 2017 (r311019) +++ stable/11/sys/dev/sfxge/sfxge_rx.c Sun Jan 1 19:13:53 2017 (r311020) @@ -330,8 +330,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; @@ -344,7 +345,7 @@ sfxge_rx_deliver(struct sfxge_softc *sc, if (flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) { 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 *)); /* The hash covers a 4-tuple for TCP only */ @@ -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); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701011913.v01JDrq0048682>