[PATCH v4 02/14] net: introduce alternative implementation as net-lwip/

Jerome Forissier jerome.forissier at linaro.org
Wed Jun 19 11:06:39 CEST 2024



On 6/18/24 19:59, Tom Rini wrote:
> On Mon, Jun 17, 2024 at 05:32:54PM +0200, Jerome Forissier wrote:
> 
>> Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by
>> adding a new net-lwip/ directory and the NET_LWIP symbol. Network
>> support is either NO_NET, NET (legacy stack) or NET_LWIP. Subsequent
>> commits will introduce the lwIP code, re-work the NETDEVICE integration
>> and port some of the NET commands and features to lwIP.
>>
>> SPL_NET cannot be enabled when NET_LWIP=y. SPL_NET pulls some symbols
>> that are part of NET (such as arp_init(), arp_timeout_check(),
>> arp_receive(), net_arp_wait_packet_ip()). lwIP support in SPL may be
>> added later.
>>
>> Similarly, DFU_TFTP and FASTBOOT are not compatible with NET_LWIP
>> because of dependencies on net_loop(), tftp_timeout_ms,
>> tftp_timeout_count_max and other NET things. Let's add a dependency on
>> !NET_LWIP for now.
>>
>> As for SANDBOX, NET_LWIP cannot be used either because of strong
>> assumptions on the network stack. Make NET_LWIP depend on !SANDBOX so
>> that the NET_LWIP alternative is not visible in make menuconfig when
>> sandbox_defconfig is used.
> [snip]
>> diff --git a/Kconfig b/Kconfig
>> index 82df59f176e..cfe2a6d3eac 100644
>> --- a/Kconfig
>> +++ b/Kconfig
>> @@ -745,7 +745,48 @@ source "dts/Kconfig"
>>  
>>  source "env/Kconfig"
>>  
>> +choice
>> +	prompt "Networking stack"
>> +	default NET
>> +
>> +config NO_NET
>> +	bool "No networking support"
>> +
>> +config NET
>> +	bool "Legacy U-Boot networking stack"
>> +	imply NETDEVICES
>> +
>> +config NET_LWIP
>> +	bool "Use lwIP for networking stack"
>> +	imply NETDEVICES
>> +	depends on !SANDBOX
>> +	help
>> +	  Include networking support based on the lwIP (lightweight IP)
>> +	  TCP/IP stack (https://nongnu.org/lwip). This is a replacement for
>> +	  the default U-Boot network stack and applications located in net/
>> +	  and enabled via CONFIG_NET as well as other pieces of code that
>> +	  depend on CONFIG_NET (such as cmd/net.c enabled via CONFIG_CMD_NET).
>> +	  Therefore the two symbols CONFIG_NET and CONFIG_NET_LWIP are mutually
>> +	  exclusive.
>> +
>> +endchoice
> 
> For ease of reviewability the next patch in the series should change all
> of the configs with '# CONFIG_NET is not set' to 'CONFIG_NO_NET=y' so
> that they functionally don't change. It's 105 files and so while it will
> be folded in when lwIP is ready for merge, keeping it separate for now
> will make review easier.

OK, done in v6.

Thanks,
-- 
Jerome


More information about the U-Boot mailing list