Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eBPF/PSA: Implement caching for ActionSelector, LPM and ternary tables #3738

Merged
merged 2 commits into from
Nov 30, 2022

Commits on Nov 28, 2022

  1. Implement caching for ActionSelector, LPM and ternary tables

    This commit introduces optimization for the PSA/eBPF backend called
    `table caching` which adds cache table with only `exact` match keys for time
    consuming look-ups. We identified three situations where this optimization
    can improve performance:
    
    - Table with `ternary` (and/or `lpm`, `exact`) key - skip slow TSS algorithm
      if the key was earlier matched.
    - Table with `lpm` (and/or `exact`) key - skip slow `LPM_TRIE` map (especially
      when there is many entries) if the key was earlier matched.
    - `ActionSelector` member selection from group - skip slow checksum
      calculation for `selector` key if it was earlier calculated.
    
    This optimization may not improve performance in every case, so it must be
    explicitly enabled by compiler option `--table-caching`.
    
    Limitations/to do:
    
    - `DirectCounter` and `DirectMeter` are not supported by this optimization
      (tables with these externs will not have enabled cache).
    - Cache size is a half of table size, but it would be more configurable or
      smart during compilation.
    - Updates to tables with cache or `ActionSelector` require cache invalidation
      (`nikss` library will remove all cached entries).
    
    Co-authored-by: Tomasz Osiński <[email protected]>
    tatry and osinstom committed Nov 28, 2022
    Configuration menu
    Copy the full SHA
    50a1a77 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2022

  1. Replace memcpy

    tatry committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    5146d21 View commit details
    Browse the repository at this point in the history