From owner-svn-src-head@freebsd.org Tue Jul 23 18:14:33 2019 Return-Path: Delivered-To: svn-src-head@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 C27CAAFAFA; Tue, 23 Jul 2019 18:14:33 +0000 (UTC) (envelope-from erj@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A30F86E705; Tue, 23 Jul 2019 18:14:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C00C1A16; Tue, 23 Jul 2019 18:14:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NIEX20012541; Tue, 23 Jul 2019 18:14:33 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NIEWLG012538; Tue, 23 Jul 2019 18:14:32 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201907231814.x6NIEWLG012538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 23 Jul 2019 18:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350253 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 350253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A30F86E705 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2019 18:14:33 -0000 Author: erj Date: Tue Jul 23 18:14:32 2019 New Revision: 350253 URL: https://svnweb.freebsd.org/changeset/base/350253 Log: 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 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Jul 23 18:12:44 2019 (r350252) +++ head/sys/dev/ixgbe/if_ix.c Tue Jul 23 18:14:32 2019 (r350253) @@ -425,7 +425,6 @@ ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs i); txr->adapter = que->adapter = adapter; - adapter->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++) @@ -2002,7 +2003,6 @@ ixgbe_if_msix_intr_assign(if_ctx_t ctx, int msix) } rx_que->msix = vector; - adapter->active_queues |= (u64)(1 << rx_que->msix); if (adapter->feat_en & IXGBE_FEATURE_RSS) { /* * The queue ID is used as the RSS layer bucket ID. @@ -3687,7 +3687,7 @@ ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t r struct adapter *adapter = iflib_get_softc(ctx); struct ix_rx_queue *que = &adapter->rx_queues[rxqid]; - ixgbe_enable_queue(adapter, que->rxr.me); + ixgbe_enable_queue(adapter, que->msix); return (0); } /* ixgbe_if_rx_queue_intr_enable */ @@ -3699,7 +3699,7 @@ static void ixgbe_enable_queue(struct adapter *adapter, u32 vector) { struct ixgbe_hw *hw = &adapter->hw; - u64 queue = (u64)(1 << vector); + u64 queue = 1ULL << vector; u32 mask; if (hw->mac.type == ixgbe_mac_82598EB) { @@ -3722,7 +3722,7 @@ static void ixgbe_disable_queue(struct adapter *adapter, u32 vector) { struct ixgbe_hw *hw = &adapter->hw; - u64 queue = (u64)(1 << vector); + u64 queue = 1ULL << vector; u32 mask; if (hw->mac.type == ixgbe_mac_82598EB) { Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Tue Jul 23 18:12:44 2019 (r350252) +++ head/sys/dev/ixgbe/if_ixv.c Tue Jul 23 18:14:32 2019 (r350253) @@ -268,7 +268,6 @@ ixv_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, txr->me = i; txr->adapter = que->adapter = adapter; - adapter->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))) { @@ -1038,8 +1037,6 @@ ixv_if_msix_intr_assign(if_ctx_t ctx, int msix) } rx_que->msix = vector; - adapter->active_queues |= (u64)(1 << rx_que->msix); - } for (int i = 0; i < adapter->num_tx_queues; i++) { Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Tue Jul 23 18:12:44 2019 (r350252) +++ head/sys/dev/ixgbe/ixgbe.h Tue Jul 23 18:14:32 2019 (r350253) @@ -339,7 +339,6 @@ struct rx_ring { struct ix_rx_queue { struct adapter *adapter; u32 msix; /* This queue's MSIX vector */ - u32 eims; /* This queue's EIMS bit */ u32 eitr_setting; struct resource *res; void *tag; @@ -442,7 +441,6 @@ struct adapter { */ struct ix_tx_queue *tx_queues; struct ix_rx_queue *rx_queues; - u64 active_queues; /* Multicast array memory */ struct ixgbe_mc_addr *mta;