Skip to content
  • John Hurley's avatar
    nfp: flower: fix cb_ident duplicate in indirect block register · b12c97d4
    John Hurley authored
    Previously the identifier used for indirect block callback registry and
    for block rule cb registry (when done via indirect blocks) was the pointer
    to the netdev we were interested in receiving updates on. This worked fine
    if a single app existed that registered one callback per netdev of
    interest. However, if multiple cards are in place and, in turn, multiple
    apps, then each app may register the same callback with the same
    identifier to both the netdev's indirect block cb list and to a block's cb
    list. This can lead to EEXIST errors and/or incorrect cb deletions.
    
    Prevent this conflict by using the app pointer as the identifier for
    netdev indirect block cb registry, allowing each app to register a unique
    callback per netdev. For block cb registry, the same app may register
    multiple cbs to the same block if using TC shared blocks. Instead of the
    app, use the pointer to the allocated cb_priv data as the identifier here.
    This means that there can be a unique block callback for each app/netdev
    combo.
    
    Fixes: 3166dd07
    
     ("nfp: flower: offload tunnel decap rules via indirect TC blocks")
    Reported-by: default avatarEdward Cree <ecree@solarflare.com>
    Signed-off-by: default avatarJohn Hurley <john.hurley@netronome.com>
    Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b12c97d4