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

Function mana_mp_req_mr_create

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

* Request the primary process to register a MR. */

Source from the content-addressed store, hash-verified

256 * Request the primary process to register a MR.
257 */
258int
259mana_mp_req_mr_create(struct mana_priv *priv, uintptr_t addr, uint32_t len)
260{
261 struct rte_mp_msg mp_req = {0};
262 struct rte_mp_msg *mp_res;
263 struct rte_mp_reply mp_rep;
264 struct mana_mp_param *req = (struct mana_mp_param *)mp_req.param;
265 struct mana_mp_param *res;
266 struct timespec ts = {.tv_sec = MANA_MP_REQ_TIMEOUT_SEC, .tv_nsec = 0};
267 int ret;
268
269 mp_init_msg(&mp_req, MANA_MP_REQ_CREATE_MR, priv->port_id);
270 req->addr = addr;
271 req->len = len;
272
273 ret = rte_mp_request_sync(&mp_req, &mp_rep, &ts);
274 if (ret) {
275 DRV_LOG(ERR, "Port %u request to primary failed",
276 req->port_id);
277 return ret;
278 }
279
280 if (mp_rep.nb_received != 1)
281 return -EPROTO;
282
283 mp_res = &mp_rep.msgs[0];
284 res = (struct mana_mp_param *)mp_res->param;
285 ret = res->result;
286
287 free(mp_rep.msgs);
288
289 return ret;
290}
291
292void
293mana_mp_req_on_rxtx(struct rte_eth_dev *dev, enum mana_mp_req_type type)

Callers 1

mana_new_pmd_mrFunction · 0.85

Calls 3

mp_init_msgFunction · 0.70
rte_mp_request_syncFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected