Revert "l4p/tcp: introduce tle_tcp_stream_establish() API"
[tldk.git] / lib / libtle_l4p / osdep.h
1 /*
2  * Copyright (c) 2016  Intel Corporation.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef _OSDEP_H_
17 #define _OSDEP_H_
18
19 #include <rte_vect.h>
20 #include <rte_memcpy.h>
21 #include <rte_spinlock.h>
22 #include <rte_log.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /*
29  * internal defines.
30  */
31 #define MAX_PKT_BURST   0x20
32
33 #define MAX_DRB_BURST   4
34
35 /*
36  * logging related macros.
37  */
38
39 #define UDP_LOG(lvl, fmt, args...)      RTE_LOG(lvl, USER1, fmt, ##args)
40
41 #define TCP_LOG(lvl, fmt, args...)      RTE_LOG(lvl, USER1, fmt, ##args)
42
43 /*
44  * if no AVX support, define _ymm_t here.
45  */
46
47 #ifdef __AVX__
48
49 #define _ymm_t  rte_ymm_t
50
51 #else
52
53 #define YMM_SIZE        (2 * sizeof(rte_xmm_t))
54 #define YMM_MASK        (YMM_SIZE - 1)
55
56 typedef union _ymm {
57         xmm_t    x[YMM_SIZE / sizeof(xmm_t)];
58         uint8_t  u8[YMM_SIZE / sizeof(uint8_t)];
59         uint16_t u16[YMM_SIZE / sizeof(uint16_t)];
60         uint32_t u32[YMM_SIZE / sizeof(uint32_t)];
61         uint64_t u64[YMM_SIZE / sizeof(uint64_t)];
62         double   pd[YMM_SIZE / sizeof(double)];
63 } _ymm_t;
64
65 #endif /* __AVX__ */
66
67 #include "debug.h"
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /* _OSDEP_H_ */