• Maxime Chevallier's avatar
    net: mvpp2: add an RSS classification step for each flow · d33ec452
    Maxime Chevallier authored
    One of the classification action that can be performed is to compute a
    hash of the packet header based on some header fields, and lookup a RSS
    table based on this hash to determine the final RxQ.
    
    This is done by adding one lookup entry per flow per port, so that we
    can configure the hash generation parameters for each flow and each
    port.
    
    There are 2 possible engines that can be used for RSS hash generation :
    
     - C3HA, that generates a hash based on up to 4 header-extracted fields
     - C3HB, that does the same as c3HA, but also includes L4 info in the hash
    
    There are a lot of fields that can be extracted from the header. For now,
    we only use the ones that we can configure using ethtool :
     - DST MAC address
     - L3 info
     - Source IP
     - Destination IP
     - Source port
     - Destination port
    
    The C3HB engine is selected when we use L4 fields (src/dst port).
    
                   Header parser          Dec table
     Ingress pkt  +-------------+ flow id +----------------------------+
    ------------->| TCAM + SRAM |-------->|TCP IPv4 w/ VLAN, not frag  |
                  +-------------+         |TCP IPv4 w/o VLAN, not frag |
                                          |TCP IPv4 w/ VLAN, frag      |--+
                                          |etc.                        |  |
                                          +----------------------------+  |
                                                                          |
                                                Flow table                |
      +---------+   +------------+         +--------------------------+   |
      | RSS tbl |<--| Classifier |<--------| flow 0: C2 lookup        |   |
      +---------+   +------------+         |         C3 lookup port 0 |   |
                     |         |           |         C3 lookup port 1 |   |
             +-----------+ +-------------+ |         ...              |   |
             | C2 engine | | C3H engines | | flow 1: C2 lookup        |<--+
             +-----------+ +-------------+ |         C3 lookup port 0 |
                                           |         ...              |
                                           | ...                      |
                                           | flow 51 : C2 lookup      |
                                           |           ...            |
                                           +--------------------------+
    
    The C2 engine also gains the role of enabling and disabling the RSS
    table lookup for this packet.
    Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d33ec452
mvpp2_main.c 143 KB