-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Doca Communication Channel API #190
base: sockperf_v2
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
########################################################################## | ||
# check DOCA communication channel API | ||
# | ||
AC_ARG_ENABLE( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to use AC_ARG_WITH here to allow specifying alternative library installation path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
src/sockperf.cpp
Outdated
@@ -2380,7 +2429,7 @@ void cleanup() { | |||
} | |||
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is a reason of using unlink
instead of os_unlink_unix_path
src/sockperf.cpp
Outdated
#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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be static?
src/sockperf.cpp
Outdated
size_t i; | ||
|
||
/* Set default return value */ | ||
*retval = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If passed retval
is NULL?
src/sockperf.cpp
Outdated
} | ||
|
||
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static?
src/sockperf.cpp
Outdated
doca_error_t result; | ||
size_t i; | ||
|
||
*retval = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if retval
is NULL?
src/sockperf.cpp
Outdated
|
||
|
||
doca_error_t | ||
parse_pci_addr(char const *pci_addr, struct doca_pci_bdf *out_bdf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static?
src/sockperf.cpp
Outdated
{ | ||
unsigned int bus_bitmask = 0xFFFFFF00; | ||
unsigned int dev_bitmask = 0xFFFFFFE0; | ||
unsigned int func_bitmask = 0xFFFFFFF8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider uint16_t
} | ||
|
||
|
||
int bringup_for_doca(std::unique_ptr<fds_data> &tmp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static?
388d73d
to
32d8fbe
Compare
src/server.cpp
Outdated
hostport.c_str()); | ||
rc = SOCKPERF_ERR_SOCKET; | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check formatting
d6b7679
to
fc6c865
Compare
@@ -157,6 +156,11 @@ typedef unsigned short int sa_family_t; | |||
#endif // USING_XLIO_EXTRA_API | |||
#endif // !defined(__windows__) && !defined(__FreeBSD__) && !defined(__APPLE__) | |||
|
|||
#ifdef USING_DOCA_COMM_CHANNEL_API | |||
#include "doca_cc_helper.h" | |||
#pragma clang diagnostic ignored "-Wdeprecated-declarations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove it, only for compilation purpose
@@ -103,6 +103,8 @@ | |||
#ifndef __windows__ | |||
#include <dlfcn.h> | |||
#endif | |||
#pragma GCC diagnostic push | |||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove it as well, only for faster compilation
fc6c865
to
d80c8bb
Compare
3da6652
to
754d114
Compare
src/doca_cc_helper.h
Outdated
bool need_alloc_mem; /* Whether need to allocate memory */ | ||
}; | ||
|
||
struct cc_data_path_ctx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc_ctx_fifo
51d6607
to
dff4dfc
Compare
054e73a
to
136c1b4
Compare
ff45a73
to
b14697e
Compare
ac6e63f
to
31124e9
Compare
31124e9
to
2fb2363
Compare
src/defs.h
Outdated
@@ -820,9 +821,11 @@ struct user_params_t { | |||
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change name:
doca_cc_zcopy / doca_cc_fifo
src/doca_cc_helper.h
Outdated
CC_FIFO_CONNECTED | ||
}; | ||
|
||
enum cc_fifo_data_path_state { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
src/doca_cc_helper.h
Outdated
CONNECTION_IN_PROGRESS, | ||
CC_CONNECTED | ||
}; | ||
enum cc_fifo_connection_state { | ||
FIFO_CONNECTION_IN_PROGRESS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to start with CC
CC_FIFO_...
src/doca_cc_helper.h
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove cc_fifo_data_path_state
src/doca_cc_helper.h
Outdated
} | ||
|
||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to msg_size
pointer to memory
size of memory
src/doca_cc_helper.h
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
src/input_handlers.h
Outdated
} | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double check if can removed to producer side
src/input_handlers.h
Outdated
} | ||
} // 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submit recv
wait for recv complete
pending
need to save flag if we got eagain after task submit
src/doca_cc_helper.h
Outdated
#include "os_abstract.h" | ||
|
||
#define MSG_SIZE 4080 | ||
#define MAX_BUFS 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to 1
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