- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can not figure this out from the tutorial. Hopefully folks can give me a hand ... So I have a set of client code resides inside MIC, and a set of server code lives in Xeon host - both allocate a piece of memory (kmalloc), described by a structure "mic_mem" as the following:
struct mic_mem {
void *base; /* address returned from kmalloc */
off_t offset;
};
struct mic_mem lmem, rmem;
lmem.offset = scif_register(epd, lmem.base, 2*PAGE_SIZE, 0,
SCIF_PROT_READ|SCIF_PROT_WRITE,
SCIF_MAP_KERNEL);/*
* then I use a pair of plain scif_send/scif_recv to exchange contents of mic_mem structure
* local mem in lmem, and remote mem in rmem w/ peer ...
* ... so far so good ..
*/
...
ret = scif_writeto(epd, lmem.offset+PAGE_SIZE, PAGE_SIZE, rmem.offset,,
SCIF_RMA_ORDERED);/* I'm thinking to write to the bottom page of my local buffer to the remote upper page
* unfortunately, I always get "-6" back from scif_writeto.
* /
I must mis-understand the programming model. Could someone explain exactly what the "offset" implies here ?
Thanks,
Wendy
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see why this shouldn't work - assuming there were no other errors along the way. If you use:
ret = scif_writeto(epd, lmem.offset, 2*PAGE_SIZE, rmem.offset, SCIF_RMA_ORDERED);
does that write succeed? So it is only the offset addition that is messing up? (By the way, there is an extra comma in your scif_writeto statement. I'm assuming that was just a transcription error.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the response. I've found the problem ... I used an “int” to store the return code from scif_register() before storing it to a permanent “off_t” field. The value got truncated to “0” and subsequently passed to scif_writeto().
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page