xref: /f-stack/dpdk/lib/librte_eal/windows/eal_mp.c (revision 2d9fd380)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2020 Dmitry Kozlyuk
3  */
4 
5 /**
6  * @file Multiprocess support stubs
7  *
8  * Stubs must log an error until implemented. If success is required
9  * for non-multiprocess operation, stub must log a warning and a comment
10  * must document what requires success emulation.
11  */
12 
13 #include <rte_eal.h>
14 #include <rte_errno.h>
15 
16 #include "eal_private.h"
17 #include "eal_windows.h"
18 #include "malloc_mp.h"
19 #include "hotplug_mp.h"
20 
21 void
rte_mp_channel_cleanup(void)22 rte_mp_channel_cleanup(void)
23 {
24 	EAL_LOG_NOT_IMPLEMENTED();
25 }
26 
27 int
rte_mp_action_register(const char * name,rte_mp_t action)28 rte_mp_action_register(const char *name, rte_mp_t action)
29 {
30 	RTE_SET_USED(name);
31 	RTE_SET_USED(action);
32 	EAL_LOG_NOT_IMPLEMENTED();
33 	return -1;
34 }
35 
36 void
rte_mp_action_unregister(const char * name)37 rte_mp_action_unregister(const char *name)
38 {
39 	RTE_SET_USED(name);
40 	EAL_LOG_NOT_IMPLEMENTED();
41 }
42 
43 int
rte_mp_sendmsg(struct rte_mp_msg * msg)44 rte_mp_sendmsg(struct rte_mp_msg *msg)
45 {
46 	RTE_SET_USED(msg);
47 	EAL_LOG_NOT_IMPLEMENTED();
48 	return -1;
49 }
50 
51 int
rte_mp_request_sync(struct rte_mp_msg * req,struct rte_mp_reply * reply,const struct timespec * ts)52 rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,
53 	const struct timespec *ts)
54 {
55 	RTE_SET_USED(req);
56 	RTE_SET_USED(reply);
57 	RTE_SET_USED(ts);
58 	EAL_LOG_NOT_IMPLEMENTED();
59 	return -1;
60 }
61 
62 int
rte_mp_request_async(struct rte_mp_msg * req,const struct timespec * ts,rte_mp_async_reply_t clb)63 rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
64 		rte_mp_async_reply_t clb)
65 {
66 	RTE_SET_USED(req);
67 	RTE_SET_USED(ts);
68 	RTE_SET_USED(clb);
69 	EAL_LOG_NOT_IMPLEMENTED();
70 	return -1;
71 }
72 
73 int
rte_mp_reply(struct rte_mp_msg * msg,const char * peer)74 rte_mp_reply(struct rte_mp_msg *msg, const char *peer)
75 {
76 	RTE_SET_USED(msg);
77 	RTE_SET_USED(peer);
78 	EAL_LOG_NOT_IMPLEMENTED();
79 	return -1;
80 }
81 
82 int
register_mp_requests(void)83 register_mp_requests(void)
84 {
85 	/* Non-stub function succeeds if multi-process is not supported. */
86 	EAL_LOG_STUB();
87 	return 0;
88 }
89 
90 int
request_to_primary(struct malloc_mp_req * req)91 request_to_primary(struct malloc_mp_req *req)
92 {
93 	RTE_SET_USED(req);
94 	EAL_LOG_NOT_IMPLEMENTED();
95 	return -1;
96 }
97 
98 int
request_sync(void)99 request_sync(void)
100 {
101 	/* Common memory allocator depends on this function success. */
102 	EAL_LOG_STUB();
103 	return 0;
104 }
105 
106 int
eal_dev_hotplug_request_to_primary(struct eal_dev_mp_req * req)107 eal_dev_hotplug_request_to_primary(struct eal_dev_mp_req *req)
108 {
109 	RTE_SET_USED(req);
110 	return 0;
111 }
112 
113 int
eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req * req)114 eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req *req)
115 {
116 	RTE_SET_USED(req);
117 	return 0;
118 }
119