From patchwork Wed Aug 2 14:06:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 709164 Delivered-To: patch@linaro.org Received: by 2002:a5d:55c5:0:b0:317:2194:b2bc with SMTP id i5csp930370wrw; Wed, 2 Aug 2023 07:09:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZKois/Daa8q1/f/DUfac8k05K7mt/iGZQtQ6L6QKNzO8YSYeCXBcUfxi7DK4S1KL+u+sI X-Received: by 2002:a1c:6a0a:0:b0:3f7:3699:c294 with SMTP id f10-20020a1c6a0a000000b003f73699c294mr4923667wmc.29.1690985363556; Wed, 02 Aug 2023 07:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690985363; cv=none; d=google.com; s=arc-20160816; b=QOcjCBsc/kQtTil0bYwpOxACo/AnLSJ3q4GbYs5447FKsq1++nt7IzAPKvdwIZ9iyY VVWBrKH5nPh7a9J/jxbUaHimWSPLxTkIpqpqwCethJJt6cYWCup7crhhhrzCtQNW5XdK GT+bbhL1SbxbtuVncdlU4UOreRzEmlyZBwo3vc1JE/YYNq0amnq2gU+Mg8QPE963E/Gl SqQqxnY80wUVxzSDO4pPHRmBJCFomVGR2+bDLr/GJajccEZwK2Q3olfYPcETa4S5zd/E 2W89l1og8bXkb2F2Uzzw+925jJh6Aq2/PH3x2iwmph7MdKSy3nzAVgwgk4Zc6sbG70C5 qF+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=LUxM3UqYAPwo9oLKd6ioOKz1YPMGyv+S4nvNyauSCco=; fh=KONqw1VFBW9nCv9imase+52c+XJ0MeVkzLj6SOLcJqQ=; b=FZMAI61urqTK7zT8L38q5fsCikJ0KzrwA0W4fsSp9L5OAp8PrNSHw2x0tEle/g6GKl +cO5QIFE8VrxxUzAA9T5SdbYY8He2SDi2vt4Xv8KWjuQcVx8LZA3UBHAXq8FoHOzI0FZ GHA/yebHG953ldFnpFUJRs6DP7k713RjJRKwAfp1ZBDDakPzLDoleVWr9WSm13RaiYM8 18WXSpCbmYu9KKnw2EbX6jA7kADYHcOqxX0HefJB9fnQJB4Vckqx6NZJwI3vIZvn0w4a 6JKHHpiCegtIVpb8bAE63twZwKnkGkfRMAje7H48sJYu0fNYKBti8QffTYWxldOAlNja kKfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XPm9390C; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id p18-20020a05600c431200b003fbad317a4asi924557wme.194.2023.08.02.07.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 07:09:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XPm9390C; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB75A86802; Wed, 2 Aug 2023 16:09:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XPm9390C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 788D186879; Wed, 2 Aug 2023 16:09:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D4D29867A3 for ; Wed, 2 Aug 2023 16:09:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=maxim.uvarov@linaro.org Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fe48a2801bso2428800e87.1 for ; Wed, 02 Aug 2023 07:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690985356; x=1691590156; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LUxM3UqYAPwo9oLKd6ioOKz1YPMGyv+S4nvNyauSCco=; b=XPm9390CJ8N+mUbw3XXdscI/e/VvGAlOhLMF9tgMjAmed2dNeCv83mCJS0K7H/4TnE SbtmGpq/zGvTtGBlC3N3AbtnrWqO3AlCKUjUYeX40FiCzYruHGGJWZpQ9pzv1GJS7qJd mfQ4wBd/CcOFJdf0pdfjWbEqw61US24TSqQzU7bTm1HStQU9Sw3DkoJ8kL8sVmtKuE5l mNexCKrRo3kKNVo9m4yuZZKzCh7GfRrvNMuY3ARMmjsJcrfm9yigXnHmJTs6Ab8s41PC //lG8dp7spOp5JtY3Frmb9698PQ0x2Wm2WAIIh64e4jrN47WDkLboMC+ddTp6n3F07bM YgmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690985356; x=1691590156; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LUxM3UqYAPwo9oLKd6ioOKz1YPMGyv+S4nvNyauSCco=; b=JeVOwIMloVgmfGV8ntj9XWOTjCn3YRsk+i62BlGiZTIF4n0LWebe/0gK+Swad9DJrn YEMMSUpY+LQKcDvF0a6Uu1xonmQ5/xO2xLY6g+SNajwBtY/AjWBUvPHNYL7XDxtGyv56 PzPUIJinOLclHIlO1B96RoSYhFApWflTGLIyeQpATfaup/OqM9Mk1d7yaZlkthrPx3tq 6EPREfSmrszVTnfmqXIBhd44ZpfWNrIDh92CrOcn2Jp1UDZDzcYjzSxsw14LOQl/Wfje O3quFg8JpFhfHRyKiQPPE4Ea+p6SoO6mHwZK/15JtXB5ejH+T9EIabpRmsqrwhsHxL3J 4Kxg== X-Gm-Message-State: ABy/qLY/KAt9xQ7zQ8z6Lfd2XavZT8tNAxB9jezSlk0zHIH9Dd9poFu/ paReR2gCkjzbkurQZ3UG9vYtrY2HYE1jud6TGvLNUQ== X-Received: by 2002:a19:434e:0:b0:4fe:1f27:8856 with SMTP id m14-20020a19434e000000b004fe1f278856mr4490328lfj.7.1690985355658; Wed, 02 Aug 2023 07:09:15 -0700 (PDT) Received: from localhost.localdomain ([45.82.14.220]) by smtp.gmail.com with ESMTPSA id a12-20020a056512020c00b004fbbef8d4dbsm2982026lfo.121.2023.08.02.07.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 07:09:14 -0700 (PDT) From: Maxim Uvarov To: u-boot@lists.denx.de Cc: pbrobinson@redhat.com, ilias.apalodimas@linaro.org, joe.hershberger@ni.com, rfried.dev@gmail.com, trini@konsulko.com, goldsimon@gmx.de, lwip-devel@nongnu.org, Maxim Uvarov Subject: [PATCHv5 00/13] net/lwip: add lwip library for the network stack Date: Wed, 2 Aug 2023 20:06:45 +0600 Message-Id: <20230802140658.10319-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean changelog: v5: - fixed Iliases comments and split big patch on the small ones. You also need to issue command: git subtree add --prefix lib/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash Which will create merge commit of lwip library placing sources into lib/lwip/lwip-external directory. I do not send it a patch due to 1. merges are not friendly with git format-patch and 2. the source code of lwip is 78kb. v4: - tested with tests/py/ did some minor fixes (out of tree build, variables set after downloads). - accounted review comments for documentation. - implemented dns command - corrected wget command to not use serverip variable and use just url string. v3: - use lwip commands for ping,tftp,wget,dhcp if this patch applied. Drop CONFIG_LIB_LWIP_REPLACE_ option. - docs: use rst variant and drop references to RFC. Maxim Uvarov (13): net/lwip: add doc/develop/net_lwip.rst net/lwip: integrate lwip library net/lwip: implement dns cmd net/lwip: implement dhcp cmd net/lwip: implement tftp cmd net/lwip: implement wget cmd net/lwip: implement ping cmd net/lwip: add lwip configuration configuration net/lwip: implement lwip port to u-boot net/lwip: update .gitignore with lwip net/lwip: connection between cmd and lwip apps net/lwip: replace original net commands with lwip net/lwip: drop old net/wget .gitignore | 9 + boot/bootmeth_efi.c | 2 +- boot/bootmeth_pxe.c | 2 +- cmd/net.c | 86 +---- cmd/pxe.c | 2 +- doc/develop/index.rst | 1 + doc/develop/net_lwip.rst | 55 ++++ include/net.h | 8 +- include/net/lwip.h | 5 + include/net/wget.h | 22 -- lib/Kconfig | 2 + lib/Makefile | 1 + lib/lwip/Kconfig | 67 ++++ lib/lwip/Makefile | 74 +++++ lib/lwip/apps/dhcp/lwip-dhcp.c | 53 ++++ lib/lwip/apps/dns/lwip-dns.c | 46 +++ lib/lwip/apps/dns/lwip-dns.h | 3 + lib/lwip/apps/http/Makefile | 13 + lib/lwip/apps/http/lwip-wget.c | 130 ++++++++ lib/lwip/apps/ping/Makefile | 11 + lib/lwip/apps/ping/lwip_ping.c | 37 +++ lib/lwip/apps/ping/lwip_ping.h | 24 ++ lib/lwip/apps/ping/ping.h | 35 ++ lib/lwip/apps/tftp/Makefile | 16 + lib/lwip/apps/tftp/lwip-tftp.c | 124 ++++++++ lib/lwip/cmd-lwip.c | 308 ++++++++++++++++++ lib/lwip/lwipopts.h | 203 ++++++++++++ lib/lwip/port/if.c | 256 +++++++++++++++ lib/lwip/port/include/arch/cc.h | 46 +++ lib/lwip/port/include/arch/sys_arch.h | 59 ++++ lib/lwip/port/include/limits.h | 0 lib/lwip/port/sys-arch.c | 20 ++ lib/lwip/ulwip.h | 9 + net/Kconfig | 1 + net/Makefile | 1 - net/net.c | 30 +- net/wget.c | 440 -------------------------- 37 files changed, 1649 insertions(+), 552 deletions(-) create mode 100644 doc/develop/net_lwip.rst create mode 100644 include/net/lwip.h delete mode 100644 include/net/wget.h create mode 100644 lib/lwip/Kconfig create mode 100644 lib/lwip/Makefile create mode 100644 lib/lwip/apps/dhcp/lwip-dhcp.c create mode 100644 lib/lwip/apps/dns/lwip-dns.c create mode 100644 lib/lwip/apps/dns/lwip-dns.h create mode 100644 lib/lwip/apps/http/Makefile create mode 100644 lib/lwip/apps/http/lwip-wget.c create mode 100644 lib/lwip/apps/ping/Makefile create mode 100644 lib/lwip/apps/ping/lwip_ping.c create mode 100644 lib/lwip/apps/ping/lwip_ping.h create mode 100644 lib/lwip/apps/ping/ping.h create mode 100644 lib/lwip/apps/tftp/Makefile create mode 100644 lib/lwip/apps/tftp/lwip-tftp.c create mode 100644 lib/lwip/cmd-lwip.c create mode 100644 lib/lwip/lwipopts.h create mode 100644 lib/lwip/port/if.c create mode 100644 lib/lwip/port/include/arch/cc.h create mode 100644 lib/lwip/port/include/arch/sys_arch.h create mode 100644 lib/lwip/port/include/limits.h create mode 100644 lib/lwip/port/sys-arch.c create mode 100644 lib/lwip/ulwip.h delete mode 100644 net/wget.c