1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2021 Xilinx, Inc.
6 #ifndef _SFC_FLOW_TUNNEL_H
7 #define _SFC_FLOW_TUNNEL_H
19 /** Flow Tunnel (FT) SW entry ID */
20 typedef uint8_t sfc_ft_id_t;
22 #define SFC_FT_TUNNEL_MARK_BITS \
23 (sizeof(sfc_ft_id_t) * CHAR_BIT)
25 #define SFC_FT_USER_MARK_BITS \
26 (sizeof(uint32_t) * CHAR_BIT - SFC_FT_TUNNEL_MARK_BITS)
28 #define SFC_FT_USER_MARK_MASK \
29 RTE_LEN2MASK(SFC_FT_USER_MARK_BITS, uint32_t)
31 #define SFC_FT_GET_TUNNEL_MARK(_mark) \
32 ((_mark) >> SFC_FT_USER_MARK_BITS)
34 #define SFC_FT_TUNNEL_MARK_INVALID (0)
36 #define SFC_FT_TUNNEL_MARK_TO_ID(_tunnel_mark) \
39 #define SFC_FT_ID_TO_TUNNEL_MARK(_id) \
42 #define SFC_FT_MAX_NTUNNELS \
43 (RTE_LEN2MASK(SFC_FT_TUNNEL_MARK_BITS, uint8_t) - 1)
45 struct sfc_flow_tunnel {
46 bool jump_rule_is_set;
47 efx_tunnel_protocol_t encap_type;
54 bool sfc_flow_tunnel_is_supported(struct sfc_adapter *sa);
56 bool sfc_flow_tunnel_is_active(struct sfc_adapter *sa);
58 struct sfc_flow_tunnel *sfc_flow_tunnel_pick(struct sfc_adapter *sa,
61 int sfc_flow_tunnel_detect_jump_rule(struct sfc_adapter *sa,
62 const struct rte_flow_action *actions,
63 struct sfc_flow_spec_mae *spec,
64 struct rte_flow_error *error);
69 #endif /* _SFC_FLOW_TUNNEL_H */