This makes a couple of simple re-arrangements in lwip_selscan() that
should improve performance in the following ways:
1) The old code linearly walked all sockets to maxfd regardless of
whether they were set in the fd set. The process involved
acquiring sys arch protect, looking up the socket, and then
checking if the socket was present in any of the fd sets. On
systems with lots of sockets and a heavy SYS_ARCH_PROTECT
infrastructure (a mutex) this can result in a lot of extra work.
Now we skip this process for any fd that is not in the input sets
2) If the socket from tryget_socket() is NULL we no longer continue
and compare the input fd sets with a zeroed out set of events
3) We no longer need to zero out our event sets because they are
only accessed when tryget_socket() is successful
lwip_selscan() is called at most once per select call and sometimes up to three times
sign_extension: Suspicious implicit sign extension: count with type unsigned short (16 bits, unsigned) is promoted in count * size to type int (32 bits, signed), then sign-extended to type unsigned long (64 bits, unsigned). If count * size is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
The usages of memp_names are under either LWIP_DEBUG in stats_init,
or under LWIP_STATS_DISPLAY in stats_display_memp.
Fix below build warning:
lwip/src/core/stats.c:53:21: error: 'memp_names' defined but not used [-Werror=unused-variable]
static const char * memp_names[] = {
^
cc1: all warnings being treated as errors
Reported-by: David Fernandez
Fixes: 2f2a75a6d9fd ("stats: Move memp_names table out of stats_init/stats_display_memp functions")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This was missed in commit aa0e41c389
("task #12178: hardware checksum capabilities can be configured per netif"),
fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
We used to modify in place the packet payload during compression but TCP
stack requires that we don't change the packet payload, therefore we now
copy the whole packet before compression.
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Prepare for VJ packet copy, reorder a bit VJ compressor so all TYPE_IP
return value are within the same code block. We do that because we don't
need to copy the packet if we are not able to compress it.
Signed-off-by: Sylvain Rochet <gradator@gradator.net>