1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Initial commit with (empty) infiniband node

This commit is contained in:
Dennis Potter 2018-06-21 11:56:28 +02:00
parent ac77d7eb85
commit a1b7a9cda6
6 changed files with 245 additions and 20 deletions

View file

@ -69,7 +69,7 @@ endif
# Common flags
LDLIBS =
CFLAGS += -std=c11 -MMD -mcx16 -I$(BUILDDIR)/include -I$(SRCDIR)/include
CFLAGS += -Wall -Werror -fdiagnostics-color=auto -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1
CFLAGS += -Wall -fdiagnostics-color=auto -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1
ifeq ($(PLATFORM),Darwin)
CFLAGS += -D_DARWIN_C_SOURCE

View file

@ -54,21 +54,22 @@ else
IS_LINUX = 0
endif
WITH_NODE_FPGA ?= $(IS_LINUX)
WITH_NODE_CBUILDER ?= $(IS_LINUX)
WITH_NODE_LOOPBACK ?= $(IS_LINUX)
WITH_NODE_COMEDI ?= $(IS_LINUX)
WITH_NODE_TEST_RTT ?= 1
WITH_NODE_FILE ?= 1
WITH_NODE_SIGNAL ?= 1
WITH_NODE_NGSI ?= 1
WITH_NODE_WEBSOCKET ?= 1
WITH_NODE_SOCKET ?= 1
WITH_NODE_ZEROMQ ?= 1
WITH_NODE_NANOMSG ?= 1
WITH_NODE_SHMEM ?= 1
WITH_NODE_STATS ?= 1
WITH_NODE_INFLUXDB ?= 1
WITH_NODE_AMQP ?= 1
WITH_NODE_IEC61850 ?= 1
WITH_NODE_MQTT ?= 1
WITH_NODE_FPGA ?= $(IS_LINUX)
WITH_NODE_CBUILDER ?= $(IS_LINUX)
WITH_NODE_LOOPBACK ?= $(IS_LINUX)
WITH_NODE_COMEDI ?= $(IS_LINUX)
WITH_NODE_TEST_RTT ?= 1
WITH_NODE_FILE ?= 1
WITH_NODE_SIGNAL ?= 1
WITH_NODE_NGSI ?= 1
WITH_NODE_WEBSOCKET ?= 1
WITH_NODE_SOCKET ?= 1
WITH_NODE_ZEROMQ ?= 1
WITH_NODE_NANOMSG ?= 1
WITH_NODE_SHMEM ?= 1
WITH_NODE_STATS ?= 1
WITH_NODE_INFLUXDB ?= 1
WITH_NODE_AMQP ?= 1
WITH_NODE_IEC61850 ?= 1
WITH_NODE_MQTT ?= 1
WITH_NODE_INFINIBAND ?= 1

View file

@ -92,7 +92,7 @@ help:
$E " WITH_NODE_AMQP = $(WITH_NODE_AMQP)"
$E " WITH_NODE_MQTT = $(WITH_NODE_MQTT)"
$E " WITH_NODE_IEC61850 = $(WITH_NODE_IEC61850)"
$E " WITH_NODE_MQTT = $(WITH_NODE_MQTT)"
$E " WITH_NODE_INFINIBAND = $(WITH_NODE_INFINIBAND)"
$E " WITH_NODE_COMEDI = $(WITH_NODE_COMEDI)"
$E
$E "Available dependencies: $(LIB_PKGS)"

View file

