summaryrefslogtreecommitdiffstats
path: root/examples/quota_watermark/qw/main.h
blob: 9903ddc8c6875febf2bfa8c30334e49563242a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2010-2014 Intel Corporation
 */

#ifndef _MAIN_H_
#define _MAIN_H_

#include "../include/conf.h"

enum ring_state {
	RING_READY,
	RING_OVERLOADED,
};

extern int *quota;
extern unsigned int *low_watermark;
extern unsigned int *high_watermark;

extern uint16_t port_pairs[RTE_MAX_ETHPORTS];

extern struct rte_ring *rings[RTE_MAX_LCORE][RTE_MAX_ETHPORTS];
extern struct rte_mempool *mbuf_pool;


static inline int
is_bit_set(int i, unsigned int mask)
{
	return (1 << i) & mask;
}

#endif /* _MAIN_H_ */