Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ echo "==== Show system info ===="
env
nvidia-smi topo -m || true
ibv_devinfo || true
uname -a || true

echo "==== Running C++ tests ===="
cd ${INSTALL_DIR}
Expand Down
15 changes: 8 additions & 7 deletions src/plugins/posix/posix_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ uringQueue::uringQueue(int num_entries, io_uring_params params)
memset(&uring, 0, sizeof(uring));

int uring_init_status = io_uring_queue_init_params(num_entries, &uring, &params);
if (uring_init_status != 0)
throw UringError::INIT;
if (uring_init_status != 0) {
throw std::runtime_error(absl::StrFormat("Failed to init io_uring - errno: %d", errno));
}
}

uringQueue::~uringQueue() {
Expand Down Expand Up @@ -156,7 +157,7 @@ nixlPosixBackendReqH::nixlPosixBackendReqH(const nixl_xfer_op_t &operation,
reinterpret_cast<io_uring_prep_func_t>(io_uring_prep_write)),
is_prepped(false), status(NIXL_IN_PROG) {
if (operation != NIXL_READ && operation != NIXL_WRITE) {
throw OperationError::INVALID_OPERATION;
throw std::invalid_argument(absl::StrFormat("Invalid operation type: %d", operation));
}

fillUringParams();
Expand Down Expand Up @@ -247,10 +248,10 @@ nixl_status_t nixlPosixEngine::prepXfer(const nixl_xfer_op_t &operation,
NIXL_RETURN_IF_NOT_IN_PROG(status);

handle = posix_handle.release();
} catch (nixlPosixBackendReqH::OperationError error) {
NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_INVALID_PARAM, "Invalid operation type");
} catch (const uringQueue::UringError& e) {
NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_BACKEND, "Failed to init io_uring");
} catch (const std::invalid_argument& e) {
NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_INVALID_PARAM, e.what());
} catch (const std::runtime_error& e) {
NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_BACKEND, e.what());
} catch (const std::exception& e) {
NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_BACKEND, absl::StrFormat("Unexpected error: %s", e.what()));
}
Expand Down
8 changes: 0 additions & 8 deletions src/plugins/posix/posix_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ class uringQueue {
nixl_status_t submit();
nixl_status_t checkCompleted();
struct io_uring_sqe *getSqe();

enum class UringError {
INIT,
};
};

class nixlPosixBackendReqH : public nixlBackendReqH {
Expand Down Expand Up @@ -79,10 +75,6 @@ class nixlPosixBackendReqH : public nixlBackendReqH {
nixl_status_t postXfer();
nixl_status_t prepXfer();
nixl_status_t checkXfer();

enum class OperationError {
INVALID_OPERATION
};
};

class nixlPosixEngine : public nixlBackendEngine {
Expand Down