Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - memory leak in io-net with pq2fads Ethernet driver: (4 Items)
   
memory leak in io-net with pq2fads Ethernet driver  
Hi,

I am using QNX 630 (SP1) for my application on PPC 8260 target.
The LAn driver is based on pq2fads BSP.
I found a continuos drop in network packets on receive.
Found a leak in io-net also even though there is no mismatch of open / close sockets.
see the log below.

PPC 8260 Ethernet Controller

  Physical Node ID ........................... 000000 000000
  Current Physical Node ID ................... 000705 000FE0
  Current Operation Rate ..................... 100.00 Mb/s full-duplex
  Active Interface Type ...................... MII
    Active PHY address ....................... 1
  Maximum Transmittable data Unit ............ 1514
  Maximum Receivable data Unit ............... 1514
  Hardware Interrupt ......................... 0x22
  Promiscuous Mode ........................... Off
  Multicast Support .......................... Enabled

  Packets Transmitted OK ..................... 469469
  Bytes Transmitted OK ....................... 166867504
  Broadcast Packets Transmitted OK ........... 76
  Multicast Packets Transmitted OK ........... 0
  Memory Allocation Failures on Transmit ..... 0

  Packets Received OK ........................ 501796
  Bytes Received OK .......................... 37016282
  Broadcast Packets Received OK .............. 50322
  Multicast Packets Received OK .............. 0
  Memory Allocation Failures on Receive ...... 0

  Single Collisions on Transmit .............. 0
  Deferred Transmits ......................... 0
  Late Collision on Transmit errors .......... 0
  Transmits aborted (excessive collisions) ... 0
  Transmit Underruns ......................... 0
  No Carrier on Transmit ..................... 0
  Receive Alignment errors ................... 0
  Received packets with CRC errors ........... 0
  Packets Dropped on receive ................. 87
  Oversized Packets received ................. 0
  Short packets .............................. 0


Why the network packets are getting dropped.?
What could be the reason for leak in io-net memory.?
RE: memory leak in io-net with pq2fads Ethernet driver  
> Packets Dropped on receive ................. 87

This occurs when the driver tries to replace a filled
packet in the receive descriptor ring with an empty
one (so it can pass the filled rx packet up) but it
is unable to allocate a new packet.

So, what it does is leave the original packet in
the rx descriptor ring - it's data is lost - and
it tells the nic to write to it again.

Most of the time, when there is an io-net memory
leak, it is usually a driver bug - some corner case 
is not being handled well.  I took a peek at the
source for the usual suspects during rx and tx
and nothing immediately jumped out at me.

The io-net infrastructure and protocols have a lot 
more miles on them than some of the drivers.

Btw, what is your pidin mem output for io-net?  How
do you know you really have a memory leak?  This
driver will hoard some packets for max performance
on the rx side, so I would expect it to allocate some 
npkts at first, and then it's memory footprint to 
settle down after a while.

--
aboyd
RE: memory leak in io-net with pq2fads Ethernet driver  
Hi,

The packets are dropped when a frame is received and discarded due to a lack of buffers.(BUSY CONDITION always.)
Why is it so?
What could be the reason?
And the pidin mem shows there is continues increase in io-net data memory.



Regards,
Soujanya Yelchuri
-----Original Message-----
From: Andrew Boyd [mailto:community-noreply@qnx.com] 
Sent: Monday, July 27, 2009 7:03 PM
To: drivers-networking
Subject: RE: memory leak in io-net with pq2fads Ethernet driver


> Packets Dropped on receive ................. 87

This occurs when the driver tries to replace a filled
packet in the receive descriptor ring with an empty
one (so it can pass the filled rx packet up) but it
is unable to allocate a new packet.

So, what it does is leave the original packet in
the rx descriptor ring - it's data is lost - and
it tells the nic to write to it again.

Most of the time, when there is an io-net memory
leak, it is usually a driver bug - some corner case 
is not being handled well.  I took a peek at the
source for the usual suspects during rx and tx
and nothing immediately jumped out at me.

The io-net infrastructure and protocols have a lot 
more miles on them than some of the drivers.

Btw, what is your pidin mem output for io-net?  How
do you know you really have a memory leak?  This
driver will hoard some packets for max performance
on the rx side, so I would expect it to allocate some 
npkts at first, and then it's memory footprint to 
settle down after a while.

--
aboyd




_______________________________________________

Networking Drivers
http://community.qnx.com/sf/go/post34611


RE: memory leak in io-net with pq2fads Ethernet driver  
> The packets are dropped when a frame is received and 
> discarded due to a lack of buffers.  Why is it so?

The driver has used up all of it's internal cache
of npkts, and has asked io-net for another npkt,
and io-net did not return one.

> What could be the reason?

What is the output of "pidin in"?  Is all of the
memory in use?

> the pidin mem shows there is continues increase 
> in io-net data memory.

Is this with a trickle of data, or with heavy data
flow?  With heavy data flow, io-net should quickly 
grow from it's initial size to it's final size, and 
should stay pretty much there.

But with a trickle of data, io-net's memory will
slowly grow to it's maximum - assuming there is 
no real leak.

--
aboyd