Skip to content
  • Eli Britstein's avatar
    net/mlx5e: Fix cb_ident duplicate in indirect block register · 25f2d0e7
    Eli Britstein 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 tunnel netdev we were interested in receiving updates on.
    This worked fine if a single PF existed that registered one callback for
    the tunnel netdev of interest. However, if multiple PFs are in place then
    the 2nd PF tries to register with the same tunnel netdev identifier. This
    leads to EEXIST errors and/or incorrect cb deletions.
    
    Prevent this conflict by using the rpriv pointer as the identifier for
    netdev indirect block cb registry, allowing each PF to register a unique
    callback per tunnel netdev. For block cb registry, the same PF may
    register multiple cbs to the same block if using TC shared blocks.
    Instead of the rpriv, use the pointer to the allocated indr_priv data as
    the identifier here. This means that there can be a unique block callback
    for each PF/tunnel netdev combo.
    
    Fixes: f5bc2c5d
    
     ("net/mlx5e: Support TC indirect block notifications
    for eswitch uplink reprs")
    Signed-off-by: default avatarEli Britstein <elibr@mellanox.com>
    Reviewed-by: default avatarOz Shlomo <ozsh@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    25f2d0e7