lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] RE: [lwip] who/what frees pbufs on output


From: Steve Langstaff
Subject: [lwip-users] RE: [lwip] who/what frees pbufs on output
Date: Thu, 09 Jan 2003 00:31:03 -0000

We've implemented a scheme where the driver is responsible for
freeing the pbuf... Our ethernet driver queues pbufs for later
transmission rather than copying the data from the pbuf into a
local driver buffer (to avoid data copying where possible).

This is OK (and fast) for UDP and ICMP (with a few modifications)
but is not so good for TCP since tcp_output()'s freeing of the
pbuf can have dire consequences (coz' the driver is still using
it!), so we're having to do the data copy at the tcp_output() stage.

In lwip-0.5.3 tcp_output_segment() was/is even more tricky, because
it actually modifies the pbuf AFTER ip_output() is called... that
caught us for a while!

--
Steve Langstaff.


-----Original Message-----
From: Kieran Mansley [mailto:address@hidden
Sent: 04 October 2002 11:50
To: address@hidden
Subject: Re: [lwip] who/what frees pbufs on output


On Fri, 4 Oct 2002, Dirk Koopman wrote:

> I remain somewhat confused as to where a pbuf that is output is freed.
>
> Is it after the tcp/udp_send at application level, or is it in the
> netif->output(....) routine?

tcp_output(), just after the call to ip_output()

> I ask this because ICMP echo seems to accept incoming pings, massages
> the pbuf a bit to return it, then sends it back. The problem is that,
> currently, I can't see where the pbuf used is freed.

ICMP could well be bypassing the above, so you could have found a leak.
I'm not sure how well tested ICMP is.

Kieran

[This message was sent through the lwip discussion list.]
[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]