• Jakub Kicinski's avatar
    bpf: offload: aggregate offloads per-device · 9fd7c555
    Jakub Kicinski authored
    Currently we have two lists of offloaded objects - programs and maps.
    Netdevice unregister notifier scans those lists to orphan objects
    associated with device being unregistered.  This puts unnecessary
    (even if negligible) burden on all netdev unregister calls in BPF-
    -enabled kernel.  The lists of objects may potentially get long
    making the linear scan even more problematic.  There haven't been
    complaints about this mechanisms so far, but it is suboptimal.
    
    Instead of relying on notifiers, make the few BPF-capable drivers
    register explicitly for BPF offloads.  The programs and maps will
    now be collected per-device not on a global list, and only scanned
    for removal when driver unregisters from BPF offloads.
    Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Reviewed-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    9fd7c555
bpf.c 15.1 KB