net: ip: Allow user to select number of network contexts

The network context is similar concept as network socket.
Depending on application use, the number of contexts can be
now tweaked. Default value is now 2, it was 5 earlier. Using
the lower number saves 241 bytes of memory.

Change-Id: I6e2a9f053c8c63163af6d6175783233f67553ae9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2016-05-26 12:08:37 +03:00
commit e56f701a04
2 changed files with 11 additions and 1 deletions

View file

@ -71,6 +71,14 @@ config IP_TIMER_STACK_SIZE
responsible for handling re-transmissions and periodic network
packet sending like IPv6 router solicitations.
config NET_MAX_CONTEXTS
int "How many network context to use"
default 2
help
The network context is similar concept as network socket.
It defines a network endpoint and number of context depends
on application usage.
choice
prompt "Internet Protocol version"
depends on NETWORKING

View file

@ -80,7 +80,9 @@ struct net_context {
};
/* Override this in makefile if needed */
#ifndef NET_MAX_CONTEXT
#if defined(CONFIG_NET_MAX_CONTEXTS)
#define NET_MAX_CONTEXT CONFIG_NET_MAX_CONTEXTS
#else
#define NET_MAX_CONTEXT 5
#endif