From nobody Wed Nov 27 02:14:31 2024 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 4XyjgX35TNz5fMmv; Wed, 27 Nov 2024 02:14:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XyjgX1HNyz4gXl; Wed, 27 Nov 2024 02:14:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732673672; 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=tacDjT/8tT95A0OznmV77BK4h90FkgA6v2+obayQtg0=; b=dtQw1V6O64sRTBOBLiM0Fmp6zAY9WQGYal1cHW+AzX8k9+pOds4qqvLONxqaCqnG6O2bFz ixX/1FijNNEvlm56CDVyuFic45zYWoc12Jv1PVE+7q+CVgzZlzMPRssKm6lkNI1bvbZ/ot UTEzWBCGFnNNfse0YrEWnIOg80/2GYDJUCUVf6WxT0fkVF/C8/bDxjwQ7RjAzQhfaw231D wBG/8eNo1mONQZH+mqmfh8Cz1Xl4OmDiSmkZPRYB2w1qQpc4lMAgwuCEmj0QxJ6deV0mUG nR11UF9NKcKVUXxDBKBE7kSvxyurw7SYeUatEL3pq5IOqQyimbNOjAujpIT8og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732673672; 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=tacDjT/8tT95A0OznmV77BK4h90FkgA6v2+obayQtg0=; b=hzXlCOLVU1P4Z9EJyQG100pgf9wkT1OsfQCk1m7WWqdIxVnNxwZt6ne3KJOLc/Nx7r4jcV sazO9LzW1WOS7HOKh1/iXUjq1FTHRUuX3CtuOv5jOr8TqxVLOeaZuze22GCyazPJL1WK81 MzOg5ar4vuGIWUQdhE56LLKbjOqXMTnGagqJpBvN6T9fXcxaGbjhTYcRJGWjN5OrCdcWyf 7Jr+rs9GTMxFPjYMsRjM5TsPGdklXGynOOxYLiE2Ga7xFg/z30zuOXxq1SibUFjCgMyt2e 8YwvOBCRuSIBfd1S4m56nelyU1XYQza6Tm8cqlGY48Ohcz6g1iQR7bclThgO5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732673672; a=rsa-sha256; cv=none; b=qvJksdQYUiKBdB67JyQEXPz/z4fZ0k7oe5ctTX6ClwytqwMuC6+0js3sRNSVMbaGowkaIm OvqkxryYVw41Mlrxig/38Ph64pbNunGCMfPr+Qsf8LKD0hpFMQECAaqvfdU5zvy3n63GAd AuFUzWhNXYCu++E9RCaarkCK6Cb1AyW6IUmYSxyIQQUS9D18AO0XabFL+VpKyT5MaBMiNj HV06WKEhF5kLg1oPVkssB2BOLZln5WKrDMRl0q8Bo5rdjKttIDdUqDI1FEd2zquT62BTVT anU8KXpHQiF+99wLJHQyc38bloOUf+rcavX91bt8dkZh6QMCvazgkOgE2w2WuA== 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 4XyjgW6r3QzqWL; Wed, 27 Nov 2024 02:14:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AR2EVLB067052; Wed, 27 Nov 2024 02:14:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AR2EV4p067049; Wed, 27 Nov 2024 02:14:31 GMT (envelope-from git) Date: Wed, 27 Nov 2024 02:14:31 GMT Message-Id: <202411270214.4AR2EV4p067049@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: 2f2938d9422b - stable/13 - e1000: Style 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 2f2938d9422bc07f0a7c3e2525ce63a6c34b6aa3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2f2938d9422bc07f0a7c3e2525ce63a6c34b6aa3 commit 2f2938d9422bc07f0a7c3e2525ce63a6c34b6aa3 Author: Kevin Bowling AuthorDate: 2024-11-24 07:39:43 +0000 Commit: Kevin Bowling CommitDate: 2024-11-27 01:18:58 +0000 e1000: Style txrx Fix up indentation and reflow long lines. Sponsored by: BBOX.io (cherry picked from commit 7390daf87c53073da5e74b2d73ac7320c1a44475) --- sys/dev/e1000/em_txrx.c | 55 ++++++++++++++++++++++++++++++------------------ sys/dev/e1000/if_em.c | 3 ++- sys/dev/e1000/igb_txrx.c | 44 ++++++++++++++++++++++---------------- 3 files changed, 62 insertions(+), 40 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 65ffcdfd67f6..edbe0f8ab546 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -108,16 +108,19 @@ em_dump_rs(struct e1000_softc *sc) cur = txr->tx_rsq[rs_cidx]; status = txr->tx_base[cur].upper.fields.status; if (!(status & E1000_TXD_STAT_DD)) - printf("qid[%d]->tx_rsq[%d]: %d clear ", qid, rs_cidx, cur); + printf("qid[%d]->tx_rsq[%d]: %d clear ", + qid, rs_cidx, cur); } else { rs_cidx = (rs_cidx-1)&(ntxd-1); cur = txr->tx_rsq[rs_cidx]; - printf("qid[%d]->tx_rsq[rs_cidx-1=%d]: %d ", qid, rs_cidx, cur); + 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); for (i = 0; i < ntxd; i++) { - if (txr->tx_base[i].upper.fields.status & E1000_TXD_STAT_DD) + if (txr->tx_base[i].upper.fields.status & + E1000_TXD_STAT_DD) printf("%d set ", i); } printf("\n"); @@ -143,8 +146,8 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; *txd_lower = (E1000_TXD_CMD_DEXT | /* Extended descr type */ - E1000_TXD_DTYP_D | /* Data descr type */ - E1000_TXD_CMD_TSE); /* Do TSE on this packet */ + E1000_TXD_DTYP_D | /* Data descr type */ + E1000_TXD_CMD_TSE); /* Do TSE on this packet */ cur = pi->ipi_pidx; TXD = (struct e1000_context_desc *)&txr->tx_base[cur]; @@ -157,7 +160,8 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, switch(pi->ipi_etype) { case ETHERTYPE_IP: /* IP and/or TCP header checksum calculation and insertion. */ - *txd_upper = (E1000_TXD_POPTS_IXSM | E1000_TXD_POPTS_TXSM) << 8; + *txd_upper = + (E1000_TXD_POPTS_IXSM | E1000_TXD_POPTS_TXSM) << 8; TXD->lower_setup.ip_fields.ipcse = htole16(pi->ipi_ehdrlen + pi->ipi_ip_hlen - 1); @@ -183,7 +187,8 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, TXD->upper_setup.tcp_fields.tucss = pi->ipi_ehdrlen + pi->ipi_ip_hlen; TXD->upper_setup.tcp_fields.tucse = 0; TXD->upper_setup.tcp_fields.tucso = - pi->ipi_ehdrlen + pi->ipi_ip_hlen + offsetof(struct tcphdr, th_sum); + pi->ipi_ehdrlen + pi->ipi_ip_hlen + + offsetof(struct tcphdr, th_sum); /* * Payload size per packet w/o any headers. @@ -211,8 +216,8 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, 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); } @@ -277,8 +282,8 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, * ipcse - End offset for header checksum calculation. * ipcso - Offset of place to put the checksum. * - * We set ipcsX values regardless of IP version to work around HW issues - * and ipcse must be 0 for IPv6 per "PCIe GbE SDM 2.5" page 61. + * We set ipcsX values regardless of IP version to work around HW + * issues and ipcse must be 0 for IPv6 per "PCIe GbE SDM 2.5" page 61. * IXSM controls whether it's inserted. */ TXD->lower_setup.ip_fields.ipcss = pi->ipi_ehdrlen; @@ -296,7 +301,8 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, * tucse - End offset for payload checksum calculation. * tucso - Offset of place to put the checksum. */ - if (csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_IP6_TCP | CSUM_IP6_UDP)) { + if (csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_IP6_TCP | + CSUM_IP6_UDP)) { uint8_t tucso; *txd_upper |= E1000_TXD_POPTS_TXSM << 8; @@ -326,7 +332,8 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, 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", + "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); } @@ -372,7 +379,8 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) i = em_tso_setup(sc, pi, &txd_upper, &txd_lower); tso_desc = true; } else if (csum_flags & EM_CSUM_OFFLOAD) { - i = em_transmit_checksum_setup(sc, pi, &txd_upper, &txd_lower); + i = em_transmit_checksum_setup(sc, pi, &txd_upper, + &txd_lower); } if (pi->ipi_mflags & M_VLANTAG) { @@ -414,7 +422,8 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) /* Now make the sentinel */ ctxd = &txr->tx_base[i]; ctxd->buffer_addr = htole64(seg_addr + seg_len); - ctxd->lower.data = htole32(cmd | txd_lower | TSO_WORKAROUND); + ctxd->lower.data = + htole32(cmd | txd_lower | TSO_WORKAROUND); ctxd->upper.data = htole32(txd_upper); pidx_last = i; if (++i == scctx->isc_ntxd[0]) @@ -429,7 +438,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", + DPRINTF(iflib_get_dev(sc->ctx), + "pidx_last=%d i=%d ntxd[0]=%d\n", pidx_last, i, scctx->isc_ntxd[0]); } } @@ -449,7 +459,8 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) } 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); + "tx_buffers[%d]->eop = %d ipi_new_pidx=%d\n", + first, pidx_last, i); pi->ipi_new_pidx = i; /* Sent data accounting for AIM */ @@ -508,8 +519,8 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear) delta += ntxd; MPASS(delta > 0); DPRINTF(iflib_get_dev(sc->ctx), - "%s: cidx_processed=%u cur=%u clear=%d delta=%d\n", - __FUNCTION__, prev, cur, clear, delta); + "%s: cidx_processed=%u cur=%u clear=%d delta=%d\n", + __FUNCTION__, prev, cur, clear, delta); processed += delta; prev = cur; @@ -699,7 +710,8 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); + ri->iri_vtag = + le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); ri->iri_flags |= M_VLANTAG; } @@ -789,7 +801,8 @@ em_receive_checksum(uint16_t status, uint8_t errors, if_rxd_info_t ri) return; /* If there is a layer 3 or 4 error we are done */ - if (__predict_false(errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE))) + if (__predict_false(errors & (E1000_RXD_ERR_IPE | + E1000_RXD_ERR_TCPE))) return; /* IP Checksum Good */ diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b6710919a997..d47d8d5e1fcc 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3158,7 +3158,8 @@ em_reset(if_ctx_t ctx) * response (Rx) to Ethernet PAUSE frames. * - High water mark should allow for at least two frames to be * received after sending an XOFF. - * - Low water mark works best when it is very near the high water mark + * - Low water mark works best when it is very near the high water + mark. * This allows the receiver to restart by sending XON when it has * drained a bit. Here we use an arbitrary value of 1500 which will * restart after one full frame is pulled from the buffer. There diff --git a/sys/dev/e1000/igb_txrx.c b/sys/dev/e1000/igb_txrx.c index 8b663d7e6d3e..568d84807173 100644 --- a/sys/dev/e1000/igb_txrx.c +++ b/sys/dev/e1000/igb_txrx.c @@ -102,14 +102,15 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, break; default: panic("%s: CSUM_TSO but no supported IP version (0x%04x)", - __func__, ntohs(pi->ipi_etype)); + __func__, ntohs(pi->ipi_etype)); break; } - TXD = (struct e1000_adv_tx_context_desc *) &txr->tx_base[pi->ipi_pidx]; + TXD = (struct e1000_adv_tx_context_desc *)&txr->tx_base[pi->ipi_pidx]; /* This is used in the transmit desc in encap */ - paylen = pi->ipi_len - pi->ipi_ehdrlen - pi->ipi_ip_hlen - pi->ipi_tcp_hlen; + paylen = pi->ipi_len - pi->ipi_ehdrlen - pi->ipi_ip_hlen - + pi->ipi_tcp_hlen; /* VLAN MACLEN IPLEN */ if (pi->ipi_mflags & M_VLANTAG) { @@ -147,8 +148,8 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, * **********************************************************************/ static int -igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, - uint32_t *olinfo_status) +igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, + uint32_t *cmd_type_len, uint32_t *olinfo_status) { struct e1000_adv_tx_context_desc *TXD; struct e1000_softc *sc = txr->sc; @@ -164,7 +165,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, *olinfo_status |= pi->ipi_len << E1000_ADVTXD_PAYLEN_SHIFT; /* Now ready a context descriptor */ - TXD = (struct e1000_adv_tx_context_desc *) &txr->tx_base[pi->ipi_pidx]; + TXD = (struct e1000_adv_tx_context_desc *)&txr->tx_base[pi->ipi_pidx]; /* ** In advanced descriptors the vlan tag must @@ -246,8 +247,8 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi) pidx_last = olinfo_status = 0; /* Basic descriptor defines */ - cmd_type_len = (E1000_ADVTXD_DTYP_DATA | - E1000_ADVTXD_DCMD_IFCS | E1000_ADVTXD_DCMD_DEXT); + cmd_type_len = (E1000_ADVTXD_DTYP_DATA | E1000_ADVTXD_DCMD_IFCS | + E1000_ADVTXD_DCMD_DEXT); if (pi->ipi_mflags & M_VLANTAG) cmd_type_len |= E1000_ADVTXD_DCMD_VLE; @@ -300,9 +301,9 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi) static void igb_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx) { - struct e1000_softc *sc = arg; - struct em_tx_queue *que = &sc->tx_queues[txqid]; - struct tx_ring *txr = &que->txr; + struct e1000_softc *sc = arg; + struct em_tx_queue *que = &sc->tx_queues[txqid]; + struct tx_ring *txr = &que->txr; E1000_WRITE_REG(&sc->hw, E1000_TDT(txr->me), pidx); } @@ -351,7 +352,8 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear) if (rs_cidx == txr->tx_rs_pidx) break; cur = txr->tx_rsq[rs_cidx]; - status = ((union e1000_adv_tx_desc *)&txr->tx_base[cur])->wb.status; + status = ((union e1000_adv_tx_desc *) + &txr->tx_base[cur])->wb.status; } while ((status & E1000_TXD_STAT_DD)); txr->tx_rs_cidx = rs_cidx; @@ -387,7 +389,8 @@ igb_isc_rxd_refill(void *arg, if_rxd_update_t iru) } static void -igb_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx) +igb_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]; @@ -453,7 +456,8 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) MPASS ((staterr & E1000_RXD_STAT_DD) != 0); len = le16toh(rxd->wb.upper.length); - ptype = le32toh(rxd->wb.lower.lo_dword.data) & IGB_PKTTYPE_MASK; + ptype = + le32toh(rxd->wb.lower.lo_dword.data) & IGB_PKTTYPE_MASK; ri->iri_len += len; rxr->rx_bytes += ri->iri_len; @@ -462,7 +466,8 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP); /* Make sure bad packets are discarded */ - if (eop && ((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0)) { + if (eop && + ((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0)) { sc->dropped_pkts++; ++rxr->rx_discarded; return (EBADMSG); @@ -524,7 +529,8 @@ igb_rx_checksum(uint32_t staterr, if_rxd_info_t ri, uint32_t ptype) return; /* If there is a layer 3 or 4 error we are done */ - if (__predict_false(errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE))) + if (__predict_false(errors & + (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE))) return; /* IP Checksum Good */ @@ -535,11 +541,13 @@ igb_rx_checksum(uint32_t staterr, if_rxd_info_t ri, uint32_t ptype) if (__predict_true(status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))) { /* SCTP header present */ - if (__predict_false((ptype & E1000_RXDADV_PKTTYPE_ETQF) == 0 && + if (__predict_false( + (ptype & E1000_RXDADV_PKTTYPE_ETQF) == 0 && (ptype & E1000_RXDADV_PKTTYPE_SCTP) != 0)) { ri->iri_csum_flags |= CSUM_SCTP_VALID; } else { - ri->iri_csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + ri->iri_csum_flags |= + CSUM_DATA_VALID | CSUM_PSEUDO_HDR; ri->iri_csum_data = htons(0xffff); } }