blob: 7d2464e81e5a6a743afe2e946e4ced6dd20c05a4 (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/* Copyright (c) 2016, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file
*
* ODP packet flags inline functions
*/
#ifndef ODP_PLAT_PACKET_FLAGS_INLINES_H_
#define ODP_PLAT_PACKET_FLAGS_INLINES_H_
#ifdef __cplusplus
extern "C" {
#endif
extern const unsigned int ol_flags_offset;
extern const uint64_t rss_flag;
/*
* NOTE: These functions are inlined because they are on a performance hot path.
* As we can't force the application to directly include DPDK headers we have to
* export these fields through constants calculated compile time in
* odp_packet.c, where we can see the DPDK definitions.
*
*/
_STATIC int odp_packet_has_flow_hash(odp_packet_t pkt)
{
return *(uint64_t *)((char *)pkt + ol_flags_offset) & rss_flag;
}
_STATIC void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
{
*(uint64_t *)((char *)pkt + ol_flags_offset) &= ~rss_flag;
}
#ifdef __cplusplus
}
#endif
#endif /* ODP_PLAT_PACKET_FLAGS_INLINES_H_ */
|