MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mana_mp_req_on_rxtx

Function mana_mp_req_on_rxtx

dpdk/drivers/net/mana/mp.c:292–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void
293mana_mp_req_on_rxtx(struct rte_eth_dev *dev, enum mana_mp_req_type type)
294{
295 struct rte_mp_msg mp_req = { 0 };
296 struct rte_mp_msg *mp_res;
297 struct rte_mp_reply mp_rep;
298 struct mana_mp_param *res;
299 struct timespec ts = {.tv_sec = MANA_MP_REQ_TIMEOUT_SEC, .tv_nsec = 0};
300 int i, ret;
301
302 if (type != MANA_MP_REQ_START_RXTX && type != MANA_MP_REQ_STOP_RXTX) {
303 DRV_LOG(ERR, "port %u unknown request (req_type %d)",
304 dev->data->port_id, type);
305 return;
306 }
307
308 if (rte_atomic_load_explicit(&mana_shared_data->secondary_cnt, rte_memory_order_relaxed) == 0)
309 return;
310
311 mp_init_msg(&mp_req, type, dev->data->port_id);
312
313 ret = rte_mp_request_sync(&mp_req, &mp_rep, &ts);
314 if (ret) {
315 if (rte_errno != ENOTSUP)
316 DRV_LOG(ERR, "port %u failed to request Rx/Tx (%d)",
317 dev->data->port_id, type);
318 goto exit;
319 }
320 if (mp_rep.nb_sent != mp_rep.nb_received) {
321 DRV_LOG(ERR, "port %u not all secondaries responded (%d)",
322 dev->data->port_id, type);
323 goto exit;
324 }
325 for (i = 0; i < mp_rep.nb_received; i++) {
326 mp_res = &mp_rep.msgs[i];
327 res = (struct mana_mp_param *)mp_res->param;
328 if (res->result) {
329 DRV_LOG(ERR, "port %u request failed on secondary %d",
330 dev->data->port_id, i);
331 goto exit;
332 }
333 }
334exit:
335 free(mp_rep.msgs);
336}

Callers 2

mana_dev_startFunction · 0.85
mana_dev_stopFunction · 0.85

Calls 3

mp_init_msgFunction · 0.70
rte_mp_request_syncFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected