13 #include <sys/queue.h>
18 #include <sys/select.h>
20 #include <bsd/sys/bitstring.h>
41 typedef struct stk_s {
42 pthread_mutex_t mutex;
47 struct cne_graph *graph;
48 struct cne_node *tcp_tx_node;
57 struct protosw_entry **protosw_vec;
58 struct icmp_entry *icmp;
59 struct icmp6_entry *icmp6;
60 struct ipv4_entry *ipv4;
61 struct ipv6_entry *ipv6;
62 struct tcp_entry *tcp;
63 struct raw_entry *raw;
64 struct udp_entry *udp;
65 struct chnl_optsw **chnlopt;
68 } stk_t __cne_cache_aligned;
71 #define this_stk CNE_PER_THREAD(stk)
80 static inline uint64_t
81 clks_to_ns(uint64_t clks)
85 ns = 1000000000ULL / ((ns == 0) ? 1 : ns);
91 static inline uint32_t
92 stk_get_timer_ticks(
void)
94 return this_stk->tcp_now;
103 static inline stk_t *
109 static inline stk_t *
110 cnet_stk_find_by_lcore(uint8_t lid)
112 struct cnet *cnet = this_cnet;
115 vec_foreach_ptr (stk, cnet->stks) {
125 stk_t *stk = this_stk;
130 if (pthread_mutex_lock(&stk->mutex) == 0)
139 stk_t *stk = this_stk;
142 CNE_RET(
"Stack pointer is NULL\n");
144 if (pthread_mutex_unlock(&stk->mutex))
145 CNE_ERR(
"Unable to unlock (%s) mutex\n", stk->name);
#define CNE_ERR_RET_VAL(_val,...)
#define CNE_DECLARE_PER_THREAD(type, name)
#define CNE_PER_THREAD(name)
CNDP_API uint64_t cne_get_timer_hz(void)
CNDP_API int cnet_stk_initialize(struct cnet *cnet)
Initialize the stack instance.
CNDP_API int cnet_stk_stop(void)
Stop the stack instance and free resources.