From owner-dev-commits-src-branches@freebsd.org Sun Oct 3 05:04:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBBEB6B090C; Sun, 3 Oct 2021 05:04:21 +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 4HMWwj4WrGz4QxJ; Sun, 3 Oct 2021 05:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7BD311FE5F; Sun, 3 Oct 2021 05:04:21 +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 19354Lgd095073; Sun, 3 Oct 2021 05:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19354LCt095072; Sun, 3 Oct 2021 05:04:21 GMT (envelope-from git) Date: Sun, 3 Oct 2021 05:04:21 GMT Message-Id: <202110030504.19354LCt095072@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: cfb3a1dee11c - stable/12 - ixgbe(4): Fix enabling/disabling and reconfiguration of queues 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: cfb3a1dee11c776a6aedd1c8fb3f86f9b7240e9a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 05:04:21 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cfb3a1dee11c776a6aedd1c8fb3f86f9b7240e9a commit cfb3a1dee11c776a6aedd1c8fb3f86f9b7240e9a Author: Eric Joyner AuthorDate: 2019-07-23 18:14:32 +0000 Commit: Kevin Bowling CommitDate: 2021-10-03 01:53:12 +0000 ixgbe(4): Fix enabling/disabling and reconfiguration of queues - Wrong order of casting and bit shift caused that enabling and disabling queues didn't work properly for queues number larger than 32. Use literals with right suffix instead. - TX ring tail address was not updated during reinitiailzation of TX structures. It could block sending traffic. - Also remove unused variables 'eims' and 'active_queues'. Submitted by: Krzysztof Galazka Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20826 (cherry picked from commit 2dc2d580354e95491a033fa9e21c8ef0cbd9bc42) --- sys/dev/ixgbe/if_ix.c | 10 +++++----- sys/dev/ixgbe/if_ixv.c | 3 --- sys/dev/ixgbe/ixgbe.h | 2 -- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index d69a8ef80ef6..fa52b58ac1bd 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -425,7 +425,6 @@ ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, i); txr->sc = que->sc = sc; - sc->active_queues |= (u64)1 << txr->me; /* Allocate report status array */ txr->tx_rsq = (qidx_t *)malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_IXGBE, M_NOWAIT | M_ZERO); @@ -796,6 +795,8 @@ ixgbe_initialize_transmit_units(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ + txr->tail = IXGBE_TDT(txr->me); + txr->tx_rs_cidx = txr->tx_rs_pidx; txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; for (int k = 0; k < scctx->isc_ntxd[0]; k++) @@ -2052,7 +2053,6 @@ ixgbe_if_msix_intr_assign(if_ctx_t ctx, int msix) } rx_que->msix = vector; - sc->active_queues |= (u64)(1 << rx_que->msix); if (sc->feat_en & IXGBE_FEATURE_RSS) { /* * The queue ID is used as the RSS layer bucket ID. @@ -3740,7 +3740,7 @@ ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) struct ixgbe_softc *sc = iflib_get_softc(ctx); struct ix_rx_queue *que = &sc->rx_queues[rxqid]; - ixgbe_enable_queue(sc, que->rxr.me); + ixgbe_enable_queue(sc, que->msix); return (0); } /* ixgbe_if_rx_queue_intr_enable */ @@ -3752,7 +3752,7 @@ static void ixgbe_enable_queue(struct ixgbe_softc *sc, u32 vector) { struct ixgbe_hw *hw = &sc->hw; - u64 queue = (u64)(1 << vector); + u64 queue = 1ULL << vector; u32 mask; if (hw->mac.type == ixgbe_mac_82598EB) { @@ -3775,7 +3775,7 @@ static void ixgbe_disable_queue(struct ixgbe_softc *sc, u32 vector) { struct ixgbe_hw *hw = &sc->hw; - u64 queue = (u64)(1 << vector); + u64 queue = 1ULL << vector; u32 mask; if (hw->mac.type == ixgbe_mac_82598EB) { diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 25654ff60950..3eb7a1f5a1b7 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -271,7 +271,6 @@ ixv_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, txr->me = i; txr->sc = que->sc = sc; - sc->active_queues |= (u64)1 << txr->me; /* Allocate report status array */ if (!(txr->tx_rsq = (qidx_t *)malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_DEVBUF, M_NOWAIT | M_ZERO))) { @@ -1039,8 +1038,6 @@ ixv_if_msix_intr_assign(if_ctx_t ctx, int msix) } rx_que->msix = vector; - sc->active_queues |= (u64)(1 << rx_que->msix); - } for (int i = 0; i < sc->num_tx_queues; i++) { diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 45f5b88fd1f1..00b01f71c996 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -337,7 +337,6 @@ struct rx_ring { struct ix_rx_queue { struct ixgbe_softc *sc; u32 msix; /* This queue's MSIX vector */ - u32 eims; /* This queue's EIMS bit */ u32 eitr_setting; struct resource *res; void *tag; @@ -440,7 +439,6 @@ struct ixgbe_softc { */ struct ix_tx_queue *tx_queues; struct ix_rx_queue *rx_queues; - u64 active_queues; /* Multicast array memory */ struct ixgbe_mc_addr *mta;