net/sfc: fence off 8 bits in Rx mark for tunnel offload
[dpdk.git] / drivers / net / sfc / sfc_flow_tunnel.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2021 Xilinx, Inc.
4  */
5
6 #ifndef _SFC_FLOW_TUNNEL_H
7 #define _SFC_FLOW_TUNNEL_H
8
9 #include <limits.h>
10 #include <stdbool.h>
11 #include <stdint.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 /** Flow Tunnel (FT) SW entry ID */
18 typedef uint8_t sfc_ft_id_t;
19
20 #define SFC_FT_TUNNEL_MARK_BITS \
21         (sizeof(sfc_ft_id_t) * CHAR_BIT)
22
23 #define SFC_FT_USER_MARK_BITS \
24         (sizeof(uint32_t) * CHAR_BIT - SFC_FT_TUNNEL_MARK_BITS)
25
26 #define SFC_FT_USER_MARK_MASK \
27         RTE_LEN2MASK(SFC_FT_USER_MARK_BITS, uint32_t)
28
29 struct sfc_adapter;
30
31 bool sfc_flow_tunnel_is_supported(struct sfc_adapter *sa);
32
33 bool sfc_flow_tunnel_is_active(struct sfc_adapter *sa);
34
35 #ifdef __cplusplus
36 }
37 #endif
38 #endif /* _SFC_FLOW_TUNNEL_H */