Skip to content

Commit 64620e2

Browse files
committed
lwip: Stop dropping long TCP segments
If lwIP placed more than 2 pbufs in a TCP segment, the ethernet driver would fail to send it as it didn't have enough Tx descriptors. The maximum number of pbufs outstanding for transmit that lwIP keeps is defined by the TCP_SND_QUEUELEN macro. I modifed the value of LPC_NUM_BUFF_TXDESCS to take advantage of this lwIP value. The +1 takes into account that LPC_EMAC->TxProduceIndex == LPC->TxConsumeIndex is reserved for indicating that the queue is empty so a full queue uses one less than the maximum count.
1 parent 692cbd1 commit 64620e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/net/eth/lwip-eth/arch/lpc_emac_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extern "C"
8686
/** \brief Defines the number of descriptors used for TX. Must
8787
* be a minimum value of 2.
8888
*/
89-
#define LPC_NUM_BUFF_TXDESCS 3
89+
#define LPC_NUM_BUFF_TXDESCS (TCP_SND_QUEUELEN + 1)
9090

9191
/** \brief Set this define to 1 to enable bounce buffers for transmit pbufs
9292
* that cannot be sent via the zero-copy method. Some chained pbufs

0 commit comments

Comments
 (0)