]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
lib/lwip: Reserve per netdev space for lwip
authorSharan Santhanam <sharan.santhanam@neclab.eu>
Tue, 21 Jul 2020 15:32:44 +0000 (17:32 +0200)
committerSimon Kuenzer <simon.kuenzer@neclab.eu>
Mon, 3 Aug 2020 16:54:06 +0000 (18:54 +0200)
Reserves space for per-network-device (uknetdev). This will be later
used to store network stack specific specific information in the netdevice.
Reserving this memory allows us to store the memory continuously in the
netdev instead of additional dereferences.

Signed-off-by: Sharan Santhanam <sharan.santhanam@neclab.eu>
Reviewed-by: Hugo Lefeuvre <hugo.lefeuvre@neclab.eu>
Config.uk
Makefile.uk

index aaaaae02d90cfd020cfd8b8a9aef35d1e4fc10f9..e2eacb53e91cab9b12b530600b76e42fdccc5ce5 100644 (file)
--- a/Config.uk
+++ b/Config.uk
@@ -22,6 +22,15 @@ config LWIP_UKNETDEV
                In case threaded mode is selected and the underlying device
                driver does not support receive interrupts the network
                interfaces have to be polled manually (uknetdev_poll()).
+
+config LWIP_UKNETDEV_SCRATCH
+       int
+       default 32
+       help
+               The network stack reserves space in the uknetdev device for its
+               use. Please do not change this value and in case change this
+               value please make sure it is sufficient enough to hold the
+               lwip_netdev_data data structure.
 endmenu
 
 config LWIP_AUTOIFACE
index d3c6c9c8334facf80824a66839c46ae2f9847060..99005a9ab77356e742bde45ca7077dc185848632 100644 (file)
@@ -62,6 +62,7 @@ LIBLWIP_COMMON_INCLUDES-y += -I$(LIBLWIP_BASE)/musl-imported/include
 LIBLWIP_COMMON_INCLUDES-y += -I$(LIBLWIP_EXTRACTED)/include
 CINCLUDES-$(CONFIG_LIBLWIP)   += $(LIBLWIP_COMMON_INCLUDES-y)
 CXXINCLUDES-$(CONFIG_LIBLWIP) += $(LIBLWIP_COMMON_INCLUDES-y)
+$(eval $(call uknetdev_scratch_mem,$(CONFIG_LWIP_UKNETDEV_SCRATCH)))
 
 ################################################################################
 # Library flags