From nobody Fri Jun 09 02:08:25 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 4QckyK67vTz4b8VT; Fri, 9 Jun 2023 02:08:25 +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 4QckyK5Yhcz3xxm; Fri, 9 Jun 2023 02:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686276505; 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=JR7BrXNf7zzZbwK0XmyIyURNx6QE/+iHlL2QXoOP2xM=; b=UAniHkWjlicYKCaO0u8xVTJrMEY5A9YWh+ayBckUPE05AUJmh239KNQ2lOB1j7Ssk7shV/ CpfiNfyhxWWJqlfkIvqo9OIkdhVqmlwWcTg7OxVMqEfMO2UrT0ZFTzIThFg3mxhXdAdaKC UFsxnGB2tdwm7x7hFZhXrJnwTn1Jgcv6FK7eJyKXjjggGoiAaNu+sboBeMXeYXxGUT5XE9 1V28lbFc/Gv5OAAJVZmIKcjTF50MVwz9krLwkLvrogEu5RhNm4Xdyuq/mBOaQrgvbJaLOp 3B904h8QPiHGcEHtpTSbJYK8u2NQlbNwV0LNiybV4AYzds18PV8JSusxZW407Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686276505; 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=JR7BrXNf7zzZbwK0XmyIyURNx6QE/+iHlL2QXoOP2xM=; b=NEXsA4wJ2vOI5w6OlOjtqUzHja2FnMlNS44nACbq2+2xBUIkAl7M3PAEiIouCCxihmsxmt FK6sfZvL6dfBQyJ3hqjSie+/bMu57flQGQmrf/e32Ftns65FBbT4ZJ5Z3tOXQxvkZfUGc8 88ieWzcfWlxRi5H2PriHhFKNI5JHZDmTI43Rmo88O+DqfjZEvxsjJsM1i4pFIqWcqwiB1/ W4bA+k9cKz9Q3H3ZxZkFtG7C+iG9H5GGMC1bxviHe4LZGY8F4UavOwnppcVasyNlvMGb5p bQ/fTmPbH5e6Op0s6+72RR+CdxOvmNiY/4kQgQRRl65SfqMln4bzDVj8VJFEKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686276505; a=rsa-sha256; cv=none; b=p68/mCQHDsA27XwbhHUsZtn5OJdRZvuP59z38mgwiG7BwAfLYjeMlU0D78ONjSJYHhS3QC YiCw8puGZUFaUGIjCGAa/OTK9IqxSZUj0BLYngxV/WcxNgj/U6D9yiNIPD3BfZOO7F+nKe yUY70zj1IGD8r+22ztLfip5rKO71fOh4gzNlG0jU9w9LYBLMEKtP+Aa/AqYXh5px2O1j9g AutZkO6p6Nj/g8fCjruXPt5Z2nvrwhCAdFcZO4oh8fvIUt+CFvCS8sSeAnAw3aQX7ZQDeJ D82AUZUBWL785d3aGI3fZV97DLNF9aiIWnKacrt12PTLE5Uy3st85jR8IWIIAg== 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 4QckyK4csSzJ3T; Fri, 9 Jun 2023 02:08:25 +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 35928PQe006334; Fri, 9 Jun 2023 02:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35928Pv3006333; Fri, 9 Jun 2023 02:08:25 GMT (envelope-from git) Date: Fri, 9 Jun 2023 02:08:25 GMT Message-Id: <202306090208.35928Pv3006333@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: 5253d74e4650 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 5253d74e4650300815af351cc510a1c392a16584 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5253d74e4650300815af351cc510a1c392a16584 commit 5253d74e4650300815af351cc510a1c392a16584 Author: Kevin Bowling AuthorDate: 2023-06-09 02:06:04 +0000 Commit: Kevin Bowling CommitDate: 2023-06-09 02:06:04 +0000 e1000: Format em_txrx No functional changes intended. Reviewed by: markj (prior version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30072 --- 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 5f4919b0cdfd..255aea6347d2 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -44,10 +44,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); @@ -65,7 +65,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 = { @@ -118,7 +118,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); @@ -134,7 +135,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]; @@ -161,7 +163,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. @@ -191,7 +194,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); } @@ -217,15 +221,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; @@ -262,7 +267,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; } @@ -295,8 +301,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); } @@ -311,7 +318,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; @@ -349,7 +356,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 */ @@ -385,7 +393,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); @@ -393,7 +403,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]); } } @@ -404,12 +415,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); @@ -540,7 +554,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]; @@ -557,7 +572,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;) { @@ -582,7 +597,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;) { @@ -607,8 +622,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; @@ -669,9 +684,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; @@ -758,7 +773,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: @@ -767,7 +782,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;