Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ezekiel Dohmen
advLigoRTS
Commits
5cc82ca7
Commit
5cc82ca7
authored
Aug 30, 2022
by
Ezekiel Dohmen
Browse files
A bit of work to support multiple adapters
parent
ea6b5d28
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dolphin_daemon/include/Dolphin_SISCI_Resource.hpp
View file @
5cc82ca7
...
...
@@ -18,7 +18,7 @@ class Dolphin_SISCI_Resource
virtual
~
Dolphin_SISCI_Resource
();
DOLPHIN_ERROR_CODES
connect_mc_segment
(
unsigned
segment_id
,
unsigned
segment_size
);
DOLPHIN_ERROR_CODES
connect_mc_segment
(
unsigned
adapter_num
,
unsigned
segment_id
,
unsigned
segment_size
);
int
get_segment_id
();
...
...
@@ -30,13 +30,13 @@ class Dolphin_SISCI_Resource
//Static members
static
unsigned
_usage_count
;
static
std
::
mutex
_data_mutex
;
static
const
unsigned
_local_adapter_num
;
static
unsigned
_local_node_id
;
//Filled when we init the lib
//Instance members
sci_desc_t
_v_dev
;
unsigned
_segment_id
;
sci_local_segment_t
_local_segment
;
unsigned
_local_adapter_num
;
sci_remote_segment_t
_remote_segment
;
sci_map_t
_local_map
;
sci_map_t
_remote_map
;
...
...
src/dolphin_daemon/src/DolphinNetlinkServer.cpp
View file @
5cc82ca7
...
...
@@ -147,7 +147,9 @@ void DolphinNetlinkServer::handle_alloc_req( dolphin_mc_alloc_req * req_ptr )
if
(
!
new_segments
.
back
()
)
return
build_and_send_alloc_resp_error
(
DOLPHIN_ERROR_SEGMENT_SETUP_ERROR
);
//Setup the multicast segment
status
=
new_segments
.
back
()
->
connect_mc_segment
(
req_ptr
->
segment_ids
[
i
],
req_ptr
->
segment_sz_bytes
);
status
=
new_segments
.
back
()
->
connect_mc_segment
(
req_ptr
->
segments
[
i
]
->
adapter_num
,
req_ptr
->
segments
[
i
]
->
segment_id
,
req_ptr
->
segments
[
i
]
->
segment_sz_bytes
);
if
(
status
!=
DOLPHIN_ERROR_OK
)
return
build_and_send_alloc_resp_error
(
status
);
}
...
...
src/dolphin_daemon/src/Dolphin_SISCI_Resource.cpp
View file @
5cc82ca7
...
...
@@ -11,8 +11,6 @@
unsigned
Dolphin_SISCI_Resource
::
_usage_count
=
0
;
std
::
mutex
Dolphin_SISCI_Resource
::
_data_mutex
;
const
unsigned
Dolphin_SISCI_Resource
::
_local_adapter_num
=
0
;
unsigned
Dolphin_SISCI_Resource
::
_local_node_id
;
std
::
unique_ptr
<
Dolphin_SISCI_Resource
>
Dolphin_SISCI_Resource
::
create_instance
()
{
...
...
@@ -32,18 +30,6 @@ std::unique_ptr< Dolphin_SISCI_Resource > Dolphin_SISCI_Resource::create_instanc
return
nullptr
;
}
// Get local nodeId
SCIGetLocalNodeId
(
_local_adapter_num
,
&
_local_node_id
,
NO_FLAGS
,
&
error
);
if
(
error
!=
SCI_ERR_OK
)
{
spdlog
::
error
(
"Dolphin_SISCI_Resource::create_instance() - Could not find the local adapter {}"
,
_local_adapter_num
);
SCITerminate
();
return
nullptr
;
}
}
++
Dolphin_SISCI_Resource
::
_usage_count
;
...
...
@@ -82,10 +68,25 @@ Dolphin_SISCI_Resource::~Dolphin_SISCI_Resource()
}
DOLPHIN_ERROR_CODES
Dolphin_SISCI_Resource
::
connect_mc_segment
(
unsigned
segment_id
,
unsigned
segment_size
)
DOLPHIN_ERROR_CODES
Dolphin_SISCI_Resource
::
connect_mc_segment
(
unsigned
adapter_num
,
unsigned
segment_id
,
unsigned
segment_size
)
{
sci_error_t
error
;
_local_adapter_num
=
adapter_num
;
// Get local nodeId
SCIGetLocalNodeId
(
_local_adapter_num
,
&
_local_node_id
,
NO_FLAGS
,
&
error
);
if
(
error
!=
SCI_ERR_OK
)
{
spdlog
::
error
(
"Dolphin_SISCI_Resource::supports_multicast() - Could not find the local adapter {}"
,
_local_adapter_num
);
SCITerminate
();
return
nullptr
;
}
if
(
!
supports_multicast
()
)
{
spdlog
::
error
(
"Dolphin_SISCI_Resource::connect_mc_segment() - Called, but dolphin network does not support multicast."
);
...
...
@@ -176,6 +177,7 @@ bool Dolphin_SISCI_Resource::supports_multicast()
sci_error_t
error
;
unsigned
int
mcast_max_groups
=
0
;
queryAdapter
.
localAdapterNo
=
_local_adapter_num
;
queryAdapter
.
subcommand
=
SCI_Q_ADAPTER_MCAST_MAX_GROUPS
;
queryAdapter
.
data
=
&
mcast_max_groups
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment