• Maxime Chevallier's avatar
    net: mvpp2: add a debugfs interface for the Header Parser · 21da57a2
    Maxime Chevallier authored
    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: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    21da57a2
mvpp2_main.c 143 KB