lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] RE: [lwip-users] LWIP 130RC1 and Socket - Application recei


From: Bill Auerbach
Subject: [lwip-devel] RE: [lwip-users] LWIP 130RC1 and Socket - Application receive morepacket than it can manage - what does it happen?
Date: Mon, 25 Feb 2008 08:53:09 -0500

Maybe others will agree, but I think you should use lwip-users for these queries and not both –user and –devel.

 

I can confirm if you don’t have free pbufs in your low-level ethernetif handler, you can return NULL and drop the packet.  I used a low number of pbufs and sent lwIP an 8MB chunk of data (TCP) and all data was received. However, I am not using tcpip and threads and have NO_SYS=1.  I poll lwIP in my main program loop and use lwIP callbacks to handle incoming data.  I doubt that this matters since ethernetif is at a lower level.

 

Bill

 


From: address@hidden [mailto:address@hidden On Behalf Of Piero 74
Sent: Monday, February 25, 2008 8:43 AM
To: Mailing list for lwIP users; lwip-devel
Subject: [lwip-users] LWIP 130RC1 and Socket - Application receive morepacket than it can manage - what does it happen?

 

Hi all.

I'll use in my application socket. I'll use UPD connection and TCP connection for receiving packets.

I have limited buffers in my application, because i have few RAM available.
I saw that setting some lwip options, i can limit packet queueing, pbuf used (i don't know how.. i have to try) and limit memory available for lwip stack.

My question is:

if my application tasks cannot consume all packet received from the network, because has all buffers full, what does it happen? lwip will crash my application? or it will drop udp packet and kill tcp connections?

My emac driver send packet to tcp_ip thread if present.... i could drop packet in the low level side, but driver need to know when drop packet and when pass packet to tcpip thread...
can i know this information in some way???

in my ethernetif implementation (low_level_input), if packet is present, i do this:

 ....
  /* We allocate a pbuf chain of pbufs from the pool. */
  p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
 
  if (p != NULL) {
 ....
 } else {
    // Drop packet because no free pbuf available
    endReadFrame(0);
   
    LINK_STATS_INC(link.memerr);
    LINK_STATS_INC(link.drop);
  }
...


I suppose (please CONFIRM):

if lwip has no memory free DOESN'T crash application
BUT pbuf_alloc will reurn NULL until pbufs will free.
SO, application CAN CONSUME packets slower than network produces them, because low_level_input  will drop some packets.

I saw in lwip code that calls to sys_mbox_trypost avoid lwip blocks if mailboxes are full, and free pbufs (SO... drop packets... IS IT RIGHT???)

again.... if lwip has no memory free DOESN'T crash application ???

Someone can discuss with me about this issues?


thanks,
Piero


reply via email to

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