From patchwork Thu Sep 8 11:58:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vyacheslav V. Mitrofanov" X-Patchwork-Id: 1675557 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yadro.com header.i=@yadro.com header.a=rsa-sha256 header.s=mta-01 header.b=Mj9I/pP+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MNd2r2Ff5z1yhP for ; Thu, 8 Sep 2022 21:59:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8240784AFA; Thu, 8 Sep 2022 13:59:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=yadro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=yadro.com header.i=@yadro.com header.b="Mj9I/pP+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D91D884AFA; Thu, 8 Sep 2022 13:59:23 +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 mta-01.yadro.com (mta-02.yadro.com [89.207.88.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E352D84AE8 for ; Thu, 8 Sep 2022 13:59:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=yadro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=v.v.mitrofanov@yadro.com Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 7717246DAF; Thu, 8 Sep 2022 11:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :x-mailer:message-id:date:date:subject:subject:from:from :received:received:received:received; s=mta-01; t=1662638358; x= 1664452759; bh=8X7jPyBdhqBMrRZtGmH0jjTWSu2ALcLL3jC0Nvr/Pr8=; b=M j9I/pP+XpKPMHmC61nc3iXNNeP0lMbCYf3pNRpowepb59AlJyCvTl1cFTun/NoXk 2/1OPevA2DB5agcytMKS2KLF5uwdkm17J4ccxJ+ka3L23K7NtFSA9cvPny5B8VHm TA/gf7SfvhFQyNANtL5JJKjerWvOUFU002A8ioXSYc= Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QIl1MeGsJHCT; Thu, 8 Sep 2022 14:59:18 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (T-EXCH-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 6F60544F88; Thu, 8 Sep 2022 14:59:17 +0300 (MSK) Received: from T-EXCH-06.corp.yadro.com (172.17.10.110) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Thu, 8 Sep 2022 14:59:17 +0300 Received: from v.yadro.com (10.199.17.194) by T-EXCH-06.corp.yadro.com (172.17.10.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.9; Thu, 8 Sep 2022 14:59:16 +0300 From: Viacheslav Mitrofanov To: CC: , , , , , , , Subject: [PATCH v4 00/17] IPv6 support Date: Thu, 8 Sep 2022 14:58:48 +0300 Message-ID: <20220908115905.70928-1-v.v.mitrofanov@yadro.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.199.17.194] X-ClientProxiedBy: T-EXCH-02.corp.yadro.com (172.17.10.102) To T-EXCH-06.corp.yadro.com (172.17.10.110) 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.6 at phobos.denx.de X-Virus-Status: Clean This patch set adds basic IPv6 support to U-boot. It is based on Chris's Packham patches (https://lists.denx.de/pipermail/u-boot/2017-January/279366.html) Chris's patches were taken as base. There were efforts to launch it on HiFive SiFive Unmatched board but the board didn't work well. The code was refactored, fixed some bugs as CRC for little-endian, some parts were implemented in our own way, something was taken from Linux. Finally we did manual tests and the board worked well. Testing was done on HiFive SiFive Unmatched board (RISC-V) Signed-off-by: Viacheslav Mitrofanov --- Changes in v2: - Split big patches into smaller - If an address in tftpboot is IPv6 than use IPv6 to boot - Add tests Changes in v3: - Added functions and structures description in whole patch-series - Removed memory allocation in on_ip6addr() - Some functions got return code from errno.h - Add to string_to_ip6() length parameter to avoid obligatory null termination - Add a lot of small decorative cnages Changes in v4: - Fixed funcs and structures style description - Added omitted tags Viacheslav Mitrofanov (17): net: ipv6: Add IPv6 basic primitives net: ipv6: Add IPv6 build options net: ipv6: Add callbacks declarations to get access to IPv6 variables net: ipv6: Add Neighbor Discovery Protocol (NDP) net: ipv6: Add string_to_ip6 converter net: ipv6: Enable IPv6 typeconversion specifier net: ipv6: Add ip6addr, gatewayip6, serverip6 variables callbacks net: ipv6: Add implementation of main IPv6 functions net: ipv6: Incorporate IPv6 support into u-boot net subsystem net: tftp: Add IPv6 support for tftpboot net: ping6: Add ping6 command test: dm: eth: Add string_to_ip6 test test: dm: eth: Add csum_ipv6_magic test test: dm: eth: Add ip6_addr_in_subnet test test: dm: eth: Add ip6_make_snma test test: dm: eth: Add ip6_make_lladdr test test/py: add a ping6 test cmd/Kconfig | 7 + cmd/net.c | 61 ++++++ include/env_callback.h | 10 + include/env_flags.h | 10 + include/ndisc.h | 102 +++++++++ include/net.h | 4 +- include/net6.h | 432 ++++++++++++++++++++++++++++++++++++ lib/net_utils.c | 109 ++++++++++ lib/vsprintf.c | 7 +- net/Kconfig | 10 + net/Makefile | 3 + net/ndisc.c | 289 +++++++++++++++++++++++++ net/net.c | 53 ++++- net/net6.c | 445 ++++++++++++++++++++++++++++++++++++++ net/ping6.c | 118 ++++++++++ net/tftp.c | 63 +++++- test/dm/eth.c | 146 +++++++++++++ test/py/tests/test_net.py | 15 ++ 18 files changed, 1865 insertions(+), 19 deletions(-) create mode 100644 include/ndisc.h create mode 100644 include/net6.h create mode 100644 net/ndisc.c create mode 100644 net/net6.c create mode 100644 net/ping6.c