net/mlx5: Geneve, Manage Geneve TLV options
authorYevgeny Kliteynik <kliteyn@mellanox.com>
Wed, 30 Jan 2019 15:21:55 +0000 (17:21 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 31 May 2019 20:04:25 +0000 (13:04 -0700)
commit0ccc171ea6a2fa34a6b898329c0a447c84e27057
tree0b09099faaac964ef9f771f09c1a631abf03633d
parentd4a18e16c570fd84ef6cba9933803cf01a7b71e2
net/mlx5: Geneve, Manage Geneve TLV options

Use Geneve TLV Options object to manage the flex parser matching
on the 32-bit options data.

When the first flow with a certain class/type values is requested to
be offloaded, create a FW object with FW command (Geneve TLV Options
general object) and start counting the number of flows using this object.

During this time, any request with a different class/type values will
fail to be offloaded.
Once the refcount reaches 0, destroy the TLV options general object,
and can now offload a flow with any class/type parameters.

Geneve TLV Options object is added to core device.
It is currently used to manage Geneve TLV options general
object allocation in FW and its reference counting only.
In the future it will also be used for managing geneve ports
by registering callbacks for ndo_udp_tunnel_add/del.

Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/lib/geneve.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/main.c
include/linux/mlx5/driver.h