From nobody Thu Jan 27 22:39:42 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 22158198E79F; Thu, 27 Jan 2022 22:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JlFrt4DVlz3kZ2; Thu, 27 Jan 2022 22:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643323183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8G/AaV3oW0L+TYIA5I+n7u/981GWXNoP70zblMF1T4c=; b=A3YlxxmVFMsRJH5QoRmEzM4Tvtirz8j9Zr7mslQt9AZJG5v62532B2FSpG5GMYoBZq57N+ yaZfqZ2HIosg/ZXX2lS7tvego5GDq0Pq57eI2u5moiWeDEesQ70z/mBl+uC7dHMmUx2iQv xW54729F54z1NR6oruVal+MB8eEug8GlOu1YeqN90St1e9IkUgyV6QDUiw7umWCUnyBVIW DTZA38wmdqs+44Qnw1lskyYmuuOqZwPr0N1ohwntGSSWcJl/PhR1Oi1A4FlJA9bhaT8oXA tcJ7HSuGKlOvjOMq8XBrQGOOYorv9EKnUxwt54MD5wyYy65o5IvoVY3BEryt3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 503DA1ECC1; Thu, 27 Jan 2022 22:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20RMdgV4098347; Thu, 27 Jan 2022 22:39:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20RMdgx3098346; Thu, 27 Jan 2022 22:39:42 GMT (envelope-from git) Date: Thu, 27 Jan 2022 22:39:42 GMT Message-Id: <202201272239.20RMdgx3098346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: a61341bf6e51 - stable/12 - net: iflib: let the drivers use isc_capenable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a61341bf6e51cfc8a1855e9a97391af534da185f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643323183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8G/AaV3oW0L+TYIA5I+n7u/981GWXNoP70zblMF1T4c=; b=SgeB0A9lck0GMo7bBuy6UZHGAcw9+DxbczcwLRdegtOY1L1xE/i/3otE0JnUzGJ9YgcJOE EyOw17r3gmbnPt57cntHczGi4UkO7OkBt0Q9/l5z7NRnz9wnedsj4vFZ4+WWFOdyv214gd 7AV0qpZusCiqM95Ck9J+ciSSIAUq4xArB+htq79jY2gfhLIdRg4bsINbk2HHewc4zTihbI 34TWo8jXb8cGoU82/NN5iqjXOTQYQxZn2uDIciB1bBbsXwoa+XlQgVvWe8Be0RaZ6ywIOZ yH7DOVfkm843pZKF80ZmIMnLt1AOk8u+jqgYrxj1g5KpzDl+naH3GTKmxTYSHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643323183; a=rsa-sha256; cv=none; b=TKGPk4WUa+N3KOgLUXX7yJKzoVTceboR9hJEvCqemXqMoMeuoYiob+XUlO/oCVbY2gbwjg DYeQwyOHyYD+ob2RMYWX7nxS/RaOCj354as05LStehPG1Oqw3KGtFBEVrarl/zqN7Xp7jp GlxF/5Ni0Vb7W7KrSRflzG5nyU9in10h9jQtUosShVDRXnnWrzvguwpj0RaCkM61mBjO9F vJF1U3WGHWej38p5ZrV3RDpxor5f0A5LaLwtRYwb4dWceJ1e5CI6pBRY2j55rD5EgIYvLR 9HU2TgKkzpl4fIX5IuSbAZ0dcvWhy5QzAx2x9E9x9V20eu1/3Oq/mK75+M99hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=a61341bf6e51cfc8a1855e9a97391af534da185f commit a61341bf6e51cfc8a1855e9a97391af534da185f Author: Vincenzo Maffione AuthorDate: 2021-12-28 11:00:32 +0000 Commit: Vincenzo Maffione CommitDate: 2022-01-27 22:32:16 +0000 net: iflib: let the drivers use isc_capenable Since isc_capenable (private copy of ifp->if_capenable) is now synchronized to if_capenable, use it in the drivers when checking the IFCAP_* bits. This results in better cache usage and avoids indirection through the ifp pointer. PR: 260068 Reviewed by: kbowling, gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33156 (cherry picked from commit 52f45d8acee95199159b65a33c94142492c38e41) --- sys/dev/e1000/em_txrx.c | 2 +- sys/dev/ice/ice_iflib_txrx.c | 3 ++- sys/dev/ixgbe/ix_txrx.c | 6 +++--- sys/dev/ixl/ixl_txrx.c | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 1f1c13c9a099..58f9345ea19d 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -706,7 +706,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - if (if_getcapenable(ri->iri_ifp) & IFCAP_RXCSUM) + if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); if (staterr & E1000_RXD_STAT_VP) { diff --git a/sys/dev/ice/ice_iflib_txrx.c b/sys/dev/ice/ice_iflib_txrx.c index b370c68f4f3a..7d89c51ddec0 100644 --- a/sys/dev/ice/ice_iflib_txrx.c +++ b/sys/dev/ice/ice_iflib_txrx.c @@ -282,6 +282,7 @@ static int ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri) { struct ice_softc *sc = (struct ice_softc *)arg; + if_softc_ctx_t scctx = sc->scctx; struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[ri->iri_qsidx]; union ice_32b_rx_flex_desc *cur; u16 status0, plen, vtag, ptype; @@ -334,7 +335,7 @@ ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxq->stats.rx_packets++; rxq->stats.rx_bytes += ri->iri_len; - if ((iflib_get_ifp(sc->ctx)->if_capenable & IFCAP_RXCSUM) != 0) + if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0) ice_rx_checksum(rxq, &ri->iri_csum_flags, &ri->iri_csum_data, status0, ptype); ri->iri_flowid = le32toh(RX_FLEX_NIC(&cur->wb, rss_hash)); diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index 14e0fce11970..7c87b0ec10fc 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -393,9 +393,9 @@ static int ixgbe_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) { struct ixgbe_softc *sc = arg; + if_softc_ctx_t scctx = sc->shared; struct ix_rx_queue *que = &sc->rx_queues[ri->iri_qsidx]; struct rx_ring *rxr = &que->rxr; - struct ifnet *ifp = iflib_get_ifp(sc->ctx); union ixgbe_adv_rx_desc *rxd; uint16_t pkt_info, len, cidx, i; @@ -433,7 +433,7 @@ ixgbe_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) /* Make sure bad packets are discarded */ if (eop && (staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) { if (sc->feat_en & IXGBE_FEATURE_VF) - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + if_inc_counter(ri->iri_ifp, IFCOUNTER_IERRORS, 1); rxr->rx_discarded++; return (EBADMSG); @@ -452,7 +452,7 @@ ixgbe_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxr->packets++; rxr->rx_bytes += ri->iri_len; - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0) ixgbe_rx_checksum(staterr, ri, ptype); ri->iri_flowid = le32toh(rxd->wb.lower.hi_dword.rss); diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c index 15204b7996e5..ac3840362d80 100644 --- a/sys/dev/ixl/ixl_txrx.c +++ b/sys/dev/ixl/ixl_txrx.c @@ -658,6 +658,7 @@ static int ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) { struct ixl_vsi *vsi = arg; + if_softc_ctx_t scctx = vsi->shared; struct ixl_rx_queue *que = &vsi->rx_queues[ri->iri_qsidx]; struct rx_ring *rxr = &que->rxr; union i40e_rx_desc *cur; @@ -719,7 +720,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxr->packets++; rxr->rx_packets++; - if ((if_getcapenable(vsi->ifp) & IFCAP_RXCSUM) != 0) + if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0) rxr->csum_errs += ixl_rx_checksum(ri, status, error, ptype); ri->iri_flowid = le32toh(cur->wb.qword0.hi_dword.rss); ri->iri_rsstype = ixl_ptype_to_hash(ptype);