From b2063953baeb01f5bd7eb8efd2e319b3f9cfaec2 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Mon, 26 Nov 2012 19:49:54 +0100 Subject: [PATCH] Added a configuration option, UIP_SPLIT_CONF_SIZE, for setting the threshold at which point TCP packets get split into two. --- core/net/uip-split.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/net/uip-split.c b/core/net/uip-split.c index cbcc48e15..4d247e478 100644 --- a/core/net/uip-split.c +++ b/core/net/uip-split.c @@ -43,6 +43,12 @@ #define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) +#ifdef UIP_SPLIT_CONF_SIZE +#define UIP_SPLIT_SIZE UIP_SPLIT_CONF_SIZE +#else /* UIP_SPLIT_CONF_SIZE */ +#define UIP_SPLIT_SIZE UIP_TCP_MSS +#endif /* UIP_SPLIT_CONF_SIZE */ + /*-----------------------------------------------------------------------------*/ void uip_split_output(void) @@ -50,9 +56,11 @@ uip_split_output(void) #if UIP_TCP uint16_t tcplen, len1, len2; - /* We only try to split maximum sized TCP segments. */ + /* We only split TCP segments that are larger than or equal to + UIP_SPLIT_SIZE, which is configurable through + UIP_SPLIT_CONF_SIZE. */ if(BUF->proto == UIP_PROTO_TCP && - uip_len == UIP_TCP_MSS + UIP_TCPIP_HLEN) { + uip_len >= UIP_SPLIT_SIZE + UIP_TCPIP_HLEN) { tcplen = uip_len - UIP_TCPIP_HLEN; /* Split the segment in two. If the original packet length was