• Naveen Mamindlapalli's avatar
    octeontx2-af: Add devlink option to adjust mcam high prio zone entries · 09de114c
    Naveen Mamindlapalli authored
    The NPC MCAM entries are currently divided into three priority zones
    in AF driver: high, mid, and low. The high priority zone and low priority
    zone take up 1/8th (each) of the available MCAM entries, and remaining
    going to the mid priority zone.
    
    The current allocation scheme may not meet certain requirements, such
    as when a requester needs more high priority zone entries than are
    reserved. This patch adds a devlink configurable option to increase the
    number of high priority zone entries that can be allocated by requester.
    The max number of entries that can be reserved for high priority usage
    is 100% of available MCAM entries.
    
    Usage:
    1) Change high priority zone percentage to 75%:
    devlink -p dev param set pci/0002:01:00.0 name npc_mcam_high_zone_percent \
    value 75 cmode runtime
    
    2) Read high priority zone percentage:
    devlink -p dev param show pci/0002:01:00.0 name npc_mcam_high_zone_percent
    
    The devlink set configuration is only permitted when no MCAM entries
    are assigned, i.e., all MCAM entries are free, indicating that no PF/VF
    driver is loaded. So user must unload/unbind PF/VF driver/devices before
    modifying the high priority zone percentage.
    Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
    Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    09de114c
rvu_devlink.c 48 KB