1
0
Fork 0
alistair23-linux/drivers/net/ethernet/marvell
Maxime Chevallier 21da57a231 net: mvpp2: add a debugfs interface for the Header Parser
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: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-16 00:10:00 -07:00
..
mvpp2 net: mvpp2: add a debugfs interface for the Header Parser 2018-07-16 00:10:00 -07:00
Kconfig net: Remove depends on HAS_DMA in case of platform dependency 2018-06-23 10:44:30 +09:00
Makefile net: mvpp2: Split the PPv2 driver to a dedicated directory 2018-06-01 11:29:35 -04:00
mv643xx_eth.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
mvmdio.c drivers: net: Remove device_node checks with of_mdiobus_register() 2018-05-16 14:20:36 -04:00
mvneta.c net: mvneta: fix the Rx desc DMA address in the Rx path 2018-06-23 10:40:15 +09:00
mvneta_bm.c net: mvneta: Fix lacking spinlock initialization 2016-05-25 12:35:08 -07:00
mvneta_bm.h net: mvneta: use IS_ENABLED() instead of checking for built-in or module 2016-09-12 20:27:59 -07:00
pxa168_eth.c net: pxa168_eth: add netconsole support 2018-02-01 14:58:37 -05:00
skge.c ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
skge.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sky2.c sky2: Increase D3 delay to sky2 stops working after suspend 2018-04-01 20:54:41 -04:00
sky2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00