From nobody Sun Nov 24 07:40:31 2024 X-Original-To: dev-commits-src-main@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 4Xx13411ghz5dhCB; Sun, 24 Nov 2024 07:40: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 4Xx1340DYfz4jbh; Sun, 24 Nov 2024 07:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732434032; 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=haD4cIlZmDywIAUOuviGu/74dHVyV1qsl79+Ui16uV4=; b=OtMaw8/msv3VeOTP4MuXS9DWbd8y39ZIWEQkNaBndDp7Mr7RPS4wDn8Rn/916N1sXOEx2d f3RlgCatbLkGi8DJxd7VjLwFS3uwnw0F6paerGyfI3ND8lKJlOKU8RE5rKFH+6/5wfv5tH 9PZpwy/8EKtmVtEFTeQ07CuGEOsikIpjgYkGVGpTu6lMf9qdKrq5TTqGJJJBgv1J/y0jKO yHVTwt1XLWow1fQFOuCp3hghf3MPskpd1Q5TJKP6qesbfaXk4iW0FEzFlkvz6ezHUdobTO Fj5vF9BpSPEzhwmTbJymGPe0+vJFTKMrR0GRKec+x7JYtbw5x4eoHfoG1lEcoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732434032; 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=haD4cIlZmDywIAUOuviGu/74dHVyV1qsl79+Ui16uV4=; b=WbVezli14f+MI9k5HSCTByLevntiDJHentzzC7dN/5bKsIXBaDP9N96dB0J3fo88QsJqJn n3RKF/VeFMVj2xqwgTbL7UmwVlcwp7ppdifO9aPkuwCc+NfwaAauPaIV3Pd4ABLFvseCrJ i3XxwQKIktzJiAjvTkyIC0CcOm4LecLB/bihZsRGTK0C0tCUpzHMC4GO3vyQ/K6zWddqND eQzA1A2IKXqKEYamoaVxxnebq/eH/upr288jDNjJtIFl6eXoNwrGpOmwpbGLbCdNExZ1O+ Acm2vc/55eT+GETAn9a8ibxwyeDk9If8WP0EwnuuKJvS1Xct3Hnen5jowFmdbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732434032; a=rsa-sha256; cv=none; b=sqI+0/AMg68fprkQFv4pYSgFYv4rGdhcSQ/2XcX0mfemou35lkjLxRFJFsxN/szTVBS7Fo 42dn81Ypdgmqx6i1aArdLm5OBBxyNKtm6z6BQIuejVY0FSIJEvwgYL3pK6t3gWuNUMVPPi +cZv1RbDaYMMeIHp3RKeeAq66JRiPBgIy1KZwtDovUOtMubBaDzVwzc19qqpeF+NSGdD85 c0f0uG3b1ht+5u9AXLCEtbmmqr4MzB/6ziptv/TNhpK1wk4gobujAGfJA9RY6ETb77/AeB xKQB2VSG63OPymOlW2YJWZ3jPU1D1uXA4VQt2v/weguaEMemkhJauhFAgcaZ6w== 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 4Xx1336xjZzlWF; Sun, 24 Nov 2024 07:40: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 4AO7eVQg016207; Sun, 24 Nov 2024 07:40:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AO7eVHk016204; Sun, 24 Nov 2024 07:40:31 GMT (envelope-from git) Date: Sun, 24 Nov 2024 07:40:31 GMT Message-Id: <202411240740.4AO7eVHk016204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 7390daf87c53 - main - e1000: Style txrx List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 7390daf87c53073da5e74b2d73ac7320c1a44475 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=7390daf87c53073da5e74b2d73ac7320c1a44475 commit 7390daf87c53073da5e74b2d73ac7320c1a44475 Author: Kevin Bowling AuthorDate: 2024-11-24 07:39:43 +0000 Commit: Kevin Bowling CommitDate: 2024-11-24 07:39:43 +0000 e1000: Style txrx Fix up indentation and reflow long lines. MFC after: 3 days Sponsored by: BBOX.io --- 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 0978432fd329..aed97d076a5e 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3188,7 +3188,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); } }