From nobody Tue Jun 27 21:03:52 2023 X-Original-To: dev-commits-src-all@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 4QrHJ86b6yz4kdP1; Tue, 27 Jun 2023 21:03:52 +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 4QrHJ85x1Rz4Ygy; Tue, 27 Jun 2023 21:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687899832; 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=cZjdPG1nML3cojp8TY6IuNWoqe8lWfmSaWgIriLNzTI=; b=o0NDHlrkvsTH+xLyiqyF/2r+GHJnCGbMjGepeL7ix8ymbXEsXVeRydCq4C3xvtMXP7yZke Qp56fgjCrmiK5lyiRbV7zMBrbFVMSUZfzFGDN65/huIbgFHnX73FtMhg9JvHuSsSGDiHwP 4QcdNmYpxuQHZpgHYZBIpaGN5BpkQ05RKewh07P5ABPhBzMxfED5eXoFtkN5jr1Klp8U8P +38wDhYWjKXLqjIv3vMaB47eMJkM7kN5m9z6m4qEu/s4chgQSfflDrpPY6zDKe/fbbIHVo nCH0FCfcbMxsCgO6wlO7R5wQf32ISvVt6l3ThGynODKs5a6hiD+atc4R8/7+ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687899832; 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=cZjdPG1nML3cojp8TY6IuNWoqe8lWfmSaWgIriLNzTI=; b=kH1wRMu2Wg9qt1GBkV5UDCLnxM4SyIYjunHvrbj+kp9OE/R0HyD0Xe/pXu1/rqNNL4MWoA 2cvhJm+lJhR2K5qfeeG2XA6Ba6CFvCsZLYruPFSyMxNaYpzFVrlH76X+trjZ1IDK2tVlae y42v+9O5xWLxDV75CM0Eexc9AFqG4g4Y2YRWt8M9YsZ1uNWzd9M14WTfg+XlqwndByGqRw yi1kUr7C7zGmdiRMsOxp01WjGmCh70N1zXEsTewgK2XqybMUjwsCdgr9ZF4YeaSZQs3+Pn fUeKSKZWMCaS9xXqPHhoerU9MrWveTqAtyxO3ZU4ixLDVp2wmdl4ObNeMJLukA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687899832; a=rsa-sha256; cv=none; b=i+fwp9lPb44m9O0/xtNVzeNbvEfWuowqR7G7tLPHcnoPmzd8QUARGGFGS++G1HaiMBE82p UlYb3tWhma9eA2VJxUF4albQxnWkiixVNOJxpC+GY2MM0xH3IXyC2NDd/LJD5HBuQsRpct m/ZQrxPSvqJvdK1FCorW6XpQtOv096myGBXYmRzUVeTMwdwWxb0j9Whf+xz0cf/4poP93W 9xkLnudL0cJJP1DbQe1r/uqu72xA8c8MwiEVUy7MNnBfh64b7n2ddSMLZGJLdb37XnCx7N de1xzg+ksVuJoUkUlSjHLEkzwnmSt6rTnCqqDBpBNOKwKGMNi7bTwcOsDaHjLg== 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 4QrHJ84zGMz16sB; Tue, 27 Jun 2023 21:03:52 +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 35RL3qxB097733; Tue, 27 Jun 2023 21:03:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35RL3qDw097732; Tue, 27 Jun 2023 21:03:52 GMT (envelope-from git) Date: Tue, 27 Jun 2023 21:03:52 GMT Message-Id: <202306272103.35RL3qDw097732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 670a17e9f978 - stable/12 - e1000: Format em_txrx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 670a17e9f978a2821960fe3dcd4773469921b14d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=670a17e9f978a2821960fe3dcd4773469921b14d commit 670a17e9f978a2821960fe3dcd4773469921b14d Author: Kevin Bowling AuthorDate: 2023-06-09 02:06:04 +0000 Commit: Kevin Bowling CommitDate: 2023-06-27 21:03:36 +0000 e1000: Format em_txrx No functional changes intended. Reviewed by: markj (prior version) Differential Revision: https://reviews.freebsd.org/D30072 (cherry picked from commit 5253d74e4650300815af351cc510a1c392a16584) --- sys/dev/e1000/em_txrx.c | 77 +++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index aebafca73cca..6bff741ba665 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -42,10 +42,10 @@ /********************************************************************* * Local Function prototypes *********************************************************************/ -static int em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, - u32 *txd_lower); -static int em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, - u32 *txd_upper, u32 *txd_lower); +static int em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, + uint32_t *txd_upper, uint32_t *txd_lower); +static int em_transmit_checksum_setup(struct e1000_softc *sc, + if_pkt_info_t pi, uint32_t *txd_upper, uint32_t *txd_lower); static int em_isc_txd_encap(void *arg, if_pkt_info_t pi); static void em_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx); static int em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear); @@ -63,7 +63,7 @@ static int lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, static int lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri); static void em_receive_checksum(uint16_t, uint8_t, if_rxd_info_t); -static int em_determine_rsstype(u32 pkt_info); +static int em_determine_rsstype(uint32_t pkt_info); extern int em_intr(void *arg); struct if_txrx em_txrx = { @@ -116,7 +116,8 @@ em_dump_rs(struct e1000_softc *sc) cur = txr->tx_rsq[rs_cidx]; printf("qid[%d]->tx_rsq[rs_cidx-1=%d]: %d ", qid, rs_cidx, cur); } - printf("cidx_prev=%d rs_pidx=%d ",txr->tx_cidx_processed, txr->tx_rs_pidx); + printf("cidx_prev=%d rs_pidx=%d ",txr->tx_cidx_processed, + txr->tx_rs_pidx); for (i = 0; i < ntxd; i++) { if (txr->tx_base[i].upper.fields.status & E1000_TXD_STAT_DD) printf("%d set ", i); @@ -132,7 +133,8 @@ em_dump_rs(struct e1000_softc *sc) * **********************************************************************/ static int -em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower) +em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, + uint32_t *txd_lower) { if_softc_ctx_t scctx = sc->shared; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; @@ -159,7 +161,8 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_ TXD->lower_setup.ip_fields.ipcss = pi->ipi_ehdrlen; TXD->lower_setup.ip_fields.ipcse = htole16(pi->ipi_ehdrlen + pi->ipi_ip_hlen - 1); - TXD->lower_setup.ip_fields.ipcso = pi->ipi_ehdrlen + offsetof(struct ip, ip_sum); + TXD->lower_setup.ip_fields.ipcso = + pi->ipi_ehdrlen + offsetof(struct ip, ip_sum); /* * Start offset for payload checksum calculation. @@ -189,7 +192,8 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_ if (++cur == scctx->isc_ntxd[0]) { cur = 0; } - DPRINTF(iflib_get_dev(sc->ctx), "%s: pidx: %d cur: %d\n", __FUNCTION__, pi->ipi_pidx, cur); + DPRINTF(iflib_get_dev(sc->ctx), "%s: pidx: %d cur: %d\n", __FUNCTION__, + pi->ipi_pidx, cur); return (cur); } @@ -215,15 +219,16 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_ **********************************************************************/ static int -em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower) +em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, + uint32_t *txd_upper, uint32_t *txd_lower) { - struct e1000_context_desc *TXD = NULL; + struct e1000_context_desc *TXD = NULL; if_softc_ctx_t scctx = sc->shared; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; struct tx_ring *txr = &que->txr; int csum_flags = pi->ipi_csum_flags; int cur, hdr_len; - u32 cmd; + uint32_t cmd; cur = pi->ipi_pidx; hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen; @@ -260,7 +265,8 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_up */ TXD->lower_setup.ip_fields.ipcss = pi->ipi_ehdrlen; TXD->lower_setup.ip_fields.ipcse = htole16(hdr_len); - TXD->lower_setup.ip_fields.ipcso = pi->ipi_ehdrlen + offsetof(struct ip, ip_sum); + TXD->lower_setup.ip_fields.ipcso = pi->ipi_ehdrlen + + offsetof(struct ip, ip_sum); cmd |= E1000_TXD_CMD_IP; } @@ -293,8 +299,9 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_up if (++cur == scctx->isc_ntxd[0]) { cur = 0; } - DPRINTF(iflib_get_dev(sc->ctx), "checksum_setup csum_flags=%x txd_upper=%x txd_lower=%x hdr_len=%d cmd=%x\n", - csum_flags, *txd_upper, *txd_lower, hdr_len, cmd); + DPRINTF(iflib_get_dev(sc->ctx), + "checksum_setup csum_flags=%x txd_upper=%x txd_lower=%x hdr_len=%d cmd=%x\n", + csum_flags, *txd_upper, *txd_lower, hdr_len, cmd); return (cur); } @@ -309,7 +316,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) int nsegs = pi->ipi_nsegs; int csum_flags = pi->ipi_csum_flags; int i, j, first, pidx_last; - u32 txd_flags, txd_upper = 0, txd_lower = 0; + uint32_t txd_flags, txd_upper = 0, txd_lower = 0; struct e1000_tx_desc *ctxd = NULL; bool do_tso, tso_desc; @@ -347,7 +354,8 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) txd_lower |= htole32(E1000_TXD_CMD_VLE); } - DPRINTF(iflib_get_dev(sc->ctx), "encap: set up tx: nsegs=%d first=%d i=%d\n", nsegs, first, i); + DPRINTF(iflib_get_dev(sc->ctx), + "encap: set up tx: nsegs=%d first=%d i=%d\n", nsegs, first, i); /* XXX sc->pcix_82544 -- lem_fill_descriptors */ /* Set up our transmit descriptors */ @@ -383,7 +391,9 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) pidx_last = i; if (++i == scctx->isc_ntxd[0]) i = 0; - DPRINTF(iflib_get_dev(sc->ctx), "TSO path pidx_last=%d i=%d ntxd[0]=%d\n", pidx_last, i, scctx->isc_ntxd[0]); + DPRINTF(iflib_get_dev(sc->ctx), + "TSO path pidx_last=%d i=%d ntxd[0]=%d\n", + pidx_last, i, scctx->isc_ntxd[0]); } else { ctxd->buffer_addr = htole64(seg_addr); ctxd->lower.data = htole32(cmd | txd_lower | seg_len); @@ -391,7 +401,8 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) pidx_last = i; if (++i == scctx->isc_ntxd[0]) i = 0; - DPRINTF(iflib_get_dev(sc->ctx), "pidx_last=%d i=%d ntxd[0]=%d\n", pidx_last, i, scctx->isc_ntxd[0]); + DPRINTF(iflib_get_dev(sc->ctx), "pidx_last=%d i=%d ntxd[0]=%d\n", + pidx_last, i, scctx->isc_ntxd[0]); } } @@ -402,12 +413,15 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) */ if (txd_flags && nsegs) { txr->tx_rsq[txr->tx_rs_pidx] = pidx_last; - DPRINTF(iflib_get_dev(sc->ctx), "setting to RS on %d rs_pidx %d first: %d\n", pidx_last, txr->tx_rs_pidx, first); + DPRINTF(iflib_get_dev(sc->ctx), + "setting to RS on %d rs_pidx %d first: %d\n", + pidx_last, txr->tx_rs_pidx, first); txr->tx_rs_pidx = (txr->tx_rs_pidx+1) & (ntxd-1); MPASS(txr->tx_rs_pidx != txr->tx_rs_cidx); } ctxd->lower.data |= htole32(E1000_TXD_CMD_EOP | txd_flags); - DPRINTF(iflib_get_dev(sc->ctx), "tx_buffers[%d]->eop = %d ipi_new_pidx=%d\n", first, pidx_last, i); + DPRINTF(iflib_get_dev(sc->ctx), + "tx_buffers[%d]->eop = %d ipi_new_pidx=%d\n", first, pidx_last, i); pi->ipi_new_pidx = i; return (0); @@ -538,7 +552,8 @@ em_isc_rxd_refill(void *arg, if_rxd_update_t iru) } static void -em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx) +em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, + qidx_t pidx) { struct e1000_softc *sc = arg; struct em_rx_queue *que = &sc->rx_queues[rxqid]; @@ -555,7 +570,7 @@ lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct rx_ring *rxr = &que->rxr; struct e1000_rx_desc *rxd; - u32 staterr = 0; + uint32_t staterr = 0; int cnt, i; for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { @@ -580,7 +595,7 @@ em_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct rx_ring *rxr = &que->rxr; union e1000_rx_desc_extended *rxd; - u32 staterr = 0; + uint32_t staterr = 0; int cnt, i; for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { @@ -605,8 +620,8 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) struct em_rx_queue *que = &sc->rx_queues[ri->iri_qsidx]; struct rx_ring *rxr = &que->rxr; struct e1000_rx_desc *rxd; - u16 len; - u32 status, errors; + uint16_t len; + uint32_t status, errors; bool eop; int i, cidx; @@ -667,9 +682,9 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) struct rx_ring *rxr = &que->rxr; union e1000_rx_desc_extended *rxd; - u16 len; - u32 pkt_info; - u32 staterr = 0; + uint16_t len; + uint32_t pkt_info; + uint32_t staterr = 0; bool eop; int i, cidx; @@ -756,7 +771,7 @@ em_receive_checksum(uint16_t status, uint8_t errors, if_rxd_info_t ri) * ******************************************************************/ static int -em_determine_rsstype(u32 pkt_info) +em_determine_rsstype(uint32_t pkt_info) { switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) { case E1000_RXDADV_RSSTYPE_IPV4_TCP: @@ -765,7 +780,7 @@ em_determine_rsstype(u32 pkt_info) return M_HASHTYPE_RSS_IPV4; case E1000_RXDADV_RSSTYPE_IPV6_TCP: return M_HASHTYPE_RSS_TCP_IPV6; - case E1000_RXDADV_RSSTYPE_IPV6_EX: + case E1000_RXDADV_RSSTYPE_IPV6_EX: return M_HASHTYPE_RSS_IPV6_EX; case E1000_RXDADV_RSSTYPE_IPV6: return M_HASHTYPE_RSS_IPV6;