[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] [lwip] free-ing of pbufs in netif->output function: who's
From: |
Lieverse, Paul |
Subject: |
[lwip-users] [lwip] free-ing of pbufs in netif->output function: who's responsible? |
Date: |
Thu, 09 Jan 2003 00:25:21 -0000 |
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--------------InterScan_NT_MIME_Boundary
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C1C11F.BD106600"
------_=_NextPart_001_01C1C11F.BD106600
Content-Type: text/plain
Hi,
I was wondering how the pbuf management in the netif drivers should work.
To be more precise: should the drivers do a pbuf_free on the pbufs that they
get passed, or only on the pbufs they allocate themselves? (Currently,
neither
is done, which is, as far as I can see, wrong anyway).
>From the code I understand that:
1) TCP/UDP code passes a pbuf pointer to ip_output
2) ip_ouput passes this pointer to the netif output function
3) eventually, it will be passed to some low_level_output function.
Now who is responsible for a pbuf that has been sent out?
Some observations:
*) tcp_output() and tcp_rst() do a pbuf_free after ip_output()
*) tcp_output_segment() and tcp_rexmit_seg() don't do a pbuf_free
*) udp_send() doesn't do a pbuf_free either
And to make things more complicated:
*) In several functions (e.g. in the netif output functions) some extra pbuf
is allocated and chained at the head of the given pbuf. Noone
seems to be free-ing those.
So, am I correct that some memory may be leaking here, or am I really
missing something?
Paul
------_=_NextPart_001_01C1C11F.BD106600
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>free-ing of pbufs in netif->output function: who's
responsible?</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I was wondering how the pbuf management in the
netif drivers should work.</FONT>
<BR><FONT SIZE=2 FACE="Arial">To be more precise: should the drivers do a
pbuf_free on the pbufs that they</FONT>
<BR><FONT SIZE=2 FACE="Arial">get passed, or only on the pbufs they allocate
themselves? (Currently, neither</FONT>
<BR><FONT SIZE=2 FACE="Arial">is done, which is, as far as I can see, wrong
anyway).</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">From the code I understand that:</FONT>
<BR><FONT SIZE=2 FACE="Arial">1) TCP/UDP code passes a pbuf pointer to
ip_output</FONT>
<BR><FONT SIZE=2 FACE="Arial">2) ip_ouput passes this pointer to the netif
output function</FONT>
<BR><FONT SIZE=2 FACE="Arial">3) eventually, it will be passed to some
low_level_output function.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Now who is responsible for a pbuf that has been
sent out?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Some observations:</FONT>
<BR><FONT SIZE=2 FACE="Arial">*) tcp_output() and tcp_rst() do a pbuf_free
after ip_output()</FONT>
<BR><FONT SIZE=2 FACE="Arial">*) tcp_output_segment() and tcp_rexmit_seg()
don't do a pbuf_free</FONT>
<BR><FONT SIZE=2 FACE="Arial">*) udp_send() doesn't do a pbuf_free either</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">And to make things more complicated:</FONT>
<BR><FONT SIZE=2 FACE="Arial">*) In several functions (e.g. in the netif output
functions) some extra pbuf</FONT>
<BR><FONT SIZE=2 FACE="Arial"> is allocated and chained at the head
of the given pbuf. Noone</FONT>
<BR><FONT SIZE=2 FACE="Arial"> seems to be free-ing those.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">So, am I correct that some memory may be leaking
here, or am I really</FONT>
<BR><FONT SIZE=2 FACE="Arial">missing something?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Paul</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C1C11F.BD106600--
--------------InterScan_NT_MIME_Boundary--
[This message was sent through the lwip discussion list.]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] [lwip] free-ing of pbufs in netif->output function: who's responsible?,
Lieverse, Paul <=