Pbuf alloc size

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pbuf alloc size

Kjel Snorre Jahrus
Hello,

I am trying to implement the lwIP on my platform and I noticed that the app works when I am allocating netif->mtu+14 bytes to the newly created pbuf in the low_level_input function but it doesn't if I allocate the size of the currently received frame.

Can you please tell me if that is normal or I am doing something wrong?

Best regards,
Kjel Snorre

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Pbuf alloc size

Kieran Mansley

On 10 Aug 2012, at 11:59, Kjel Snorre Jahrus wrote:

> Hello,
>
> I am trying to implement the lwIP on my platform and I noticed that the app works when I am allocating netif->mtu+14 bytes to the newly created pbuf in the low_level_input function but it doesn't if I allocate the size of the currently received frame.

14 is the size of the ethernet header.  The MTU should include the ethernet header though.

Kieran
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Pbuf alloc size

Kjel Snorre Jahrus
Hey there,

My problem is not the actual 14 extra bytes that I am allocating but the fact that for each received package I am allocating mtu(1500) bytes, instead of the size of the received frame which might be 60 bytes for example.

Best regards,
Kjel Snorre

On Sat, Aug 11, 2012 at 8:28 PM, Kieran Mansley <[hidden email]> wrote:

On 10 Aug 2012, at 11:59, Kjel Snorre Jahrus wrote:

> Hello,
>
> I am trying to implement the lwIP on my platform and I noticed that the app works when I am allocating netif->mtu+14 bytes to the newly created pbuf in the low_level_input function but it doesn't if I allocate the size of the currently received frame.

14 is the size of the ethernet header.  The MTU should include the ethernet header though.

Kieran
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users