]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: mvpp2: use one RSS table per port
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Thu, 12 Jul 2018 11:54:19 +0000 (13:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Jul 2018 00:30:48 +0000 (17:30 -0700)
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: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c

index fe4bcaf983b25faf0bd6f7d4b6827606498723b9..c8cf3db85ffed2c1e746ae0dff7e1d290e6bafdd 100644 (file)
@@ -115,23 +115,22 @@ void mvpp22_init_rss(struct mvpp2_port *port)
        /* Set the table width: replace the whole classifier Rx queue number
         * 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);
 
-       /* Loop through the classifier Rx Queues and map them to a RSS table.
-        * Map them all to the first table (0) by default.
+       /* The default RxQ is used as a key to select the RSS table to use.
+        * We use one RSS table per port.
         */
-       for (i = 0; i < MVPP2_CLS_RX_QUEUES; i++) {
-               mvpp2_write(priv, MVPP22_RSS_INDEX, MVPP22_RSS_INDEX_QUEUE(i));
-               mvpp2_write(priv, MVPP22_RXQ2RSS_TABLE,
-                           MVPP22_RSS_TABLE_POINTER(0));
-       }
+       mvpp2_write(priv, MVPP22_RSS_INDEX,
+                   MVPP22_RSS_INDEX_QUEUE(port->first_rxq));
+       mvpp2_write(priv, MVPP22_RXQ2RSS_TABLE,
+                   MVPP22_RSS_TABLE_POINTER(port->id));
 
        /* Configure the first table to evenly distribute the packets across
         * real Rx Queues. The table entries map a hash to a port Rx Queue.
         */
        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);
                mvpp2_write(priv, MVPP22_RSS_INDEX, sel);