* Request the primary process to register a MR. */
| 256 | * Request the primary process to register a MR. |
| 257 | */ |
| 258 | int |
| 259 | mana_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 | |
| 292 | void |
| 293 | mana_mp_req_on_rxtx(struct rte_eth_dev *dev, enum mana_mp_req_type type) |
no test coverage detected