Commit b310c706 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Just some test work, still not working

parent d82e7cb3
......@@ -26,7 +26,7 @@ KBUILD=/lib/modules/$(shell uname -r)/build/
obj-m += $(MODULENAME).o
$(MODULENAME)-y := cdsrfmswitch_core.o
ccflags-y := -O2 -Wall -std=gnu99 -Wno-declaration-after-statement -I$(mkfile_dir)/../../include/
ccflags-y := -O3 -Wall -std=gnu99 -Wno-declaration-after-statement -I$(mkfile_dir)/../../include/
default:
$(MAKE) -C $(KBUILD) M=$(mkfile_dir) modules
......
......@@ -237,34 +237,34 @@ inline int copyIpcData (int start_indx, int end_indx, int netFrom, int netTo)
// Only check every 4th block, as max RFM channel rate is 16K
for(jj=0; jj<IPC_BLOCKS; jj+=4) {
// Determine new data by comparing present timestamp with last xfer timestamp
syncWord = g_dolphin_read_addrs[netFrom]->dBlock[start_ipc_datapoint][ii].timestamp;
if(syncWord != syncArray[netFrom][start_ipc_datapoint][ii]) {
syncWord = g_dolphin_read_addrs[netFrom]->dBlock[jj][ii].timestamp;
if(syncWord != syncArray[netFrom][jj][ii]) {
xfers ++;
// Copy data and time stamp to next Dolphin switch
tmp_block.data = g_dolphin_read_addrs[netFrom]->dBlock[start_ipc_datapoint][ii].data;
tmp_block.data = g_dolphin_read_addrs[netFrom]->dBlock[jj][ii].data;
tmp_block.timestamp = syncWord;
memcpy( &g_dolphin_write_addrs[netTo]->dBlock[start_ipc_datapoint][ii], &tmp_block, sizeof(tmp_block));
syncArray[netFrom][start_ipc_datapoint][ii] = syncWord;
expected_ipc_datapoint[netTo][ii] = (start_ipc_datapoint + 4 ) % IPC_BLOCKS;
cblock = start_ipc_datapoint;
memcpy( &g_dolphin_write_addrs[netTo]->dBlock[jj][ii], &tmp_block, sizeof(tmp_block));
syncArray[netFrom][jj][ii] = syncWord;
//expected_ipc_datapoint[netTo][ii] = (start_ipc_datapoint + 4 ) % IPC_BLOCKS;
cblock = jj;
dblock = ii;
ttcache += 1;
break;
//syncWord = g_dolphin_read_addrs[netFrom]->dBlock[start_ipc_datapoint][ii].timestamp;
//if( syncWord == syncArray[netFrom][start_ipc_datapoint][ii])
//break; //No more data to copy
}
start_ipc_datapoint = (start_ipc_datapoint + 4) % IPC_BLOCKS;
// start_ipc_datapoint = (start_ipc_datapoint + 4) % IPC_BLOCKS;
}
}
}
// If anything was copied, we need to flush the buffer
//if (ttcache > 0) clflush_cache_range (&(g_dolphin_write_addrs[netTo]->dBlock[cblock][dblock].data), 16);
if(!ttcache) udelay(1);
if (ttcache > 0) clflush_cache_range (&(g_dolphin_write_addrs[netTo]->dBlock[cblock][dblock].data), 16);
// if(!ttcache) udelay(2);
// return total xfers, which is used as code running diagnostic
return xfers;
}
......@@ -467,10 +467,26 @@ int init_dolphin( void )
for(int i =0; i < RFMX_NUM_DOLPHIN_CARDS; ++i)
{
//The RFMX uses the same segment ID across networks for RFM IPCs
alloc_req->segments[i].segment_id = RFMX_SEGMENT_ID;
//alloc_req->segments[i].segment_id = RFMX_SEGMENT_ID;
//Each connection uses a diffrent dolphin adapter, and we bridge the network across them
alloc_req->segments[i].adapter_num = g_adapter_map[i];
alloc_req->segments[i].segment_sz_bytes = IPC_TOTAL_ALLOC_SIZE;
if(i == 0) //CS
{
alloc_req->segments[i].segment_id = 1;
}
else if (i == 1) //EX
{
alloc_req->segments[i].segment_id = 2;
}
else //EY
{
alloc_req->segments[i].segment_id = 3;
}
}
res = nlmsg_multicast(g_nl_sock, skb_out, 0, DOLPHIN_DAEMON_REQ_GRP_ID, GFP_KERNEL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment