lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] [bug #49218] pbuf_clen() overflow as a result of tcp_wr


From: Dirk Ziegelmeier
Subject: Re: [lwip-devel] [bug #49218] pbuf_clen() overflow as a result of tcp_write concatenation
Date: Fri, 30 Sep 2016 12:54:52 +0200

I still don't understand why you do that. You need to get a pbuf_ref from somewhere, initialize it, append it to the pbuf chain, in case of sending iterate through that chain to create a consecutive buffer for the MAC (=copy the data), dechain the pbuf and put it back into some pbuf pool.
This is more effective/faster than just copying around a few bytes and increasing the pbuf->len/tot_len?

Dirk

On Fri, Sep 30, 2016 at 12:45 PM, David van Moolenbroek <address@hidden> wrote:
Follow-up Comment #6, bug #49218 (project lwip):

> And that was my point: I don't expect you have a scatter-gather-MAC that
supports TX frames with that many chunks. Being like that, you probably end up
copying all bytes per CPU anyway. Thus, I don't see the advantage of doing it
with ref pbufs. On the contrary, it's probably less performant.

That is correct, and that is the other side of why I think the ideal solution
is to merge multiple consecutive buffer-local references. In that case we do
eliminate an extra memory copy for all data in such circumstances, while
keeping the number of chunks very low. As such I'll most probably be adding
support for that locally in any case. If you think that is (in principle)
something that is worthwhile might also be merged into lwIP itself, I'd be
happy to make a proper patch out of it and submit it..

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?49218>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



reply via email to

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