Skip to content
Snippets Groups Projects
Commit 1d9a01be authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

more small changes

parent 5e29844a
No related branches found
No related tags found
3 merge requests!439RCG 5.0 release fro deb 10,!415Cdsrfm to use new dolphin interface,!411Userspace dolphin daemon, netlink dolphin setup for real time models
#ifndef LIGO_DOLPHIN_DAEMON_MESSAGES
#define LIGO_DOLPHIN_DAEMON_MESSAGES
//#include <stdint.h>
#include "util/fixed_width_types.h"
enum DOLPHIN_DAEMON_MSGS
......@@ -39,6 +38,7 @@ typedef struct dolphin_mc_alloc_resp
dolphin_mc_header header;
enum DOLPHIN_ERROR_CODES status;
uint32_t align_64_pad_1;
uint32_t num_addrs;
//Each dolphin multicast segment has a read and write address
//so each requested segment will have two addresses returned
......
......@@ -16,15 +16,12 @@ struct sock *nl_sock = NULL;
static struct task_struct *g_thread = 0;
static char thread_name[] = {"test thread"};
volatile void * g_read_addr = 0;
static void netlink_test_recv_msg(struct sk_buff *skb)
{
struct sk_buff *skb_out;
struct nlmsghdr *nlh;
int msg_size;
char *msg;
int pid;
int res;
nlh = (struct nlmsghdr *)skb->data;
pid = nlh->nlmsg_pid; /* pid of sending process */
......@@ -33,12 +30,21 @@ static void netlink_test_recv_msg(struct sk_buff *skb)
dolphin_mc_alloc_resp * resp = (dolphin_mc_alloc_resp *) nlmsg_data(nlh);
printk(KERN_INFO "netlink_test: Received %d bytes from pid %d:\n", nlmsg_len(nlh), pid);
//Verify length
if( nlmsg_len(nlh) < sizeof(dolphin_mc_alloc_resp) + (sizeof(volatile void *) * resp->num_addrs) )
{
printk(KERN_ERR "netlink_test: num_addrs was %u, but size (%u) of message was not big "
"enough to contain them all. Dropping message.\n", resp->num_addrs, nlmsg_len(nlh));
return;
}
printk(KERN_INFO "netlink_test: Received %d pyload bytes from pid %d, sizeof(volatile void *) %lu\n", nlmsg_len(nlh), pid, sizeof(volatile void *));
printk(KERN_INFO "netlink_test: msg_type %u, status %u, num_addrs %u\n", resp->header.msg_id, resp->status, resp->num_addrs);
for(int i=0; i < resp->num_addrs; i+=2)
{
printk(KERN_INFO "netlink_test: \t read addr: %p\n", resp->addrs[i]);
printk(KERN_INFO "netlink_test: \t write addr %p\n", resp->addrs[i+1]);
printk(KERN_INFO "netlink_test: \t read addr: 0x%lx\n", resp->addrs[i]);
printk(KERN_INFO "netlink_test: \t write addr 0x%lx\n", resp->addrs[i+1]);
g_read_addr = resp->addrs[i];
}
......
......@@ -121,7 +121,6 @@ void DolphinNetlinkServer::handle_alloc_req( dolphin_mc_alloc_req * req_ptr )
{
DOLPHIN_ERROR_CODES status;
//We leave new segments in this vector until we have processed the whole message
//if we fail along the way we return, and these resources get cleaned up
std::vector< std::unique_ptr< Dolphin_SISCI_Resource > > _new_segments;
......@@ -233,7 +232,7 @@ void DolphinNetlinkServer::send_netlink_message(void * msg_ptr, unsigned sz_byte
if (rc < 0) {
spdlog::error("sendmsg(): {}", strerror(errno));
}
spdlog::info("Sent message ret {}", rc);
spdlog::info("Sent message ret {}, requested size {}", rc, sz_bytes);
free(nlh);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment