e97c424693c059ff0f1579da27b340f5897af142
[dpdk.git] / drivers / net / cxgbe / cxgbe_ofld.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Chelsio Communications.
3  * All rights reserved.
4  */
5
6 #ifndef _CXGBE_OFLD_H_
7 #define _CXGBE_OFLD_H_
8
9 #include <rte_bitmap.h>
10
11 #include "cxgbe_filter.h"
12
13 /*
14  * Max # of ATIDs.  The absolute HW max is 16K but we keep it lower.
15  */
16 #define MAX_ATIDS 8192U
17
18 union aopen_entry {
19         void *data;
20         union aopen_entry *next;
21 };
22
23 /*
24  * Holds the size, base address, free list start, etc of filter TID.
25  * The tables themselves are allocated dynamically.
26  */
27 struct tid_info {
28         void **tid_tab;
29         unsigned int ntids;
30         struct filter_entry *ftid_tab;  /* Normal filters */
31         union aopen_entry *atid_tab;
32         struct rte_bitmap *ftid_bmap;
33         uint8_t *ftid_bmap_array;
34         unsigned int nftids, natids;
35         unsigned int ftid_base, hash_base;
36
37         union aopen_entry *afree;
38         unsigned int atids_in_use;
39
40         /* TIDs in the TCAM */
41         rte_atomic32_t tids_in_use;
42         /* TIDs in the HASH */
43         rte_atomic32_t hash_tids_in_use;
44         rte_atomic32_t conns_in_use;
45
46         rte_spinlock_t atid_lock __rte_cache_aligned;
47         rte_spinlock_t ftid_lock;
48 };
49 #endif /* _CXGBE_OFLD_H_ */