1. 16 7月, 2018 2 次提交
    • M
      net: mvpp2: add a debugfs interface for the Header Parser · 21da57a2
      Maxime Chevallier 提交于
      Marvell PPv2 Packer Header Parser has a TCAM based filter, that is not
      trivial to configure and debug. Being able to dump TCAM entries from
      userspace can be really helpful to help development of new features
      and debug existing ones.
      
      This commit adds a basic debugfs interface for the PPv2 driver, focusing
      on TCAM related features.
      
      <mnt>/mvpp2/ --- f2000000.ethernet
                    \- f4000000.ethernet --- parser --- 000 ...
                                          |          \- 001
                                          |          \- ...
                                          |          \- 255 --- ai
                                          |                  \- header_data
                                          |                  \- lookup_id
                                          |                  \- sram
                                          |                  \- valid
                                          \- eth1 ...
                                          \- eth2 --- mac_filter
                                                   \- parser_entries
                                                   \- vid_filter
      
      There's one directory per PPv2 instance, named after pdev->name to make
      sure names are uniques. In each of these directories, there's :
      
       - one directory per interface on the controller, each containing :
      
         - "mac_filter", which lists all filtered addresses for this port
           (based on TCAM, not on the kernel's uc / mc lists)
      
         - "parser_entries", which lists the indices of all valid TCAM
            entries that have this port in their port map
      
         - "vid_filter", which lists the vids allowed on this port, based on
           TCAM
      
       - one "parser" directory (the parser is common to all ports), containing :
      
         - one directory per TCAM entry (256 of them, from 0 to 255), each
           containing :
      
           - "ai" : Contains the 1 byte Additional Info field from TCAM, and
      
           - "header_data" : Contains the 8 bytes Header Data extracted from
             the packet
      
           - "lookup_id" : Contains the 4 bits LU_ID
      
           - "sram" : contains the raw SRAM data, which is the result of the TCAM
      		lookup. This readonly at the moment.
      
           - "valid" : Indicates if the entry is valid of not.
      
      All entries are read-only, and everything is output in hex form.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21da57a2
    • A
      net: mvpp2: switch to SPDX identifiers · f1e37e31
      Antoine Tenart 提交于
      Use the appropriate SPDX license identifiers and drop the license text.
      This patch is only cosmetic.
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1e37e31
  2. 13 7月, 2018 8 次提交
  3. 30 6月, 2018 2 次提交
  4. 04 6月, 2018 1 次提交
  5. 01 6月, 2018 1 次提交
    • M
      net: mvpp2: Split the PPv2 driver to a dedicated directory · db9d7d36
      Maxime Chevallier 提交于
      As the mvpp2 driver is growing, move this driver to a dedicated
      directory and split it into several files.
      
      Since this driver has a lot of register defines and structure
      definitions, it can benefit from having all of this into a dedicated
      header file, named mvpp2.h.
      
      A good chunk of the mvpp2 code is dedicated to Header Parser handling, so
      we introduce mvpp2_prs.h where all Header Parser definitions are located,
      and mvpp2_prs.c containing the related code.
      
      In the same way, mvpp2_cls.h and mvpp2_cls.c are created to contain
      Classifier and RSS related code.
      
      The former 'mvpp2.c' file is renamed 'mvpp2_main.c' so that we can keep
      the driver binary named 'mvpp2'.
      
      This commit is only about spliting the driver into multiple files and
      doesn't introduce any new function, feature or fix besides removing
      'static' keywords when needed.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Tested-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db9d7d36
  6. 20 5月, 2018 1 次提交
  7. 19 5月, 2018 1 次提交
  8. 18 5月, 2018 7 次提交
  9. 27 4月, 2018 2 次提交
  10. 20 4月, 2018 1 次提交
  11. 16 4月, 2018 1 次提交
    • M
      net: mvpp2: Fix TCAM filter reserved range · 982e0500
      Maxime Chevallier 提交于
      Marvell's PPv2 controller has a Packet Header parser, which uses a
      fixed-size TCAM array of filter entries.
      
      The mvpp2 driver reserves some ranges among the 256 TCAM entries to
      perform MAC and VID filtering. The rest of the TCAM ids are freely usable
      for other features, such as IPv4 proto matching.
      
      This commit fixes the MVPP2_PE_LAST_FREE_TID define that sets the end of
      the "free range", which included the MAC range. This could therefore allow
      some other features to use entries dedicated to MAC filtering,
      lowering the number of unicast/multicast addresses that could be allowed
      before switching to promiscuous mode.
      
      Fixes: 10fea26c ("net: mvpp2: Add support for unicast filtering")
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      982e0500
  12. 06 4月, 2018 1 次提交
  13. 28 3月, 2018 1 次提交
  14. 27 3月, 2018 2 次提交
    • M
      net: mvpp2: Don't use dynamic allocs for local variables · 0c6d9b44
      Maxime Chevallier 提交于
      Some helper functions that search for given entries in the TCAM filter
      on PPv2 controller make use of dynamically alloced temporary variables,
      allocated with GFP_KERNEL. These functions can be called in atomic
      context, and dynamic alloc is not really needed in these cases anyways.
      
      This commit gets rid of dynamic allocs and use stack allocation in the
      following functions, and where they're used :
       - mvpp2_prs_flow_find
       - mvpp2_prs_vlan_find
       - mvpp2_prs_double_vlan_find
       - mvpp2_prs_mac_da_range_find
      
      For all these functions, instead of returning an temporary object
      representing the TCAM entry, we simply return the TCAM id that matches
      the requested entry.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c6d9b44
    • M
      net: mvpp2: Make mvpp2_prs_hw_read a parser entry init function · 47e0e14e
      Maxime Chevallier 提交于
      The mvpp2_prs_hw_read function uses the 'index' field of the struct
      mvpp2_prs_entry to initialize the rest of the fields. This makes it
      unclear from a caller's perspective, who needs to manipulate a struct
      that is not entirely initialized.
      
      This commit makes it an init function for prs_entry, by passing it the
      index as a parameter. The function now zeroes the entry, and sets the
      index field before doing all other init from HW.
      
      The function is renamed 'mvpp2_prs_init_from_hw' to make that clear.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47e0e14e
  15. 23 3月, 2018 1 次提交
  16. 08 3月, 2018 3 次提交
  17. 06 3月, 2018 5 次提交