From patchwork Fri Jul 14 14:19:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 702721 Delivered-To: patch@linaro.org Received: by 2002:adf:db4e:0:b0:314:25da:8dc4 with SMTP id f14csp1113800wrj; Fri, 14 Jul 2023 07:22:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlE8tfyANKREb6OvMhr13GMWLUOpnAVk54WTOOwTQ/E/FiXJR+xbQVhNLO1UhfkpUFxJcPKw X-Received: by 2002:aa7:c149:0:b0:51d:d37f:ab49 with SMTP id r9-20020aa7c149000000b0051dd37fab49mr3612608edp.6.1689344536883; Fri, 14 Jul 2023 07:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689344536; cv=none; d=google.com; s=arc-20160816; b=rIu9jkwj0Gls7pVnNF6ZynsvFrU3fQ60iMzKuvWv99Hochf2lPtVNGvsPF4AlHofrV v8Ry4xJX7YtHtSLnonQcY/fs7/nYY9f7+XiwyOY2pYlLKLCoWe6gqHQ6BrUD33Y6CjZE JSid5hr4IUWNaHfZYG9hnQ7VjqpmXoIHTuSwanoFW2BOyydoP5Gp7FSSvNXZ+nXzv+g2 vJHx0TIv8DFODw1RjxKjjNyNakZG7EwzRYW2XwNBiAi5i9Od+Eh+KX0pbRuxJ1M8R75f DhJxtR6VcgXaPuZpNCi+QM2ekAnvOFK/rqF/d/aUol4xiAOTxNew8KEboPpgvckzm43h FPgQ== 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=y24YT+2ReCUlOJVhtpdd+lf1HNvd1MBWZPvq+qp768s=; fh=KONqw1VFBW9nCv9imase+52c+XJ0MeVkzLj6SOLcJqQ=; b=F33nzkO65nTOzCXdPjqdaL/KU6vJInDQJhhOr8ZYKzE0TzhKElVUZ73AZ/KQLFMXvr fMu8oLORevRTLIRHnql2zyfXEy6mnuavHv26+ThBpU88zTLsgXBTuMQBmhwlqo0CWgUW 4J8rLCmVYHPe35ZS5IsUmFfb4jZLQ4nt1lcdQEGR5mQqNAwtA8q81/549V/UFyyjofN5 FeqeGJ4P8ohFyZBiHAwP9E1k/PV3Iu0O/eAmIF5tkduHELn1mnz3CnoHVSN0D0sZM36D /Mf+ZwGsLdfk3ldM+juOf6oy7dK5faHEk8YKH8mTEy4iC8fJYDOjKomtgO+BstYon3pZ AY0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DVU5Rkp/"; 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 by11-20020a0564021b0b00b0051df537f3bfsi8915329edb.676.2023.07.14.07.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 07:22:16 -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="DVU5Rkp/"; 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 B089486D0B; Fri, 14 Jul 2023 16:22:14 +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="DVU5Rkp/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF7EF86D2E; Fri, 14 Jul 2023 16:22: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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (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 D95BD86CB8 for ; Fri, 14 Jul 2023 16:22: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-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f9fdb0ef35so3435699e87.0 for ; Fri, 14 Jul 2023 07:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689344529; x=1691936529; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y24YT+2ReCUlOJVhtpdd+lf1HNvd1MBWZPvq+qp768s=; b=DVU5Rkp/IaLk6KtPtNdh70B4cVLs1GB3zslRoHUMO7pR+cS/MptPnSNCZlCpRcQITz pYtndNsaroDPMX39EsBcsCRE3LZYhb+R2UXv/cXhNU+RLQU+Hxwbo8KOr/5uqCvposhH b31EuiGPRMSYAV04KfsQP7gjKbYj0VaY50mdfVxkyiDo1C7W5kdKJwuBSXQQKbC6NWx0 2sAOwSFKVOXuBwbv2jwNZ3A3exxjf8lGxTP4mZAxjcosl5w6y7rq619/wHxF2YQTfYyN Lnm0My/daM37SPNqmx6ziq7FPtlvETCjzpEh58v9M7Z4SQlgs6okR0gOSlLJCZdygaOk jUSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689344529; x=1691936529; 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=y24YT+2ReCUlOJVhtpdd+lf1HNvd1MBWZPvq+qp768s=; b=HDF1pgB49tilihfUS5aapRkxhU0o1UvF/cfw7WA1Lj324oxMwPEeNeSS6UgZQ0L9Yh Pmw6SEOcfsQfSqj3bDlYhF5QchJ6TMiQjkC9dthnBW3QpQrHb2KqByOOo+KpvBK9SnV1 6pbCVeBXQRY87yUuXbFUkr4lhihbR1knQtHboOdK8ITbVJar5u83JLptnRcfGGhKdMui tofs1AMlP0ZV4kp8C5enpkpz1ZzUtCUBowyQ25lyqPev17SL68wf3pzSbleCgEx/XLTg EToUaRfPtWK/NZEMg2cVyUIx5P4YcXNNojajBs73X5rgXtDeKIq/MvrNjswecCL/N0Ft 6SOw== X-Gm-Message-State: ABy/qLbp/m9UZ9p08OwlZJuJx899YlkHu1Sg5bloAvBvMRC5i0iObSO8 N8xs5gkbfK9xl/RHmtvMxS0LCEruGf1F/qby8XRHFQ== X-Received: by 2002:a05:6512:3f10:b0:4f7:6976:2070 with SMTP id y16-20020a0565123f1000b004f769762070mr4043726lfa.40.1689344529422; Fri, 14 Jul 2023 07:22:09 -0700 (PDT) Received: from localhost.localdomain ([45.82.14.220]) by smtp.gmail.com with ESMTPSA id w28-20020ac2599c000000b004fb759964a9sm1504703lfn.168.2023.07.14.07.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 07:22: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: [PATCHv4 0/5] net/lwip: add lwip library for the network stack Date: Fri, 14 Jul 2023 20:19:55 +0600 Message-Id: <20230714142000.5534-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: 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. build: git submodule init git submodule update make I tested with qemu and ubuntu host for the server manually and with ./test/py/test -bd qemu_arm64 --build -k net. Maxim Uvarov (5): net/lwip: add lwip-external submodule net/lwip: add lwip library for the network stack net/lwip: add doc/develop/net_lwip.rst net/lwip: add dns command net/lwip: apps/http: add dns support .gitignore | 9 + .gitmodules | 3 + boot/bootmeth_pxe.c | 2 +- cmd/net.c | 89 +------- cmd/pxe.c | 2 +- doc/develop/index.rst | 1 + doc/develop/net_lwip.rst | 59 +++++ include/net.h | 8 +- lib/Kconfig | 2 + lib/Makefile | 2 + lib/lwip/Kconfig | 63 ++++++ lib/lwip/Makefile | 103 +++++++++ lib/lwip/apps/dhcp/lwip-dhcp.c | 52 +++++ lib/lwip/apps/dns/lwip-dns.c | 46 ++++ lib/lwip/apps/dns/lwip-dns.h | 3 + lib/lwip/apps/http/lwip-wget.c | 121 ++++++++++ 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/lwip-tftp.c | 124 +++++++++++ lib/lwip/cmd-lwip.c | 308 ++++++++++++++++++++++++++ lib/lwip/lwip-external | 1 + lib/lwip/lwipopts.h | 203 +++++++++++++++++ lib/lwip/port/if.c | 260 ++++++++++++++++++++++ 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/net.c | 24 ++ 31 files changed, 1634 insertions(+), 82 deletions(-) create mode 100644 .gitmodules create mode 100644 doc/develop/net_lwip.rst 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/lwip-wget.c 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/lwip-tftp.c create mode 100644 lib/lwip/cmd-lwip.c create mode 160000 lib/lwip/lwip-external 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