Re: Direct Copying To Share Memory In NDIS ProtocolReceive

Tech-Archive recommends: Fix windows errors by optimizing your registry



On #1 think seriously about having the prime application sending a request,
that can be pended. If the request is ever canceled your driver will know
the prime application is in trouble.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Le Chaud Lapin" <jaibuduvin@xxxxxxxxx> wrote in message
news:1172867110.993388.179570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Don, thanks for tips..

1. If you create the section in the driver, you need to know when to
delete the section. Relying on the application to do this is a security
hole since the application can easily exit or be killed.

I am essentially creating from user-mode. My Prime application that
loads the driver must follows a LIFO model with the driver, so if it
ever occurs that the driver is loaded and the Prime application is
not, something is seriously wrong (restart of application). In that
case, I would not mind that the driver is holding on to the zombie
section, and writing too it. I will probably design it so that a
restart of the application will unload and reload the driver.

2. You say you want to use the section for both sends and recieves?
Why
sends, since there is no copy overhead here. Keep it simple, and just
do
the sends directly, even if they are sending packets recieved into the
section.

That's just it, the "direct" sends will 100% of the time be from
frames stored in the section. In other words, when the prime
application sends, the transmitted frames are already in the shared
section. For my application, there is never a situation where an
application has a free-floating buffer that needs to be sent to the
driver. I know there are many people who probably want to do this
(but not like NDISPROT did it), but I have no use of it for now.

3. You talk about using a semaphore to coordinate the processes. This
is
going to drag performance down to the level, that you are probably not
gaining an advantage. Consider, using interlocked operations in the
section, and minimizing the use of semaphores.

Hmm...interesting. I was using a semaphore because the user-mode
components do need to block if they attempt to acquire a frame from
the shared section and none are available because they are all being
used.

But your point gives me an idea....since I do have shared section that
is visible by all applications and drivers, I can still use the
semaphore, but preced it with use of type of spin-lock to increase
performance on lowering the semaphore to acquire frames.

-Le Chaud Lapin-



.



Relevant Pages

  • Re: [RFC 0/1] lro: Generic Large Receive Offload for TCP traffic
    ... have the eHEA driver for the SKB interface, ... set in the skb header and passed up the stack. ... either strip padding from frames or reject padded frames. ... I'd suggest to reject padded frames for aggregation as we do now ...
    (Linux-Kernel)
  • Re: Direct Copying To Share Memory In NDIS ProtocolReceive
    ... loads the driver must follows a LIFO model with the driver, ... frames stored in the section. ... going to drag performance down to the level, ... I was using a semaphore because the user-mode ...
    (microsoft.public.development.device.drivers)
  • Re: [Security, resend] Instant crash with rtl8169 and large packets
    ... network switch can handle jumbo frames). ... doing the ping test with the above change (no more large packets were ... When this driver queues a skb in rx queue, it tells NIC the max size ... issue with these NICs -- the famous, ...
    (Linux-Kernel)
  • Re: Please open sysfs symbols to proprietary modules
    ... > certain frames in a special way, just like BPDU frames are handled if ... Why don't you just GPL your driver? ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: VRM9 and D3DPRESENT_INTERVAL_ONE
    ... The reason I guess that the driver buffers all Direct X drawing calls upto ... several frames in advance, ... Only some direct 3d / hardware driver guys could help. ... > video thread or from my 3D loop thread. ...
    (microsoft.public.win32.programmer.directx.video)