Commit a27a254c authored by Maxime Chevallier's avatar Maxime Chevallier Committed by David S. Miller

net: mvpp2: use one RSS table per port

PPv2 Controller has 8 RSS Tables, of 32 entries each. A lookup in the
RXQ2RSS_TABLE is performed for each incoming packet, and the RSS Table
to be used is chosen according to the default rx queue that would be
used for the packet.

This default rx queue is set in the Lookup_id Table (also called
Decoding Table), and is equal to the port->first_rxq.

Since the Classifier itself isn't active at any time for the moment,
this doesn't have a direct effect, the default rx queue at the moment is
the one where all packets end-up into.
Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b86097b
...@@ -115,23 +115,22 @@ void mvpp22_init_rss(struct mvpp2_port *port) ...@@ -115,23 +115,22 @@ void mvpp22_init_rss(struct mvpp2_port *port)
/* Set the table width: replace the whole classifier Rx queue number /* Set the table width: replace the whole classifier Rx queue number
* with the ones configured in RSS table entries. * with the ones configured in RSS table entries.
*/ */
mvpp2_write(priv, MVPP22_RSS_INDEX, MVPP22_RSS_INDEX_TABLE(0)); mvpp2_write(priv, MVPP22_RSS_INDEX, MVPP22_RSS_INDEX_TABLE(port->id));
mvpp2_write(priv, MVPP22_RSS_WIDTH, 8); mvpp2_write(priv, MVPP22_RSS_WIDTH, 8);
/* Loop through the classifier Rx Queues and map them to a RSS table. /* The default RxQ is used as a key to select the RSS table to use.
* Map them all to the first table (0) by default. * We use one RSS table per port.
*/ */
for (i = 0; i < MVPP2_CLS_RX_QUEUES; i++) { mvpp2_write(priv, MVPP22_RSS_INDEX,
mvpp2_write(priv, MVPP22_RSS_INDEX, MVPP22_RSS_INDEX_QUEUE(i)); MVPP22_RSS_INDEX_QUEUE(port->first_rxq));
mvpp2_write(priv, MVPP22_RXQ2RSS_TABLE, mvpp2_write(priv, MVPP22_RXQ2RSS_TABLE,
MVPP22_RSS_TABLE_POINTER(0)); MVPP22_RSS_TABLE_POINTER(port->id));
}
/* Configure the first table to evenly distribute the packets across /* Configure the first table to evenly distribute the packets across
* real Rx Queues. The table entries map a hash to a port Rx Queue. * real Rx Queues. The table entries map a hash to a port Rx Queue.
*/ */
for (i = 0; i < MVPP22_RSS_TABLE_ENTRIES; i++) { for (i = 0; i < MVPP22_RSS_TABLE_ENTRIES; i++) {
u32 sel = MVPP22_RSS_INDEX_TABLE(0) | u32 sel = MVPP22_RSS_INDEX_TABLE(port->id) |
MVPP22_RSS_INDEX_TABLE_ENTRY(i); MVPP22_RSS_INDEX_TABLE_ENTRY(i);
mvpp2_write(priv, MVPP22_RSS_INDEX, sel); mvpp2_write(priv, MVPP22_RSS_INDEX, sel);
......
Markdown is supported
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