Help - I am stuck on MCP firmware programming.
Gyu Sang Choi <[email protected]> Fri, 09 Jul 2004 15:44:03 -0400
| Newsgroups | gmane.network.myrinet.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I am modifying Myrinet MCP firmware to implement a new scheme to bring a
data, instead of DMA.
The scheme is explained below.
First, I memory-map a NIC memory into a user application.
And then, a user application writes some data into a memory-mapped area.
I tested memory-mapping and the memory-mapping works well.
Finally, when a user application sends a data from a mmapped area to a
corresponding program,
a NIC processor fetches data from a NIC memory directly,
instead of using DMA to bring a data from a main memory into some
buffer space in a NIC memory
So, I am changing "gm_smda.c", "gm_send.h", "gm_user_dma.h", and
"gm_send.c".
Especially, I am workng on "gm_sdma.c".
In "shortcut_if_possible" function, I use "gm_bcopy" to copy the data
into the payload in a packet,
instead of using USER_SDMA, only if the data is within a mmaped area.
However, it doesn't not work.
A receiver in gm_allsize test only receives one packet from a sender and
the contents of the received packets is not corret.
So, the receiver couldn't send the reply back to the send.
My code is following. The "if condition" checks whether message is
within a mmaped area or not.
port->cache is the pointer for a mmapped area in NIC memory.
==============================================================================
if((port->PORT->nic_cache <= message) &&
((port->PORT->nic_cache + GM_PORT_MAPPED_CACHE_LEN) > message))
{
gm_bcopy(port->cache, payload,send_len) ;
smlt = (char *)payload + send_len ;
}
else
{
USER_SDMA (&payload, message, h+1,
send_len + GM_DMA_GRANULARITY-1,
GM_SUBPORT_PORT (sp_id), GM_DMA_DESCRIPTOR_E2L);
smlt = (char *) payload + send_len;
}
================================================================================
I really appreciate if you tell me what I am missing?
Thanks,
--
---------------------------------------------------------------
| Name : Gyu Sang Choi |
| Office : 358 IST Building |
| Office Phone : (814)865-2729 |
| email : [email protected] |
| Home Phone : (814)861-6986 |
| Cell Phone : (814)880-3814 |
| Address : 425 Waupelani Drive #327, State College, PA 16801 |
---------------------------------------------------------------