1. 26 May, 2019 3 commits
  2. 25 May, 2019 7 commits
    • David S. Miller's avatar
      Merge branch 'net-mvpp2-Classifier-updates-RSS' · cecd7582
      David S. Miller authored
      Maxime Chevallier says:
      
      ====================
      net: mvpp2: Classifier updates, RSS
      
      Here is a set of updates for the PPv2 classifier, the main feature being
      the support for steering to RSS contexts, to leverage all the available
      RSS tables in the controller.
      
      The first two patches are non-critical fixes for the classifier, the
      first one prevents us from allocating too much room to store the
      classification rules, the second one configuring the C2 engine as
      suggested by the PPv2 functionnal specs.
      
      Patches 3 to 5 introduce support for RSS contexts in mvpp2, allowing us
      to steer traffic to dedicated RSS tables.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cecd7582
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Support steering to RSS contexts · 14134773
      Maxime Chevallier authored
      When steering to an RXQ, we can perform an extra RSS step to assign a
      queue from an RSS table.
      
      This is done by setting the RSS_EN attribute in the C2 engine. In that
      case, the RXQ that is assigned is the global RSS context id, that is
      then translated to an RSS table using the RXQ2RSS table.
      
      An example using ethtool to steer to RXQ 2 and 3 would be :
      
      ethtool -X eth0 weight 0 0 1 1 context new
      
      (This would print the allocated context id, let's say it's 1)
      
      ethtool -N eth0 flow-type udp4 dst-port 1234 context 1 loc 0
      
      The hash parameters are the ones that are globally configured for RSS :
      
      ethtool -N eth0 rx-flow-hash udp4 sdfn
      
      When an RSS context is removed while there are active classification
      rules using this context, these rules are removed.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14134773
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Extract the RSS context when parsing the ethtool rule · c561da68
      Maxime Chevallier authored
      ethtool_rx_flow_rule_create takes into parameter the ethtool flow spec,
      which doesn't contain the rss context id. We therefore need to extract
      it ourself before parsing the ethtool rule.
      
      The FLOW_RSS flag is only set in info->fs.flow_type, and not
      info->flow_type.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c561da68
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Use RSS contexts to handle RSS tables · 895586d5
      Maxime Chevallier authored
      The PPv2 controller has 8 RSS tables that are shared across all ports on
      a given PPv2 instance. The previous implementation allocated one table
      per port, leaving others unused.
      
      By using RSS contexts, we can make use of multiple RSS tables per
      port, one being the default table (always id 0), the other ones being
      used as destinations for flow steering, in the same way as rx rings.
      
      This commit introduces RSS contexts management in the PPv2 driver. We
      always reserve one table per port, allocated when the port is probed.
      
      The global table list is stored in the struct mvpp2, as it's a global
      resource. Each port then maintains a list of indices in that global
      table, that way each port can have it's own numbering scheme starting
      from 0.
      
      One limitation that seems unavoidable is that the hashing parameters are
      shared across all RSS contexts for a given port. Hashing parameters for
      ctx 0 will be applied to all contexts.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      895586d5
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Bypass C2 internals FIFOs at init · e8486ca9
      Maxime Chevallier authored
      The C2 TCAM has internal FIFOs that are only useful for the built-in
      self-tests. Disable these FIFOS at init, as recommended in the
      functionnal specs.
      Suggested-by: default avatarAlan Winkowski <walan@marvell.com>
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8486ca9
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Use the correct number of rules in various places · ae8e1d5e
      Maxime Chevallier authored
      As of today, the classification offload implementation only supports 4
      different rules to be offloaded. This number has been hardcoded in the
      rule insertion function, and the wrong define is being used elsewhere.
      
      Use the correct #define everywhere to make sure we always check for the
      correct number of rules.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ae8e1d5e
    • Gustavo A. R. Silva's avatar
      flow_offload: use struct_size() in kzalloc() · 6dca9360
      Gustavo A. R. Silva authored
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct foo {
         int stuff;
         struct boo entry[];
      };
      
      instance = kzalloc(sizeof(struct foo) + count * sizeof(struct boo), GFP_KERNEL);
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6dca9360
  3. 24 May, 2019 30 commits