Skip to content

Commit 2af62c5

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Add support for macvlan offload RSS on X550 and clean-up pool handling
In order for RSS to work on the macvlan pools of the X550 we need to populate the MRQC, RETA, and RSS key values for each pool. This patch makes it so that we now take care of that. In addition I have dropped the macvlan specific configuration of psrtype since it is redundant with the code that already exists for configuring this value. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 2097db7 commit 2af62c5

File tree

1 file changed

+25
-37
lines changed

1 file changed

+25
-37
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,16 +3846,20 @@ static void ixgbe_store_vfreta(struct ixgbe_adapter *adapter)
38463846
u32 i, reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
38473847
struct ixgbe_hw *hw = &adapter->hw;
38483848
u32 vfreta = 0;
3849-
unsigned int pf_pool = adapter->num_vfs;
38503849

38513850
/* Write redirection table to HW */
38523851
for (i = 0; i < reta_entries; i++) {
3852+
u16 pool = adapter->num_rx_pools;
3853+
38533854
vfreta |= (u32)adapter->rss_indir_tbl[i] << (i & 0x3) * 8;
3854-
if ((i & 3) == 3) {
3855-
IXGBE_WRITE_REG(hw, IXGBE_PFVFRETA(i >> 2, pf_pool),
3855+
if ((i & 3) != 3)
3856+
continue;
3857+
3858+
while (pool--)
3859+
IXGBE_WRITE_REG(hw,
3860+
IXGBE_PFVFRETA(i >> 2, VMDQ_P(pool)),
38563861
vfreta);
3857-
vfreta = 0;
3858-
}
3862+
vfreta = 0;
38593863
}
38603864
}
38613865

@@ -3892,13 +3896,17 @@ static void ixgbe_setup_vfreta(struct ixgbe_adapter *adapter)
38923896
{
38933897
struct ixgbe_hw *hw = &adapter->hw;
38943898
u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
3895-
unsigned int pf_pool = adapter->num_vfs;
38963899
int i, j;
38973900

38983901
/* Fill out hash function seeds */
3899-
for (i = 0; i < 10; i++)
3900-
IXGBE_WRITE_REG(hw, IXGBE_PFVFRSSRK(i, pf_pool),
3901-
*(adapter->rss_key + i));
3902+
for (i = 0; i < 10; i++) {
3903+
u16 pool = adapter->num_rx_pools;
3904+
3905+
while (pool--)
3906+
IXGBE_WRITE_REG(hw,
3907+
IXGBE_PFVFRSSRK(i, VMDQ_P(pool)),
3908+
*(adapter->rss_key + i));
3909+
}
39023910

39033911
/* Fill out the redirection table */
39043912
for (i = 0, j = 0; i < 64; i++, j++) {
@@ -3964,7 +3972,7 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
39643972

39653973
if ((hw->mac.type >= ixgbe_mac_X550) &&
39663974
(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) {
3967-
unsigned int pf_pool = adapter->num_vfs;
3975+
u16 pool = adapter->num_rx_pools;
39683976

39693977
/* Enable VF RSS mode */
39703978
mrqc |= IXGBE_MRQC_MULTIPLE_RSS;
@@ -3974,7 +3982,11 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
39743982
ixgbe_setup_vfreta(adapter);
39753983
vfmrqc = IXGBE_MRQC_RSSEN;
39763984
vfmrqc |= rss_field;
3977-
IXGBE_WRITE_REG(hw, IXGBE_PFVFMRQC(pf_pool), vfmrqc);
3985+
3986+
while (pool--)
3987+
IXGBE_WRITE_REG(hw,
3988+
IXGBE_PFVFMRQC(VMDQ_P(pool)),
3989+
vfmrqc);
39783990
} else {
39793991
ixgbe_setup_reta(adapter);
39803992
mrqc |= rss_field;
@@ -4137,7 +4149,7 @@ static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter)
41374149
{
41384150
struct ixgbe_hw *hw = &adapter->hw;
41394151
int rss_i = adapter->ring_feature[RING_F_RSS].indices;
4140-
u16 pool;
4152+
u16 pool = adapter->num_rx_pools;
41414153

41424154
/* PSRTYPE must be initialized in non 82598 adapters */
41434155
u32 psrtype = IXGBE_PSRTYPE_TCPHDR |
@@ -4154,7 +4166,7 @@ static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter)
41544166
else if (rss_i > 1)
41554167
psrtype |= 1u << 29;
41564168

4157-
for_each_set_bit(pool, &adapter->fwd_bitmask, 32)
4169+
while (pool--)
41584170
IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(VMDQ_P(pool)), psrtype);
41594171
}
41604172

@@ -5270,29 +5282,6 @@ static void ixgbe_macvlan_set_rx_mode(struct net_device *dev, unsigned int pool,
52705282
IXGBE_WRITE_REG(hw, IXGBE_VMOLR(pool), vmolr);
52715283
}
52725284

5273-
static void ixgbe_fwd_psrtype(struct ixgbe_fwd_adapter *vadapter)
5274-
{
5275-
struct ixgbe_adapter *adapter = vadapter->real_adapter;
5276-
int rss_i = adapter->num_rx_queues_per_pool;
5277-
struct ixgbe_hw *hw = &adapter->hw;
5278-
u16 pool = vadapter->pool;
5279-
u32 psrtype = IXGBE_PSRTYPE_TCPHDR |
5280-
IXGBE_PSRTYPE_UDPHDR |
5281-
IXGBE_PSRTYPE_IPV4HDR |
5282-
IXGBE_PSRTYPE_L2HDR |
5283-
IXGBE_PSRTYPE_IPV6HDR;
5284-
5285-
if (hw->mac.type == ixgbe_mac_82598EB)
5286-
return;
5287-
5288-
if (rss_i > 3)
5289-
psrtype |= 2u << 29;
5290-
else if (rss_i > 1)
5291-
psrtype |= 1u << 29;
5292-
5293-
IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(VMDQ_P(pool)), psrtype);
5294-
}
5295-
52965285
/**
52975286
* ixgbe_clean_rx_ring - Free Rx Buffers per Queue
52985287
* @rx_ring: ring to free buffers from
@@ -5431,7 +5420,6 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev,
54315420
ixgbe_add_mac_filter(adapter, vdev->dev_addr,
54325421
VMDQ_P(accel->pool));
54335422

5434-
ixgbe_fwd_psrtype(accel);
54355423
ixgbe_macvlan_set_rx_mode(vdev, VMDQ_P(accel->pool), adapter);
54365424
return err;
54375425
fwd_queue_err:

0 commit comments

Comments
 (0)