net/mlx5e: Fix cb_ident duplicate in indirect block register
authorEli Britstein <elibr@mellanox.com>
Wed, 19 Dec 2018 05:36:51 +0000 (07:36 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Sat, 19 Jan 2019 00:15:31 +0000 (16:15 -0800)
commit25f2d0e7791e71cc89c58a7c2231768ad200764b
tree0c73bd24af113648607e02c70d19b2488cef9bdd
parent7fdc1adc52d3975740547a78c2df329bb207f15d
net/mlx5e: Fix cb_ident duplicate in indirect block register

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: f5bc2c5de101 ("net/mlx5e: Support TC indirect block notifications
for eswitch uplink reprs")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c