@ -0,0 +1,90 @@
/** Node type: infiniband
*
* @file
* @author Dennis Potter <dennis@dennispotter.eu>
* @copyright 2018, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
/**
* @addtogroup infiniband infiniband node type
* @ingroup node
* @{
*/
#pragma once
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/io.h>
#include <villas/queue_signalled.h>
#include <rdma/rdma_cma.h>
/* Forward declarations */
struct format_type;
struct infiniband {
struct rdma_cm_id *id;
struct ibv_pd *pd;
struct ibv_cq *cq;
struct ibv_comp_channel *comp_channel;
pthread_t cq_poller_thread;
struct connection_s {
char *src_ip_addr;
char *dst_ip_addr;
struct ibv_qp *qp;
struct ibv_mr *mr_payload;
struct r_addr_key_s *r_addr_key;
} conn;
};
/** @see node_type::reverse */
int infiniband_reverse(struct node *n);
/** @see node_type::print */
char * infiniband_print(struct node *n);
/** @see node_type::parse */
int infiniband_parse(struct node *n, json_t *cfg);
/** @see node_type::open */
int infiniband_start(struct node *n);
/** @see node_type::destroy */
int infiniband_destroy(struct node *n);
/** @see node_type::close */
int infiniband_stop(struct node *n);
/** @see node_type::init */
int infiniband_init();
/** @see node_type::deinit */
int infiniband_deinit();
/** @see node_type::read */
int infiniband_read(struct node *n, struct sample *smps[], unsigned cnt);
/** @see node_type::write */
int infiniband_write(struct node *n, struct sample *smps[], unsigned cnt);
/** @} */

View file

@ -156,6 +156,13 @@ ifneq ($(wildcard /usr/include/mosquitto.h),)
endif
endif
# Enable Infiniband support
ifeq ($(WITH_NODE_INFINIBAND),1)
LIB_SRCS += lib/nodes/infiniband.c
LIB_NODES += infiniband
WITH_IO = 1
endif
# Enable Comedi support
ifeq ($(WITH_NODE_COMEDI),1)
ifeq ($(shell $(PKGCONFIG) comedilib; echo $$?),0)

127
lib/nodes/infiniband.c Normal file
View file

@ -0,0 +1,127 @@
/** Node type: infiniband
*
* @author Dennis Potter <dennis@dennispotter.eu>
* @copyright 2018, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include <string.h>
#include <villas/nodes/infiniband.h>
#include <villas/plugin.h>
#include <villas/utils.h>
#include <villas/format_type.h>
static void infiniband_log_cb(struct infiniband *ib, void *userdata, int level, const char *str)
{
}
static void infiniband_connect_cb(struct infiniband *ib, void *userdata, int result)
{
}
static void infiniband_disconnect_cb(struct infiniband *ib, void *userdata, int result)
{
}
static void infiniband_message_cb(struct infiniband *ib, void *userdata)
{
}
static void infiniband_subscribe_cb(struct infiniband *ib, void *userdata, int mid, int qos_count, const int *granted_qos)
{
}
int infiniband_reverse(struct node *n)
{
return 0;
}
int infiniband_parse(struct node *n, json_t *cfg)
{
return 0;
}
char * infiniband_print(struct node *n)
{
return 0;
}
int infiniband_destroy(struct node *n)
{
return 0;
}
int infiniband_start(struct node *n)
{
return 0;
}
int infiniband_stop(struct node *n)
{
return 0;
}
int infiniband_init()
{
return 0;
}
int infiniband_deinit()
{
return 0;
}
int infiniband_read(struct node *n, struct sample *smps[], unsigned cnt)
{
return 0;
}
int infiniband_write(struct node *n, struct sample *smps[], unsigned cnt)
{
return 0;
}
int infiniband_fd(struct node *n)
{
return 0;
}
static struct plugin p = {
.name = "infiniband",
.description = "Infiniband)",
.type = PLUGIN_TYPE_NODE,
.node = {
.vectorize = 0,
.size = sizeof(struct infiniband),
.reverse = infiniband_reverse,
.parse = infiniband_parse,
.print = infiniband_print,
.start = infiniband_start,
.destroy = infiniband_destroy,
.stop = infiniband_stop,
.init = infiniband_init,
.deinit = infiniband_deinit,
.read = infiniband_read,
.write = infiniband_write,
.fd = infiniband_fd
}
};
REGISTER_PLUGIN(&p)
LIST_INIT_STATIC(&p.node.instances)