svn commit: r350253 - head/sys/dev/ixgbe
Eric Joyner
erj at FreeBSD.org
Tue Jul 23 18:14:33 UTC 2019
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 <krzysztof.galazka at intel.com>
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;
More information about the svn-src-all
mailing list