Adding Doca Communication Channel API - #190
Conversation
|
Can one of the admins verify this patch? |
| ########################################################################## | ||
| # check DOCA communication channel API | ||
| # | ||
| AC_ARG_ENABLE( |
There was a problem hiding this comment.
it's better to use AC_ARG_WITH here to allow specifying alternative library installation path.
There was a problem hiding this comment.
Pay attention that DOCA should not be configured at the same time with --with-tls. See https://github.com/Mellanox/sockperf/blob/sockperf_v2/config/m4/tls.m4#L10
Look at potential issue in this case: https://github.com/Mellanox/sockperf/pull/190/files#diff-649a0b286b520f22da501867c812f1acbc760fe028ea70edb14b60672ba7c716R116
|
Please rebase on top of latest changes. |
a213924 to
0b1dc18
Compare
|
Hey, Rebased on top of latest changes but DOCA API was changed drastically so still no need to review at the moment |
e9b17b1 to
88c186d
Compare
b45a7b6 to
6bfefa9
Compare
6bfefa9 to
388d73d
Compare
| #endif // __windows__ | ||
| if (s_user_params.mode == MODE_SERVER) | ||
| os_unlink_unix_path(g_fds_array[ifd]->server_addr.addr_un.sun_path); | ||
| unlink(g_fds_array[ifd]->server_addr.addr_un.sun_path); |
There was a problem hiding this comment.
what is a reason of using unlink instead of os_unlink_unix_path
| #if defined(USING_DOCA_COMM_CHANNEL_API) | ||
| typedef doca_error_t (*jobs_check)(struct doca_devinfo *); | ||
| doca_error_t | ||
| open_doca_device_with_pci(const struct doca_pci_bdf *value, jobs_check func, struct doca_dev **retval) |
| size_t i; | ||
|
|
||
| /* Set default return value */ | ||
| *retval = NULL; |
There was a problem hiding this comment.
If passed retval is NULL?
| } | ||
|
|
||
| doca_error_t | ||
| open_doca_device_rep_with_pci(struct doca_dev *local, enum doca_dev_rep_filter filter, struct doca_pci_bdf *pci_bdf, |
| doca_error_t result; | ||
| size_t i; | ||
|
|
||
| *retval = NULL; |
|
|
||
|
|
||
| doca_error_t | ||
| parse_pci_addr(char const *pci_addr, struct doca_pci_bdf *out_bdf) |
| { | ||
| unsigned int bus_bitmask = 0xFFFFFF00; | ||
| unsigned int dev_bitmask = 0xFFFFFFE0; | ||
| unsigned int func_bitmask = 0xFFFFFFF8; |
There was a problem hiding this comment.
please consider uint16_t
| } | ||
|
|
||
|
|
||
| int bringup_for_doca(std::unique_ptr<fds_data> &tmp) |
388d73d to
32d8fbe
Compare
| hostport.c_str()); | ||
| rc = SOCKPERF_ERR_SOCKET; | ||
| break; | ||
| } |
There was a problem hiding this comment.
please check formatting
d6b7679 to
fc6c865
Compare
|
|
||
| #ifdef USING_DOCA_COMM_CHANNEL_API | ||
| #include "doca_cc_helper.h" | ||
| #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
There was a problem hiding this comment.
I will remove it, only for compilation purpose
| #include <dlfcn.h> | ||
| #endif | ||
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
There was a problem hiding this comment.
Will remove it as well, only for faster compilation
fc6c865 to
d80c8bb
Compare
3da6652 to
754d114
Compare
| bool need_alloc_mem; /* Whether need to allocate memory */ | ||
| }; | ||
|
|
||
| struct cc_data_path_ctx { |
51d6607 to
dff4dfc
Compare
054e73a to
136c1b4
Compare
ff45a73 to
b14697e
Compare
ac6e63f to
31124e9
Compare
31124e9 to
2fb2363
Compare
| #endif /* DEFINED_TLS */ | ||
| #if defined(USING_DOCA_COMM_CHANNEL_API) | ||
| bool doca_comm_channel = false; /* Flag to indicate using Com Channel*/ | ||
| bool doca_fast_path = false; /* Flag to indicate using fast path*/ |
There was a problem hiding this comment.
change name:
doca_cc_zcopy / doca_cc_fifo
| CC_FIFO_CONNECTED | ||
| }; | ||
|
|
||
| enum cc_fifo_data_path_state { |
| CC_CONNECTED | ||
| }; | ||
| enum cc_fifo_connection_state { | ||
| FIFO_CONNECTION_IN_PROGRESS, |
There was a problem hiding this comment.
change to start with CC
CC_FIFO_...
| struct doca_pe *pe_underload; /**< Progress Engine for */ | ||
| bool underload_mode; /**< For using different callback>*/ | ||
| enum cc_fifo_connection_state fifo_connection_state; /**< Holding state for fast path connection >*/ | ||
| enum cc_fifo_data_path_state fifo_data_path_state; /**< Holding state for fast path data path >*/ |
There was a problem hiding this comment.
remove cc_fifo_data_path_state
| } | ||
|
|
||
| // set here sockperf buf as local->mem | ||
| result = doca_mmap_set_memrange(local_mem->mmap, local_mem->mem, sizeof(uint8_t) * 65507 * 2); |
There was a problem hiding this comment.
change to msg_size
pointer to memory
size of memory
|
|
||
| DOCA_LOG_INFO("Message received: '%.*s'", (int)recv_msg_len, (char *)recv_msg); | ||
| (void)doca_buf_dec_refcount(buf, NULL); | ||
| doca_task_free(doca_cc_consumer_post_recv_task_as_task(task)); |
There was a problem hiding this comment.
no need for doca_buf_dec & free, can save doca_buf under fifo_ctx and use the same buf.
need to verify when buf wasn't used during nonblock call
| } | ||
| if (s_user_params.mode == MODE_CLIENT && !g_pApp->m_const_params.b_client_ping_pong | ||
| && !g_pApp->m_const_params.b_stream) { // latency_under_load | ||
| pe_local = s_user_params.pe_underload; |
There was a problem hiding this comment.
double check if can removed to producer side
| } | ||
| } // end of doca fast path | ||
| // Waiting for meesage receive callback - blocking or fifo mode and task submitted successfully | ||
| if (s_user_params.is_blocked || (s_user_params.doca_fast_path && result == DOCA_SUCCESS)) { |
There was a problem hiding this comment.
submit recv
wait for recv complete
pending
need to save flag if we got eagain after task submit
| #include "os_abstract.h" | ||
|
|
||
| #define MSG_SIZE 4080 | ||
| #define MAX_BUFS 10 |
2fb2363 to
25d0d73
Compare
25d0d73 to
ea90798
Compare
In a DPU system there is a need for a secure, network independent communication channel between the host and the DPU.
The DOCA Comm Channel provides a client-server API to provide such functionality.
The communication channel can allow the host to control services on the DPU, or to activate certain offloads.
In order to use Doca API, "doca_comm_channel.h" must be found.
Example how to use:
Host: ./sockperf pp --addr /tmp/test --doca-comm-channel
Arm: ./sockperf sr --addr /tmp/test --doca-comm-channel