]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Add refcount to VXLAN structure
authorGal Pressman <galp@mellanox.com>
Sun, 3 Dec 2017 11:58:50 +0000 (13:58 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 19 Dec 2017 21:24:03 +0000 (23:24 +0200)
commit029e72afe698ddbe92352403a01a5c0bc361e7ed
tree7c51d35d7824b06a12e443e1cca739638553f603
parentd48a0bcb8bb873fe9550f1e3931d7fde54677584
net/mlx5e: Add refcount to VXLAN structure

A refcount mechanism must be implemented in order to prevent unwanted
scenarios such as:
- Open an IPv4 VXLAN interface
- Open an IPv6 VXLAN interface (different socket)
- Remove one of the interfaces

With current implementation, the UDP port will be removed from our VXLAN
database and turn off the offloads for the other interface, which is
still active.
The reference count mechanism will only allow UDP port removals once all
consumers are gone.

Fixes: 225737a81ece ("net/mlx5e: Add netdev support for VXLAN tunneling")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/vxlan.c
drivers/net/ethernet/mellanox/mlx5/core/vxlan.h