aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_packet_io_ipc_internal.h
blob: 9d8943a6c8bef0283b76aab843ab3aab8500b8df (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
45
46
47
48
/* Copyright (c) 2015, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#include <odp/api/packet_io.h>
#include <odp_packet_io_internal.h>
#include <odp/api/packet.h>
#include <odp_packet_internal.h>
#include <odp_internal.h>
#include <odp/api/shared_memory.h>

#include <string.h>
#include <unistd.h>
#include <stdlib.h>

/* IPC packet I/O over shared memory ring */
#include <odp_packet_io_ring_internal.h>

/* number of odp buffers in odp ring queue */
#define PKTIO_IPC_ENTRIES 4096

/* that struct is exported to shared memory, so that processes can find
 * each other.
 */
struct pktio_info {
	struct {
		/* number of buffer*/
		int num;
		/* size of packet/segment in remote pool */
		uint32_t block_size;
		char pool_name[ODP_POOL_NAME_LEN];
		/* 1 if master finished creation of all shared objects */
		int init_done;
	} master;
	struct {
		void *base_addr;
		uint32_t block_size;
		char pool_name[ODP_POOL_NAME_LEN];
		/* pid of the slave process written to shm and
		 * used by master to look up memory created by
		 * slave
		 */
		int pid;
		int init_done;
	} slave;
} ODP_PACKED;