Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
mp_init_msg(dev, &mp_req, type);
ret = rte_mp_request_sync(&mp_req, &mp_rep, &ts);
if (ret) {
- ERROR("port %u failed to request stop/start Rx/Tx (%d)",
- dev->data->port_id, type);
+ if (rte_errno != ENOTSUP)
+ ERROR("port %u failed to request stop/start Rx/Tx (%d)",
+ dev->data->port_id, type);
goto exit;
}
if (mp_rep.nb_sent != mp_rep.nb_received) {
mp_init_msg(dev, &mp_req, type);
ret = rte_mp_request_sync(&mp_req, &mp_rep, &ts);
if (ret) {
- DRV_LOG(ERR, "port %u failed to request stop/start Rx/Tx (%d)",
- dev->data->port_id, type);
+ if (rte_errno != ENOTSUP)
+ DRV_LOG(ERR, "port %u failed to request stop/start Rx/Tx (%d)",
+ dev->data->port_id, type);
goto exit;
}
if (mp_rep.nb_sent != mp_rep.nb_received) {
if (internal_config.no_shconf) {
RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n");
- return 0;
+ rte_errno = ENOTSUP;
+ return -1;
}
if (gettimeofday(&now, NULL) < 0) {
ret = rte_mp_request_sync(&mp_req, &mp_reply, &ts);
if (ret != 0) {
- RTE_LOG(ERR, EAL, "rte_mp_request_sync failed\n");
+ /* if IPC is not supported, behave as if the call succeeded */
+ if (rte_errno != ENOTSUP)
+ RTE_LOG(ERR, EAL, "rte_mp_request_sync failed\n");
+ else
+ ret = 0;
return ret;
}
* @note This API must not be used inside memory-related or IPC callbacks, and
* no memory allocations should take place inside such callback.
*
+ * @note IPC may be unsupported in certain circumstances, so caller should check
+ * for ENOTSUP error.
+ *
* @param req
* The req argument contains the customized request message.
*
struct rte_mp_reply reply;
struct malloc_mp_req *req = (struct malloc_mp_req *)msg.param;
struct timespec ts;
- int i, ret;
+ int i, ret = -1;
memset(&msg, 0, sizeof(msg));
memset(&reply, 0, sizeof(reply));
ret = rte_mp_request_sync(&msg, &reply, &ts);
} while (ret != 0 && rte_errno == EEXIST);
if (ret != 0) {
- RTE_LOG(ERR, EAL, "Could not send sync request to secondary process\n");
- ret = -1;
+ /* if IPC is unsupported, behave as if the call succeeded */
+ if (rte_errno != ENOTSUP)
+ RTE_LOG(ERR, EAL, "Could not send sync request to secondary process\n");
+ else
+ ret = 0;
goto out;
}
if (reply.nb_received != reply.nb_sent) {
RTE_LOG(ERR, EAL, "Not all secondaries have responded\n");
- ret = -1;
goto out;
}
(struct malloc_mp_req *)reply.msgs[i].param;
if (resp->t != REQ_TYPE_SYNC) {
RTE_LOG(ERR, EAL, "Unexpected response from secondary\n");
- ret = -1;
goto out;
}
if (resp->id != req->id) {
RTE_LOG(ERR, EAL, "Wrong request ID\n");
- ret = -1;
goto out;
}
if (resp->result != REQ_RESULT_SUCCESS) {
RTE_LOG(ERR, EAL, "Secondary process failed to synchronize\n");
- ret = -1;
goto out;
}
}