net/iface: Coalesce all DAD timers through one

This reduces the size of struct net_if_addr by 24 bytes by moving
the k_delayed_work attribute into net_if core code.
Then each net_if_addr can be added to the timer handler via a slist.

This does not make much gain if the system has only 1 unicast IPv6
address. It's a nice memory improvment once it has 2+ unicast IPv6
address. Note that having IPv4 enabled along with IPv6 will also see
memory improvements since both IPv6 and IPv4 use the same struct
net_if_addr.

Fixes #8728

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2019-05-21 11:12:45 +02:00 committed by Jukka Rissanen
commit 09e7262be8
2 changed files with 64 additions and 27 deletions

View file

@ -56,7 +56,8 @@ struct net_if_addr {
#if defined(CONFIG_NET_IPV6_DAD)
/** Duplicate address detection (DAD) timer */
struct k_delayed_work dad_timer;
sys_snode_t dad_node;
u32_t dad_start;
#endif
/** How the IP address was set */
enum net_addr_type addr_type;