Re: Memory leak when receiving from NDISWAN

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Benoît Bousquet wrote:
> The issue I'm having is that, when receiving packets from NDISWAN,
NonPaged
> memory gets eaten, 4K at a time. I'll summarize what the code path
looks
> like:

In the code snippets you seem to always call NdisDprFreePacket() on the
just allocated packets.

You must not free such packets as long as they are in use by other
networking components. That is, when you pass a newly allocated packet
to either NdisMIndicateReceivePacket() or NdisSend(), you must wait
until that packet is returned to you via either MiniportReturnPacket()
or NdisMSendComplete(), respectively.

The only exceptions to this rule are:

1. ..if you set the packet's Status to NDIS_STATUS_RESOURCES before
indicating up the packet descriptor.

2. ..if NdisSend() returns anything else but NDIS_STATUS_PENDING.

Please see the DDK docs for details.

Stephan

.



Relevant Pages

  • Re: 2.6.24-rc6-mm1 - git-lblnet.patch and networking horkage
    ... These local packets also need to ... that code path the packet is cloned and due to a problem in skb_clone ... original skb to the cloned skb. ... Clear all of the cloned skb fields in skb_clonevia memset ...
    (Linux-Kernel)
  • Re: Spoofing multicast addresses
    ... [freebsd-net added] ... } Subject: Re: Spoofing multicast addresses ... connections and it wasteful to do unnecessary checking on these packets. ... Optimising the most frequently used code path leaves more CPU cycles ...
    (FreeBSD-Security)
  • Re: Spoofing multicast addresses
    ... >> that it gets them out of the main code path. ... >> connections and it wasteful to do unnecessary checking on these packets. ... > if we're under attack? ... Does anyone have an idea on what the performance impact of the multicast ...
    (FreeBSD-Security)
  • Re: net.inet.ip.forwarding and net.inet.ip.fastforwarding
    ... forward packets more quickly than the default code path. ... for the computer acting as a router before forwarding the packet. ...
    (freebsd-net)
  • NdisSend not working for WAN Packets : Solution ???
    ... Driver and find that with the LAN card sending packets is not an issue ... stop going out on the wire(I am using NdisSend). ... And if i register WAN Medium, how do the Ethernet packets go? ...
    (microsoft.public.development.device.drivers)