-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,475 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# | ||
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# See file LICENSE for terms. | ||
# | ||
|
||
AC_DEFUN([CHECK_DOCA_UROM],[ | ||
AS_IF([test "x$doca_urom_checked" != "xyes"],[ | ||
doca_urom_happy="no" | ||
AC_ARG_WITH([doca_urom], | ||
[AS_HELP_STRING([--with-doca_urom=(DIR)], [Enable the use of DOCA_UROM (default is guess).])], | ||
[], [with_doca_urom=guess]) | ||
AS_IF([test "x$with_doca_urom" != "xno"], | ||
[ | ||
save_CPPFLAGS="$CPPFLAGS $UCS_CPPFLAGS" | ||
save_CFLAGS="$CFLAGS" | ||
save_LDFLAGS="$LDFLAGS" | ||
AS_IF([test ! -z "$with_doca_urom" -a "x$with_doca_urom" != "xyes" -a "x$with_doca_urom" != "xguess"], | ||
[ | ||
AS_IF([test ! -d $with_doca_urom], | ||
[AC_MSG_ERROR([Provided "--with-doca_urom=${with_doca_urom}" location does not exist])]) | ||
check_doca_urom_dir="$with_doca_urom" | ||
check_doca_urom_libdir="$with_doca_urom/lib64" | ||
CPPFLAGS="-I$with_doca_urom/include $save_CPPFLAGS" | ||
LDFLAGS="-L$check_doca_urom_libdir $save_LDFLAGS" | ||
]) | ||
AS_IF([test ! -z "$with_doca_urom_libdir" -a "x$with_doca_urom_libdir" != "xyes"], | ||
[ | ||
check_doca_urom_libdir="$with_doca_urom_libdir" | ||
LDFLAGS="-L$check_doca_urom_libdir $save_LDFLAGS" | ||
]) | ||
AC_CHECK_HEADERS([doca_urom.h], | ||
[ | ||
AC_CHECK_LIB([doca_urom], [doca_urom_service_create], | ||
[ | ||
doca_urom_happy="yes" | ||
], | ||
[ | ||
echo "CPPFLAGS: $CPPFLAGS" | ||
doca_urom_happy="no" | ||
], [-ldoca_common -ldoca_argp -ldoca_urom]) | ||
], | ||
[ | ||
doca_urom_happy="no" | ||
]) | ||
AS_IF([test "x$doca_urom_happy" = "xyes"], | ||
[ | ||
AS_IF([test "x$check_doca_urom_dir" != "x"], | ||
[ | ||
AC_MSG_RESULT([DOCA_UROM dir: $check_doca_urom_dir]) | ||
AC_SUBST(DOCA_UROM_CPPFLAGS, "-I$check_doca_urom_dir/include/ $doca_urom_old_headers") | ||
]) | ||
AS_IF([test "x$check_doca_urom_libdir" != "x"], | ||
[ | ||
AC_SUBST(DOCA_UROM_LDFLAGS, "-L$check_doca_urom_libdir") | ||
]) | ||
AC_SUBST(DOCA_UROM_LIBADD, "-ldoca_common -ldoca_argp -ldoca_urom") | ||
AC_DEFINE([HAVE_DOCA_UROM], 1, [Enable DOCA_UROM support]) | ||
], | ||
[ | ||
AS_IF([test "x$with_doca_urom" != "xguess"], | ||
[ | ||
AC_MSG_ERROR([DOCA_UROM support is requested but DOCA_UROM packages cannot be found! $CPPFLAGS $LDFLAGS]) | ||
], | ||
[ | ||
AC_MSG_WARN([DOCA_UROM not found]) | ||
]) | ||
]) | ||
CFLAGS="$save_CFLAGS" | ||
CPPFLAGS="$save_CPPFLAGS" | ||
LDFLAGS="$save_LDFLAGS" | ||
], | ||
[ | ||
AC_MSG_WARN([DOCA_UROM was explicitly disabled]) | ||
]) | ||
doca_urom_checked=yes | ||
AM_CONDITIONAL([HAVE_DOCA_UROM], [test "x$doca_urom_happy" != xno]) | ||
])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# | ||
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# See file LICENSE for terms. | ||
# | ||
|
||
AC_DEFUN([CHECK_DOCA_UROM_UCC],[ | ||
AS_IF([test "x$doca_urom_ucc_checked" != "xyes"],[ | ||
doca_urom_ucc_happy="no" | ||
AC_ARG_WITH([doca_urom_ucc], | ||
[AS_HELP_STRING([--with-doca_urom_ucc=(DIR)], [Enable the use of DOCA_UROM_UCC (default is no).])], | ||
[], [with_doca_urom_ucc=no]) | ||
AS_IF([test "x$with_doca_urom_ucc" != "xno"], | ||
[ | ||
AS_IF([test "x$doca_urom_happy" == "xyes"], | ||
[ | ||
save_CPPFLAGS="$CPPFLAGS $UCS_CPPFLAGS $DOCA_UROM_CPPFLAGS" | ||
save_CFLAGS="$CFLAGS" | ||
save_LDFLAGS="$LDFLAGS $DOCA_UROM_LDFLAGS" | ||
AS_IF([test ! -z "$with_doca_urom_ucc" -a "x$with_doca_urom_ucc" != "xyes" -a "x$with_doca_urom_ucc" != "xguess"], | ||
[ | ||
AS_IF([test ! -d $with_doca_urom_ucc], | ||
[AC_MSG_ERROR([Provided "--with-doca_urom_ucc=${with_doca_urom_ucc}" location does not exist])]) | ||
check_doca_urom_ucc_dir="$with_doca_urom_ucc" | ||
check_doca_urom_ucc_libdir="$with_doca_urom_ucc/lib64" | ||
CPPFLAGS="-I$with_doca_urom_ucc/include $save_CPPFLAGS" | ||
LDFLAGS="-L$check_doca_urom_ucc_libdir $save_LDFLAGS" | ||
]) | ||
AS_IF([test ! -z "$with_doca_urom_ucc_libdir" -a "x$with_doca_urom_ucc_libdir" != "xyes"], | ||
[ | ||
check_doca_urom_ucc_libdir="$with_doca_urom_ucc_libdir" | ||
LDFLAGS="-L$check_doca_urom_ucc_libdir $save_LDFLAGS" | ||
]) | ||
AC_CHECK_HEADERS([urom_common.h], | ||
[ | ||
AC_CHECK_LIB([doca_urom_ucc], [start_urom_service], | ||
[ | ||
doca_urom_ucc_happy="yes" | ||
], | ||
[ | ||
echo "CPPFLAGS: $CPPFLAGS" | ||
doca_urom_ucc_happy="no" | ||
], [-ldoca_urom_ucc -ldoca_common -ldoca_argp -ldoca_urom]) | ||
], | ||
[ | ||
doca_urom_ucc_happy="no" | ||
]) | ||
AS_IF([test "x$doca_urom_ucc_happy" = "xyes"], | ||
[ | ||
AS_IF([test "x$check_doca_urom_ucc_dir" != "x"], | ||
[ | ||
AC_MSG_RESULT([DOCA_UROM_UCC dir: $check_doca_urom_ucc_dir]) | ||
AC_SUBST(DOCA_UROM_UCC_CPPFLAGS, "-I$check_doca_urom_ucc_dir/include/ $doca_urom_ucc_old_headers") | ||
]) | ||
AS_IF([test "x$check_doca_urom_ucc_libdir" != "x"], | ||
[ | ||
AC_SUBST(DOCA_UROM_UCC_LDFLAGS, "-L$check_doca_urom_ucc_libdir") | ||
]) | ||
AC_SUBST(DOCA_UROM_UCC_LIBADD, "-ldoca_urom_ucc") | ||
AC_DEFINE([HAVE_DOCA_UROM_UCC], 1, [Enable DOCA_UROM_UCC support]) | ||
], | ||
[ | ||
AS_IF([test "x$with_doca_urom_ucc" != "xguess"], | ||
[ | ||
AC_MSG_ERROR([DOCA_UROM_UCC support is requested but DOCA_UROM_UCC packages cannot be found! $CPPFLAGS $LDFLAGS]) | ||
], | ||
[ | ||
AC_MSG_WARN([DOCA_UROM_UCC not found]) | ||
]) | ||
]) | ||
CFLAGS="$save_CFLAGS" | ||
CPPFLAGS="$save_CPPFLAGS" | ||
LDFLAGS="$save_LDFLAGS" | ||
], | ||
[ | ||
AC_MSG_ERROR([DOCA_UROM_UCC was enabled, but DOCA_UROM was not]) | ||
doca_urom_ucc_happy="no" | ||
]) | ||
], | ||
[ | ||
AC_MSG_WARN([DOCA_UROM_UCC was explicitly disabled]) | ||
]) | ||
doca_urom_ucc_checked=yes | ||
AM_CONDITIONAL([HAVE_DOCA_UROM_UCC], [test "x$doca_urom_ucc_happy" != xno]) | ||
])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
|
||
sources = \ | ||
cl_doca_urom.h \ | ||
cl_doca_urom.c \ | ||
cl_doca_urom_lib.c \ | ||
cl_doca_urom_context.c \ | ||
cl_doca_urom_team.c \ | ||
cl_doca_urom_coll.c | ||
|
||
module_LTLIBRARIES = libucc_cl_doca_urom.la | ||
libucc_cl_doca_urom_la_SOURCES = $(sources) | ||
libucc_cl_doca_urom_la_CPPFLAGS = $(AM_CPPFLAGS) $(BASE_CPPFLAGS) $(DOCA_UROM_CPPFLAGS) $(DOCA_UROM_UCC_CPPFLAGS) | ||
libucc_cl_doca_urom_la_CFLAGS = $(BASE_CFLAGS) | ||
libucc_cl_doca_urom_la_LDFLAGS = -version-info $(SOVERSION) --as-needed $(DOCA_UROM_UCC_LDFLAGS) $(DOCA_UROM_LDFLAGS) | ||
libucc_cl_doca_urom_la_LIBADD = $(DOCA_UROM_UCC_LIBADD) $(DOCA_UROM_LIBADD) $(UCC_TOP_BUILDDIR)/src/libucc.la | ||
|
||
include $(top_srcdir)/config/module.am |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
#include "cl_doca_urom.h" | ||
#include "utils/ucc_malloc.h" | ||
|
||
ucc_status_t ucc_cl_doca_urom_get_lib_attr(const ucc_base_lib_t *lib, | ||
ucc_base_lib_attr_t *base_attr); | ||
|
||
ucc_status_t ucc_cl_doca_urom_get_context_attr(const ucc_base_context_t *context, | ||
ucc_base_ctx_attr_t *base_attr); | ||
|
||
ucc_status_t ucc_cl_doca_urom_get_lib_properties(ucc_base_lib_properties_t *prop); | ||
|
||
static ucc_config_field_t ucc_cl_doca_urom_lib_config_table[] = { | ||
{"", "", NULL, ucc_offsetof(ucc_cl_doca_urom_lib_config_t, super), | ||
UCC_CONFIG_TYPE_TABLE(ucc_cl_lib_config_table)}, | ||
|
||
{"DEVICE", "mlx5_0", | ||
"DPU device", | ||
ucc_offsetof(ucc_cl_doca_urom_lib_config_t, device), | ||
UCC_CONFIG_TYPE_STRING}, | ||
|
||
{"PLUGIN_NAME", "libdoca_urom_ucc_plugin", | ||
"Name of plugin library", | ||
ucc_offsetof(ucc_cl_doca_urom_lib_config_t, plugin_name), | ||
UCC_CONFIG_TYPE_STRING}, | ||
|
||
{"DOCA_LOG_LEVEL", "10", | ||
"DOCA log level", | ||
ucc_offsetof(ucc_cl_doca_urom_lib_config_t, doca_log_level), | ||
UCC_CONFIG_TYPE_INT}, | ||
|
||
{NULL}}; | ||
|
||
static ucs_config_field_t ucc_cl_doca_urom_context_config_table[] = { | ||
{"", "", NULL, ucc_offsetof(ucc_cl_doca_urom_context_config_t, super), | ||
UCC_CONFIG_TYPE_TABLE(ucc_cl_context_config_table)}, | ||
|
||
{"PLUGIN_ENVS", "", | ||
"Comma separated envs to pass to the worker plugin", | ||
ucc_offsetof(ucc_cl_doca_urom_context_config_t, plugin_envs), | ||
UCC_CONFIG_TYPE_STRING_ARRAY}, | ||
|
||
{NULL}}; | ||
|
||
UCC_CLASS_DEFINE_NEW_FUNC(ucc_cl_doca_urom_lib_t, ucc_base_lib_t, | ||
const ucc_base_lib_params_t *, | ||
const ucc_base_config_t *); | ||
|
||
UCC_CLASS_DEFINE_DELETE_FUNC(ucc_cl_doca_urom_lib_t, ucc_base_lib_t); | ||
|
||
UCC_CLASS_DEFINE_NEW_FUNC(ucc_cl_doca_urom_context_t, ucc_base_context_t, | ||
const ucc_base_context_params_t *, | ||
const ucc_base_config_t *); | ||
|
||
UCC_CLASS_DEFINE_DELETE_FUNC(ucc_cl_doca_urom_context_t, ucc_base_context_t); | ||
|
||
UCC_CLASS_DEFINE_NEW_FUNC(ucc_cl_doca_urom_team_t, ucc_base_team_t, | ||
ucc_base_context_t *, const ucc_base_team_params_t *); | ||
|
||
ucc_status_t ucc_cl_doca_urom_team_create_test(ucc_base_team_t *cl_team); | ||
|
||
ucc_status_t ucc_cl_doca_urom_team_destroy(ucc_base_team_t *cl_team); | ||
|
||
ucc_status_t ucc_cl_doca_urom_coll_init(ucc_base_coll_args_t *coll_args, | ||
ucc_base_team_t *team, | ||
ucc_coll_task_t **task); | ||
|
||
ucc_status_t ucc_cl_doca_urom_team_get_scores(ucc_base_team_t *cl_team, | ||
ucc_coll_score_t **score); | ||
|
||
UCC_CL_IFACE_DECLARE(doca_urom, DOCA_UROM); |
Oops, something went wrong.