Commit 3be1adfb authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Garzik
Browse files

ixgbe: change config srrctl to only program one register per VMDq/RSS id



This change makes it so only one srrctl register is programmed per VMDq id, and if VMDq is not enabled it is one register per RSS queue.  Currently this function is working correctly for the multiqueue RSS and single queue cases, but if any advances features such as VMDq or DCB would have been enabled this function would have caused issues as it was not correct.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 1a32bcfb
...@@ -1417,18 +1417,23 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index) ...@@ -1417,18 +1417,23 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index)
struct ixgbe_ring *rx_ring; struct ixgbe_ring *rx_ring;
u32 srrctl; u32 srrctl;
int queue0; int queue0;
unsigned long *mask, maskval = 1; unsigned long mask;
long shift, len;
/* program one srrctl register per VMDq index */
if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) {
mask = (unsigned long *) &adapter->ring_feature[RING_F_RSS].mask; long shift, len;
len = sizeof(adapter->ring_feature[RING_F_RSS].mask) * 8; mask = (unsigned long) adapter->ring_feature[RING_F_RSS].mask;
len = sizeof(adapter->ring_feature[RING_F_VMDQ].mask) * 8;
shift = find_first_bit(&mask, len);
queue0 = index & mask;
index = (index & mask) >> shift;
/* program one srrctl per RSS queue since RDRXCTL.MVMEN is enabled */
} else { } else {
mask = &maskval; mask = (unsigned long) adapter->ring_feature[RING_F_RSS].mask;
len = 1; queue0 = index & mask;
index = index & mask;
} }
shift = find_first_bit(mask, len);
queue0 = index << shift;
rx_ring = &adapter->rx_ring[queue0]; rx_ring = &adapter->rx_ring[queue0];
srrctl = IXGBE_READ_REG(&adapter->hw, IXGBE_SRRCTL(index)); srrctl = IXGBE_READ_REG(&adapter->hw, IXGBE_SRRCTL(index));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment