net/mlx5: add framework for switch flow rules
Because mlx5 switch flow rules are configured through Netlink (TC
interface) and have little in common with Verbs, this patch adds a separate
parser function to handle them.
- mlx5_nl_flow_transpose() converts a rte_flow rule to its TC equivalent
and stores the result in a buffer.
- mlx5_nl_flow_brand() gives a unique handle to a flow rule buffer.
- mlx5_nl_flow_create() instantiates a flow rule on the device based on
such a buffer.
- mlx5_nl_flow_destroy() performs the reverse operation.
These functions are called by the existing implementation when encountering
flow rules which must be offloaded to the switch (currently relying on the
transfer attribute).
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>