Sharing memory between kernel and user mode program

And thanks Jamey, I’m currently working on the solution you’ve pointed out, yesterday night I was too cooked to get something written good and understand what I needed to do. Yesterday I’d worked from 6 AM to 11 PM and maybe I’ve gone over my physical limits.

>>> And calling an IOCTL will have the same overhead.
Yes I know it will have the same overhead, but I can prepare all the packets, and then send a sync IOCTL; i.e. I prepare 4096 packets and send 1 ioctl to say to sync the structures: I don’t need to send 4096 IOCTLs, right?

xxxxx@gmail.com wrote:

I’ve tested the system and it can archieve 70 Gbit/s with 1500-byte frames generated randomly. This is the max performance it can reach between 2 user mode programs in the same machine.

When two user mode programs on the same machine do socket I/O, no
hardware and no drivers are involved. It is a simple memory-to-memory
transfer. Thus, these numbers are meaningless.

What, exactly, is your hardware? Is it a network device? What kind of
network? Fiber? Gigabit? Fibrechannel? RocketIO?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

It’s a 10 Gbit ethernet. I know that without involving hardware is just mem-to-mem exchange but the architecture must work for hardware device and for memory to memory programs, and with IOCTL I cannot archieve the performance needed.

Said that, I kinda solved the problem, Now I can exchange memory between user processes I’ve done this


PVOID virtualAddress = NULL;

ZwMapViewOfSection(hsection, //SectionHandle
(HANDLE)-1, //ProcessHandle
&virtualAddress, //BaseAddress
0L, //ZeroBits
MEM_WIDTH, //CommitSize
NULL, //SectionOffset
&view_size, //ViewSize
ViewShare, //InheritDisposition
0, //AllocationType
PAGE_READWRITE | PAGE_NOCACHE); //Win32Protect

without using a memory previously allocated by ExAllocatePoolWithTag(…)

Now I just have to figure out how to lock the memory to be non pageable and the problem will be solved.
Thanks everyone for the help you gave me,

Sincerely,

-Alessio

xxxxx@gmail.com wrote:

It’s a 10 Gbit ethernet.

Then I hope you understand that you’ll never need to handle more than
1.3 GB/s.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I know, it’s line rate (in fact 1.3 it’s more than line rate); but with multiple NICs I can go easily over; and can came out the need to inspect the packets inside the machine before letting them out.
Not mentioning that the program must be ready for NICs that will go beyond 10 GbE.