From patchwork Mon Aug 14 13:32:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 713469 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp1241757wrp; Mon, 14 Aug 2023 06:35:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnXZGo77sMqaNiaJwxpZCmOb0SbhV2j4Y42KCwP78ia7zzf1QdrE8QbbTeB+s5JlUck7vo X-Received: by 2002:adf:f34d:0:b0:313:e8b6:1699 with SMTP id e13-20020adff34d000000b00313e8b61699mr6552495wrp.55.1692020114661; Mon, 14 Aug 2023 06:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692020114; cv=none; d=google.com; s=arc-20160816; b=IBEA72LmWU5Zcra4O+dWBW1ppdMhL3VEW6h2+OKeQ/Wfkq4N0MyRg5czgUVoBV+adL tMzomg0GVORloA9Y5LVYtYiRCsJcGy0gLzifBlPvoTctLwvz/f9npZ849soeFXSwympj 2a+lpt18uCXWYqW0lZbbFwmhHurK0y2JrEH9hZasmNJRr4iv+PvudTU38Tc3Tm6YALc7 0KhlvWhhdW0B4QEZSBzDKD9phOQwdQv5QzolG2SikC9knqUPbwFwKsuMATC4A8sBdUXU edvyqDEmT7aOsuoum7TjuuCnpMsu/4D9cybgA9fXEwWywudtyC6aeHey9AAeFnb2cbQ+ Nhnw== 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=KPT+tQFW3KYaOFkW0E4pJrD+ZEkMNTnSK4aLeMoATmg=; fh=KONqw1VFBW9nCv9imase+52c+XJ0MeVkzLj6SOLcJqQ=; b=yA9YU/8lbOUMSWd/w3enCEOarHMkRozUCNOt6S5/y4Hu+fZXM/Xq9oJ6lCVXuME8JG 6QTm0JmsDGQegACxfmpYx/+SaUvaE5xZghTN/e8gpX4ccuGlgajXH9OQb2cH1Jfr5JbT qyLCxfmNU0ULIp+YWRiny8Qh6rikltOWkG6gfzFMGMBczI/fToAW8MdB8dcaZr1RtRAA e+zW3czdiDXAscaD2uzLzF9cCzN0GFDP2vvbgHeI1R3LRFT+CiaIaE6Hpj4/GdZTyTBt 7qI3dMlsnYUG4hO3uZGE/1SZNlZ7iFbkYwfJMeeasIeTrZ5O9e8izAiQoS26/Qkjxahc uFqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QjU4vlWi; 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 d4-20020adfe884000000b00317dba828b3si5223948wrm.112.2023.08.14.06.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 06:35:14 -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=QjU4vlWi; 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 8676B865B6; Mon, 14 Aug 2023 15:35:13 +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="QjU4vlWi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 32B4D865B6; Mon, 14 Aug 2023 15:35:13 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (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 E0A62807B3 for ; Mon, 14 Aug 2023 15:35:10 +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-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b9b50be31aso64430711fa.3 for ; Mon, 14 Aug 2023 06:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692020110; x=1692624910; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KPT+tQFW3KYaOFkW0E4pJrD+ZEkMNTnSK4aLeMoATmg=; b=QjU4vlWil/em5mS/SYB3SMtBt2is+9hdnP3+0oTUP1pe4iwI3KT7CYvKdc/NRWMq/+ iHYJa5bv0EosS/hGkYc/W7vAsLD5g+03lP09Ru1WJD3y87jMwu3zz0N4vuP4pS5D4Su7 j39I2lCX/fYKf1xSk4QmBMN76QzQmSiZ/O13w2bVUahJXNumhIYmJmYSuzY+DRhzfmy5 VtNxiWkwUunJI/D2WEWS2IQ+K6PGP2FVXpDWpDGTNDQl8KZEd/a+5zx7i+TliWZUbSl5 3Wdk1/JfE0iCVUfB0n8lPZp1iA8DL1zO4W/apdWpfT9vdDLsyCkdRU8WAIGlFuFE0h99 dNww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692020110; x=1692624910; 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=KPT+tQFW3KYaOFkW0E4pJrD+ZEkMNTnSK4aLeMoATmg=; b=QcjvAmVGwMERPEbx4rD1hwXjxbypKSk7DLXCUcRnQAKR4otQl+Kek8ozMzSBdGpP44 Cx1IIx4Bw/IgMjdnpOg3RfwBCBcgMXuYkU3ABDvvJziCiNZ1w/gIta+n7/zjA4kmmRrI 5yUI+wZ6iv2V1b71MArwkjTgOVOLX9CCThurtaODW9e7aPD2d/7I9B4fK0TMMk3Gwi6S 1e35EUnRTh3JTN3tPDBXwL9ANZVcKfwIPBHgqW1QBep2m2z8/rfGctWC6p5Kaf8gfuHD szk2TEXeBuu/6lFit0Bh1h+Iz68kbU/H2U1Cf9YpjbHLVhJu/5EysDQ/KKo8kTQmK2ES M+4w== X-Gm-Message-State: AOJu0YzeZBx3eCc5akGjBBcbL56NcjvL6H+dBh+yymBDUj0Iqf6JRRxX awD43gqliPGE81ot3OLA9dXqGNn1zwW1Q1sGsZs= X-Received: by 2002:a2e:9cd8:0:b0:2b9:e53f:e201 with SMTP id g24-20020a2e9cd8000000b002b9e53fe201mr6653186ljj.31.1692020109870; Mon, 14 Aug 2023 06:35:09 -0700 (PDT) Received: from localhost.localdomain ([45.82.14.220]) by smtp.gmail.com with ESMTPSA id z24-20020a2e9658000000b002b9415597d0sm2411102ljh.78.2023.08.14.06.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 06:35:09 -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: [PATCHv6 00/14] net/lwip: add lwip library for the network stack Date: Mon, 14 Aug 2023 19:32:39 +0600 Message-Id: <20230814133253.4150-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: v6: - fixed review comments for v5 (thanks Ilias and Simon). - lwip is not under /net, so prior applying patch following commit is needed to create lwIP merge into U-Boot: git subtree add --prefix net/lwip/lwip-external https://git.savannah.nongnu.org/git/lwip.git master --squash 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 (14): 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 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: split net.h to net.h, arp.h and eth.h net/lwip: drop old net/wget boot/bootmeth_efi.c | 18 +- boot/bootmeth_pxe.c | 21 +- cmd/Makefile | 1 + cmd/net-lwip.c | 306 ++++++++++++++++++ cmd/net.c | 86 +---- cmd/pxe.c | 19 +- doc/develop/index.rst | 1 + doc/develop/net_lwip.rst | 64 ++++ include/net.h | 197 +----------- include/net/arp.h | 7 + include/net/eth.h | 190 +++++++++++ include/net/lwip.h | 66 ++++ include/net/ulwip.h | 68 ++++ include/net/wget.h | 22 -- net/Kconfig | 3 + net/Makefile | 2 +- net/eth-uclass.c | 8 + net/lwip/.gitignore | 8 + net/lwip/Kconfig | 60 ++++ net/lwip/Makefile | 72 +++++ net/lwip/apps/dhcp/lwip-dhcp.c | 51 +++ net/lwip/apps/dns/lwip-dns.c | 46 +++ net/lwip/apps/http/Makefile | 13 + net/lwip/apps/http/lwip-wget.c | 131 ++++++++ net/lwip/apps/ping/Makefile | 11 + net/lwip/apps/ping/lwip_ping.c | 37 +++ net/lwip/apps/ping/lwip_ping.h | 15 + net/lwip/apps/ping/ping.h | 19 ++ net/lwip/apps/tftp/Makefile | 16 + net/lwip/apps/tftp/lwip-tftp.c | 129 ++++++++ net/lwip/lwipopts.h | 195 ++++++++++++ net/lwip/port/if.c | 260 +++++++++++++++ net/lwip/port/include/arch/cc.h | 39 +++ net/lwip/port/include/arch/sys_arch.h | 56 ++++ net/lwip/port/include/limits.h | 0 net/lwip/port/sys-arch.c | 20 ++ net/net.c | 26 +- net/wget.c | 440 -------------------------- 38 files changed, 1966 insertions(+), 757 deletions(-) create mode 100644 cmd/net-lwip.c create mode 100644 doc/develop/net_lwip.rst create mode 100644 include/net/arp.h create mode 100644 include/net/eth.h create mode 100644 include/net/lwip.h create mode 100644 include/net/ulwip.h delete mode 100644 include/net/wget.h create mode 100644 net/lwip/.gitignore create mode 100644 net/lwip/Kconfig create mode 100644 net/lwip/Makefile create mode 100644 net/lwip/apps/dhcp/lwip-dhcp.c create mode 100644 net/lwip/apps/dns/lwip-dns.c create mode 100644 net/lwip/apps/http/Makefile create mode 100644 net/lwip/apps/http/lwip-wget.c create mode 100644 net/lwip/apps/ping/Makefile create mode 100644 net/lwip/apps/ping/lwip_ping.c create mode 100644 net/lwip/apps/ping/lwip_ping.h create mode 100644 net/lwip/apps/ping/ping.h create mode 100644 net/lwip/apps/tftp/Makefile create mode 100644 net/lwip/apps/tftp/lwip-tftp.c create mode 100644 net/lwip/lwipopts.h create mode 100644 net/lwip/port/if.c create mode 100644 net/lwip/port/include/arch/cc.h create mode 100644 net/lwip/port/include/arch/sys_arch.h create mode 100644 net/lwip/port/include/limits.h create mode 100644 net/lwip/port/sys-arch.c delete mode 100644 net/wget.c