Skip to content
  • Jakub Kicinski's avatar
    nfp: add TLV capabilities to the BAR · 73a0329b
    Jakub Kicinski authored
    
    
    NFP is entirely programmable, including the PCI data interface.
    Using a fixed control BAR layout certainly makes implementations
    easier, but require careful considerations when space is allocated.
    Once BAR area is allocated to one feature nothing else can use it.
    Allocating space statically also requires it to be sized upfront,
    which leads to either unnecessary limitation or wastage.
    
    We currently have a 32bit capability word defined which tells drivers
    which application FW features are supported.   Most of the bits
    are exhausted.  The same bits are also reused for enabling specific
    features.  Bulk of capabilities don't have a need for an enable bit,
    however, leading to confusion and wastage.
    
    TLVs seems like a better fit for expressing capabilities of applications
    running on programmable hardware.
    
    This patch leaves the front of the BAR as is, and declares a TLV
    capability start at offset 0x58.  Most of the space up to 0x0d90
    is already allocated, but the used space can be wrapped with RESERVED
    TLVs.  E.g.:
    
    Address    Type         Length
     0x0058    RESERVED      0xe00  /* Wrap basic structures */
     0x0e5c    FEATURE_A     0x004
     0x0e64    FEATURE_B     0x004
     0x0e6c    RESERVED      0x990  /* Wrap qeueue stats */
     0x1800    FEATURE_C     0x100
    
    Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    73a0329b