[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] lwipopts: TX_SINGLE_PBUF
From: |
David Gauchard |
Subject: |
Re: [lwip-users] lwipopts: TX_SINGLE_PBUF |
Date: |
Sat, 21 Oct 2017 01:51:41 +0200 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
> The whole point of LWIP_NETIF_TX_SINGLE_PBUF was that the stack tries to do
> its best.
> A driver should still be prepared to get chained pbufs and copy them into one
> piece.
>
> LWIP_NETIF_TX_SINGLE_PBUF should be a performance optmization to e.g. prevent
> copying
> data into a chained pbuf when we know it has to be copied again later to
> create a pbuf
> in one piece. Where this doesn't hurt much, I don't currently see a problem
> to make the
> driver do this.
>
> You should be able to just use pbuf_clone() if p->next != NULL.
I understand now after reading the source code, that pbuf_clone() will gather
any "fragmented" puf into one piece.
Is there any guarantee that MSS is not exceeded in the copy ?
Or is it useless to ask, because MSS is never exceeded in any pbuf chain ?
Which would makes sense because pbuf stands for PacketBUFfer and a packet
size cannot exceed ~MSS.
Thanks for making lwIP available and maintaining it :)