MCPcopy Index your code
hub / github.com/F-Stack/f-stack / ff_ipc_recv

Function ff_ipc_recv

tools/compat/ff_ipc.c:157–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157int
158ff_ipc_recv(struct ff_msg **msg, enum FF_MSG_TYPE msg_type)
159{
160 int ret, i;
161 if (inited == 0) {
162 printf("ff ipc not inited\n");
163 return -1;
164 }
165
166 char name[RTE_RING_NAMESIZE];
167 snprintf(name, RTE_RING_NAMESIZE, "%s%u_%u",
168 FF_MSG_RING_OUT, ff_proc_id, msg_type);
169 struct rte_ring *ring = rte_ring_lookup(name);
170 if (ring == NULL) {
171 printf("lookup message ring:%s failed!\n", name);
172 return -1;
173 }
174
175 void *obj;
176 #define MAX_ATTEMPTS_NUM 1000
177 for (i = 0; i < MAX_ATTEMPTS_NUM; i++) {
178 ret = rte_ring_dequeue(ring, &obj);
179 if (ret == 0) {
180 *msg = (struct ff_msg *)obj;
181 break;
182 }
183
184 usleep(1000);
185 }
186
187 return ret;
188}

Callers 8

rtioctlFunction · 0.85
sysctlFunction · 0.85
ioctl_vaFunction · 0.85
ngctlFunction · 0.85
traffic_statusFunction · 0.85
ipfw_ctlFunction · 0.85
cpu_statusFunction · 0.85
knictl_statusFunction · 0.85

Calls 4

snprintfFunction · 0.85
rte_ring_lookupFunction · 0.85
rte_ring_dequeueFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected