From patchwork Tue Apr 15 21:17:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881388 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665166wrr; Tue, 15 Apr 2025 14:18:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUP50mobCLofzWfX0WQE0U60ssOF8SFCY1LzSq03Y+gE7bpOhGLNHGPnNniQIr6iFpycgv97Q==@linaro.org X-Google-Smtp-Source: AGHT+IEba4W+pA4z0GXyPz0BzGCZZjUtTBPn9UHEFkyAUPJd3XS6MSoVWj2FX9NxCganP2tuBaqA X-Received: by 2002:a05:6102:1279:b0:4bb:e2a1:183e with SMTP id ada2fe7eead31-4cb52a7d574mr741582137.18.1744751925682; Tue, 15 Apr 2025 14:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751925; cv=none; d=google.com; s=arc-20240605; b=W5csy6xCmgn8jg0cfZl0lB8sWswcHe0Ky7nwBInN/nRckqr0fvH6bstwGFLD3tHsRN KG4NBqVXsDStk8YUZigfHuOCcKpNny2W3KgyxzSiMAky8UxTcLVEGj/UBCNl5YBHUaDX hKqIQiTcvUf1lhtEAyXWf7kyFO03RqPlUem5S9/kgrW1HVSEFb71YC2XzVWkMwvo+o7t BWpKTeOWERgzJBeBU5HJRZ41R+PU+RV4xh1GncH7p6mKwrhMiJgBPZ0wOrsAhxQ69Pqe stuN6kYwCxZ6/3TbpciJx3z6jqydz6km8gKBkZBOoQmxTThGYENA54Xj4LXwbsWUy7lt uETA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N/dxSILVFVpJWcH0rtldlJyOod0yJDJ8NWl9T9tlmrE=; fh=kmRmNHkz4wx57vWsq7LgD98pAACy+h32motcoXAgJ3c=; b=bVae2YNvUy2i/gGqp8KnSloZ3jAgbjzU4bff9tZ5IawrlfyRsXIQuK9lTzgkPc7arq dneQIQgfPA9fQ1BobRO2GPP9GrYyUtm9H3MWOwqnclaAVhdNVRo5NFX+QVHAwZRXcxfx gb7od9vuxqwKCG3Wuftu2XAcuZ7pqIkoq8oZGRh6q/Lf+nCDAd3g/qkEonbTrddj6bp9 l4HN3FegbdIJMsGXSJn9QQ0aQVLt4GL1eXUDw64/zu3eUOBJGsbtI1bTHMWnQhfK9v8/ kcpFrI7VVLEyBzW10gSfSZPcCZNBfaAFHM62zsngZjnwus6e+p5WWfQG8BGU6xNHi35o wbAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hk1M+gzp; 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; dara=neutral header.i=@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 ada2fe7eead31-4c9c978afc2si4395577137.191.2025.04.15.14.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:45 -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=hk1M+gzp; 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; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 32B7482B7E; Tue, 15 Apr 2025 23:18:34 +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="hk1M+gzp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E41682A27; Tue, 15 Apr 2025 23:18:33 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 0E7DD81F0D for ; Tue, 15 Apr 2025 23:18:31 +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=jerome.forissier@linaro.org Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-391342fc1f6so5213563f8f.1 for ; Tue, 15 Apr 2025 14:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751910; x=1745356710; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N/dxSILVFVpJWcH0rtldlJyOod0yJDJ8NWl9T9tlmrE=; b=hk1M+gzpaBq/hJv1T29BQlTT5GuRbElM/Fiu1Qe0qaTi9EKh9I3TT4+8rYVe19s2yy aRp0bZYG8bgOVaZq9mwLjXrCg2cs9PHhjZbF7LCxqm4fX9gDlcV2KAEFrA9hOGWEUWyC 2ICUXyFwywuD8cd/Xh6EQMGjDa+++Q8wvgnlAstHA5py0W1IBiMGp/W7oTy7lh2Cj9jC b22eRsFOhuAcE4Ktff8DArc2NLtWOpybaxpMDxRG0YWC+1MEKhPu9aZtZkxjiHyCaOrd OrHqYxQScAf/6tJ783v9bLVuBHnNJXBDXQD/w6F7Rrew1VMESi0En/HRZTh/C90wfruv XFJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751910; x=1745356710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N/dxSILVFVpJWcH0rtldlJyOod0yJDJ8NWl9T9tlmrE=; b=uzvZlnjj34VkJ9F3CZq/LsWNmMrUt1TEMkPDpK7+BkV4GHDRP/KaBi2kEMPANVaxFg evqMff4Xx64h2sU6ZNsODVL6mIERSGsrgUybbdSJLh/2mf7yJwrgEhqItORGlAtNLo5n 8ODEcDfpaH0NeHCZtLV4iZVlQ+lSxdMuM/6vsPqdP1YYOLFgDn+LvdeP3KqZ1JbxsQPG d0p1gGsDgz9IOsQZo1HmnF+/V1v6V+9wgv39eHhxw+GvHM5RL3Oj9fDp0MBqNVtCzUJk URpwq2f89QiPgUebZxtznWeUAuelkyG0v8+AKiwTWKhz9KYmZtc8YtuvOjD6yQdNXQnG EymA== X-Gm-Message-State: AOJu0YzZ7bEyXV9GBFmDmkkZ+V0WSCtpUxu10CXdPPW7vNQAaLb7aWUk mPfThOKOHroY0LU7kfjAONv23SCREmm0AAIPfV0hvGMzVJBLdTOqSIT0wRtaDUc3agHTrI5SDv4 wkw4= X-Gm-Gg: ASbGncut8vQGIK05KqOFXUXsW6vMPHA6JoVQ1Cnicmja+EXTjr1aFCj/Mtb7hc8mFrl d7KRZDoyplIJezGb91/7gWK8e0YNRLP6aCMKi2iXXWKuLmP35FeO1OntCbQVlCW0HhVFemF5nR4 xMweG06DQ67QpI1WiQ2yJJrI+KblEKfJ0MfreKZ5xsHBKeTCpNB2hp80fUl8LAPf5SY4r4LUTBG nBEj+1GaptI1kDN1EFsKRDsCmilh+G39MLZzu2ABnIKv99RV4CILuMwyHaDw4HSrQwB/PC1Da8O nf0LYoNI81RpH7FMufGBPrCZ3RPq27F5duOWNBFXxWefu0eQuDSQoKSkeNY= X-Received: by 2002:a5d:5985:0:b0:39e:cbd2:986b with SMTP id ffacd0b85a97d-39ee2729edcmr716674f8f.7.1744751910300; Tue, 15 Apr 2025 14:18:30 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:30 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Adriano Cordova , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Tom Rini Subject: [PATCH v2 01/11] net: lwip: fix initialization sequence before a command Date: Tue, 15 Apr 2025 23:17:36 +0200 Message-ID: <20250415211819.1254435-2-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 The things that are done prior to executing a network command with NET_LWIP are not consistent with what is done with NET. It impacts the selection of the current device, and more precisely if the active device is invalid NET would return an error while NET_LWIP would try to pick a new device. This incorrect behavior was detected thanks to the eth_rotate sandbox test (dm_test_eth_rotate()). Fix it by re-using a sequence similar to what NET has in net_loop(). This piece of code is inserted in a function called net_lwip_eth_start() renamed from net_lwip_eth_set_current(). Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) include/net-lwip.h | 9 ++++++++- net/lwip/dhcp.c | 3 ++- net/lwip/dns.c | 3 ++- net/lwip/net-lwip.c | 40 +++++++++++++++++++++++++++++----------- net/lwip/ping.c | 3 ++- net/lwip/tftp.c | 5 ++++- net/lwip/wget.c | 6 +++++- 7 files changed, 52 insertions(+), 17 deletions(-) diff --git a/include/net-lwip.h b/include/net-lwip.h index 64e5c720560..0d3bb8a8bd8 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -10,7 +10,14 @@ enum proto_t { TFTPGET }; -void net_lwip_set_current(void); +static inline int eth_is_on_demand_init(void) +{ + return 1; +} + +int eth_init_state_only(void); /* Set active state */ + +int net_lwip_eth_start(void); struct netif *net_lwip_new_netif(struct udevice *udev); struct netif *net_lwip_new_netif_noip(struct udevice *udev); void net_lwip_remove_netif(struct netif *netif); diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c index 3b7e4700c6e..92bd7067a7f 100644 --- a/net/lwip/dhcp.c +++ b/net/lwip/dhcp.c @@ -115,7 +115,8 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) int ret; struct udevice *dev; - net_lwip_set_current(); + if (net_lwip_eth_start() < 0) + return CMD_RET_FAILURE; dev = eth_get_dev(); if (!dev) { diff --git a/net/lwip/dns.c b/net/lwip/dns.c index 149bdb784dc..19172ac959a 100644 --- a/net/lwip/dns.c +++ b/net/lwip/dns.c @@ -121,7 +121,8 @@ int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (argc == 3) var = argv[2]; - net_lwip_set_current(); + if (net_lwip_eth_start() < 0) + return CMD_RET_FAILURE; return dns_loop(eth_get_dev(), name, var); } diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 6b7b696dbf0..6748008736b 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -134,18 +134,27 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip, return 0; } -/* Initialize the lwIP stack and the ethernet devices and set current device */ -void net_lwip_set_current(void) +/* + * Initialize the network stack if needed and start the current device if valid + */ +int net_lwip_eth_start(void) { - static bool init_done; + int ret; - if (!init_done) { - eth_init_rings(); - eth_init(); - lwip_init(); - init_done = true; + net_init(); + if (eth_is_on_demand_init()) { + eth_halt(); + eth_set_current(); + ret = eth_init(); + if (ret < 0) { + eth_halt(); + return ret; + } + } else { + eth_init_state_only(); } - eth_set_current(); + + return 0; } static struct netif *new_netif(struct udevice *udev, bool with_ip) @@ -224,11 +233,20 @@ void net_lwip_remove_netif(struct netif *netif) free(netif); } +/* + * Initialize the network buffers, an ethernet device, and the lwIP stack + * (once). + */ int net_init(void) { - eth_set_current(); + static bool init_done; - net_lwip_new_netif(eth_get_dev()); + if (!init_done) { + eth_init_rings(); + eth_init(); + lwip_init(); + init_done = true; + } return 0; } diff --git a/net/lwip/ping.c b/net/lwip/ping.c index c586a96806d..542ef2cb148 100644 --- a/net/lwip/ping.c +++ b/net/lwip/ping.c @@ -168,7 +168,8 @@ int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (!ipaddr_aton(argv[1], &addr)) return CMD_RET_USAGE; - net_lwip_set_current(); + if (net_lwip_eth_start() < 0) + return CMD_RET_FAILURE; if (ping_loop(eth_get_dev(), &addr) < 0) return CMD_RET_FAILURE; diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c index 123d66b5dba..4f9b2049187 100644 --- a/net/lwip/tftp.c +++ b/net/lwip/tftp.c @@ -280,7 +280,10 @@ int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) goto out; } - net_lwip_set_current(); + if (net_lwip_eth_start() < 0) { + ret = CMD_RET_FAILURE; + goto out; + } if (tftp_loop(eth_get_dev(), laddr, fname, srvip, port) < 0) ret = CMD_RET_FAILURE; diff --git a/net/lwip/wget.c b/net/lwip/wget.c index ec098148835..a3b82908877 100644 --- a/net/lwip/wget.c +++ b/net/lwip/wget.c @@ -471,7 +471,11 @@ static int wget_loop(struct udevice *udev, ulong dst_addr, char *uri) int wget_do_request(ulong dst_addr, char *uri) { - net_lwip_set_current(); + int ret; + + ret = net_lwip_eth_start(); + if (ret < 0) + return ret; if (!wget_info) wget_info = &default_wget_info; From patchwork Tue Apr 15 21:17:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881389 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665202wrr; Tue, 15 Apr 2025 14:18:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXJDlnz9Qen+TCfi4bmYlK6+nJaSBNxRkVL6fDRydXITk2y9+xDww7tY4ua1ZpczX0eNRzQyQ==@linaro.org X-Google-Smtp-Source: AGHT+IEoRGjIstQibmIeGU13CXPUV9BwkGZEkZh9toRUbic8/eoGpe64wAvTBaoLaYG61m+KWjxY X-Received: by 2002:a05:6102:232d:b0:4c4:f128:3abb with SMTP id ada2fe7eead31-4cb52b3025fmr764146137.25.1744751935822; Tue, 15 Apr 2025 14:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751935; cv=none; d=google.com; s=arc-20240605; b=W2O7EtoG2Yt8Ei4kdkmxcSJQXdT3/2WJDodq/swaC7lpoyjPeWs/SZLOOQLdvvWUui MP7aKPOdaA8R5CIoY4rzx7Pvoo79NZrFuLtCbyS8BJuv8MRsBC0kVh9ZJCcvX2ClgQTx I3DfdcEwyGEodXMlAbR6BjuUtmwsJxbCLVYeTtgPDjjCw8LFIypZYnDL+PxRV4v7CA46 UWJ2kB7jvx/MNm2d7Sst1nm28ReHmG/7YSXLawHGlO5xaKcILJX70M7bMHs1R3NcE1kx fKly08suZQ2C96LRZ+V0PGMVWr8yp5yuBVbIYcICkH7ct2vIyY1MtB/4aY20gPpEG33s trHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2ANPgtDsQY053tw/r36729R0Xr04aCUCw3FmvtbCeqo=; fh=aUEz3jQF1GWiQLmHzH76kjaLT2+91I7bl4JQ6tJdHG0=; b=HQuI1MH5D2X4C1/SnRMiAcuM75eHGwSOYldoLm6/RQY6qH7cdbrpTsIwM8fCW1j6Gj ZmaDqfMNdXUZsuT6Agi9xGV+JKFrahMNqwVzkAYKfR005wpObeVDiSeqiWcXkkIo3t8O fHKkNdKpnq3IyHzHwHB1MYUaaJ3WkW3R1/7yQ3px+3PT3i4DvAAKPhO4wQ4mEken/yNx FHZDLKb00MacTKuAqafv37/mk7L/29DRcT8vaWvtTAroJb/INMyq/2gwygQ4rfYbozds ReZESQ6cpxSsv73os4cXUpbyAtHj2USuEgkRBBmU5YLJhD86tjmfHbx5as4c3DhzErEY Pdzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UXrA/d+Z"; 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; dara=neutral header.i=@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 ada2fe7eead31-4c9c9890ea5si4935682137.330.2025.04.15.14.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:55 -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="UXrA/d+Z"; 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; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 83C3F82BA2; Tue, 15 Apr 2025 23:18:36 +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="UXrA/d+Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7C37082B97; Tue, 15 Apr 2025 23:18:34 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 CDDB78209C for ; Tue, 15 Apr 2025 23:18:31 +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=jerome.forissier@linaro.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43cf58eea0fso31290695e9.0 for ; Tue, 15 Apr 2025 14:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751911; x=1745356711; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2ANPgtDsQY053tw/r36729R0Xr04aCUCw3FmvtbCeqo=; b=UXrA/d+ZwDN7lz+iGeYt7erqR+fzyakpW4TOduKX9Tm5jChWYXd5p9RJZtu7RSqXSN 0isFhXtSICBIrzZICZK0K4xTIdKm4iXorG2HCeMSST+wA34RWSPkVuyoxQmBwbp+EuPt 0fJu5ElVFJWnVWnHo8cbesoVDlfVJTNwPTkYCRnjGn2MiPxQ2Y/PFqEz9OuQKUj4HBKK wfLgVEDIITjA+Q3zAaSe+zWzh04XXfLTn9O7rzk3AZnNQG7h9VWX6U9OASZctz7MzfHI J2hGq674kg+b8LcYw5SM+kbGljbFP2B7jSKF8sJctB6l9/TMahL3vd7i0+WC4JxlcHPW clgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751911; x=1745356711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2ANPgtDsQY053tw/r36729R0Xr04aCUCw3FmvtbCeqo=; b=Io8xQEhbANoVZEqj4mRO/LTA1//NnH8YExaCiMNL3wEMs57m/q3SpPNzJAS7xUsfcB +Pgsl8ZQjlnkRk/zZb2Ml7xc/EKWSJv4BGCOHC9xXtlYfbLxjhNZRdifrIlYYKnFPd0d 29Zzbr1kTDm/IUC8a+OoCd33zP1SedFupMqzTKSVepnsH1C06MAoy8GifLB1cdKI1d92 o+9E2rns79K3ZFl1AxMvYab+0Wi4VRpQ9Mp3IUyqdxSZBV4+CvLSxrmIiXcKcEalczRK mA4+vxStj9QWAZuK+VzHURf+5PaRNRsOkZPpLxc1kQOHnDatB5ctAHCNvdLRuJ2DA6cm URQw== X-Gm-Message-State: AOJu0Yx4OWvxasRhEk1cBEBG0aa4PqIhqh0Oyv265hcb6O1qeMHiWVoI S0hOplRZTG6nfdgt0giLbRKo1A7T1il+rdWWsKXAl+9a0gABdz4tdDqHxewZdnI6RkytqqD0grP WAXY= X-Gm-Gg: ASbGncuIlUk8jTNXyF/skyZFC1eXuWS5Ae/G/+44gjG8668u3lcYZ9LrjihwvxPZXsm owDHDhpPWcMbidYWCgeM2i8N7Qa4osveVQoZMwE98FXvQnD2u44HMqe8ytt/+Q6psBDQba87o9a Lw04hfbnFG+Pb/pezkkyiJ0FaZTG5WbnEJpp7R4JB1jmtRWoTbblPV7mgfNtXm67OU2xs224J4k 0NPOvTbpIKdnH8mvrKuiTw5Ma4Q0WrUeVvVIteOhoJqQqVnhzJZ7MF4kX8cmF9qtkkt5Sz3q5V9 e82Q8A3mlZscRQp43VrfZHtzKgrQrvkM/i8QwTDkgKrCCwCn X-Received: by 2002:a05:600c:1990:b0:43c:fe90:1279 with SMTP id 5b1f17b1804b1-4405a0f74dcmr4122895e9.21.1744751911085; Tue, 15 Apr 2025 14:18:31 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:30 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Adriano Cordova , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Marek Vasut , Mikhail Kshevetskiy , Ramon Fried , Tom Rini Subject: [PATCH v2 02/11] net: lwip: provide net_start_again() Date: Tue, 15 Apr 2025 23:17:37 +0200 Message-ID: <20250415211819.1254435-3-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Implement net_start_again() when NET_LWIP=y in a very similar way to NET. This will be used in a future commit to determine if a failed ping needs to be tried again on a different interface. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) include/net-common.h | 3 +++ include/net-legacy.h | 3 --- net/lwip/net-lwip.c | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/include/net-common.h b/include/net-common.h index 30860f5975a..0b7edd7d76b 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -471,6 +471,9 @@ static inline struct in_addr env_get_ip(char *var) int net_init(void); +/* Called when a network operation fails to know if it should be re-tried */ +int net_start_again(void); + /* NET compatibility */ enum proto_t; int net_loop(enum proto_t protocol); diff --git a/include/net-legacy.h b/include/net-legacy.h index bc0f0cde9fe..51780999a88 100644 --- a/include/net-legacy.h +++ b/include/net-legacy.h @@ -347,9 +347,6 @@ extern int net_ntp_time_offset; /* offset time from UTC */ int net_loop(enum proto_t); -/* Load failed. Start again. */ -int net_start_again(void); - /* Get size of the ethernet header when we send */ int net_eth_hdr_size(void); diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 6748008736b..d566f9f8e6b 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -21,6 +21,8 @@ #if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) void (*push_packet)(void *, int len) = 0; #endif +static int net_try_count; +static int net_restarted; int net_restart_wrap; static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]; uchar *net_rx_packets[PKTBUFSRX]; @@ -339,3 +341,42 @@ u32_t sys_now(void) { return get_timer(0); } + +int net_start_again(void) +{ + char *nretry; + int retry_forever = 0; + unsigned long retrycnt = 0; + + nretry = env_get("netretry"); + if (nretry) { + if (!strcmp(nretry, "yes")) + retry_forever = 1; + else if (!strcmp(nretry, "no")) + retrycnt = 0; + else if (!strcmp(nretry, "once")) + retrycnt = 1; + else + retrycnt = simple_strtoul(nretry, NULL, 0); + } else { + retrycnt = 0; + retry_forever = 0; + } + + if ((!retry_forever) && (net_try_count > retrycnt)) { + eth_halt(); + /* + * We don't provide a way for the protocol to return an error, + * but this is almost always the reason. + */ + return -ETIMEDOUT; + } + + net_try_count++; + + eth_halt(); +#if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER) + eth_try_another(!net_restarted); +#endif + return eth_init(); +} From patchwork Tue Apr 15 21:17:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881391 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665309wrr; Tue, 15 Apr 2025 14:19:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXh9ljOnhOgSV9XhPUz0erYzQCJvji7RywUNeotoaigHMuK4py+5a7eJ7law0YIepVV5naKng==@linaro.org X-Google-Smtp-Source: AGHT+IECqNSzpSCT4ykwCoAO36oBySon+W82oRVjabZfgMUPZaoS5qn3iK1P7Q/zs8Q61HKDHQqh X-Received: by 2002:a05:6102:5f92:b0:4cb:43d4:6926 with SMTP id ada2fe7eead31-4cb52903d41mr778135137.7.1744751953756; Tue, 15 Apr 2025 14:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751953; cv=none; d=google.com; s=arc-20240605; b=AB7jIeu/Hej7RLbauMm9dcP9PaInMEkU1YkkQQcFIrcht+C1rRW9GGvAZYgB29n1H3 E5KaFtue9MlVHz1JsBvqrpn1p+FrugOUGUD5/aHpNPjfoNAqaiU8OesH9U7wZwn6TxAU 91AaYWz+aX4RaQy2i01xw/0fMBxvAbfi9IIyFvSlATR0fqAk45ny0kJ6RprhnlNRVi6k BVOjRcjjiRV9Wc1bBJuO9JM4PTvqbX3LQl3hXxVlVhT6G0xrMZ85sDPgnnwIFn7dbpC1 DFuyQgT/OgswKPRDmVKbm2rIvhbfUxUwW6oeRgy+CudZYsnEPa9UnzD/OoemrLzwUXa7 5MlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tgM4cLiCJ9uzG8h9WiqEBy5itKu7ia2cOKYoWvK8MPE=; fh=Hg8VU9RXwiw4XNPDaK5KI+CuFbFwBUWGi2JjeFXGHNs=; b=Hv1DHyQNYilzHxYTrQLc2u7ur7cSYGHsmBUqD+pigMXcuEdRW3M6R6gO2uI9pIUXYH hlzOTqzoW2hOyBTN0JpEU6vu+C+T2SMaiByerh118klF6Ozut+sp0TZCO+XyLNSIB+kp c8iKAD+iiDk3angZCiPuAEnseRYZ+gV9YmKV5pNz0gof4/xU9j7e+Xgyl0Eb/Q0s093U UFWU41bhb1F+KGt+0UsaoR45MfZEoH0LML6cArg2uvQa1DbdTr7cbbP6nhLN01WA4GmM GV063bEDRJq3A0gurLvti6VSwgLV19StrhOg+UGyf8yTOzOAEsWr3sjtXybABdXN2ubL gGlg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rvsEM+Ll; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c9c9769fbesi4833492137.141.2025.04.15.14.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rvsEM+Ll; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BFA782BAB; Tue, 15 Apr 2025 23:18:37 +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="rvsEM+Ll"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8686E82B97; Tue, 15 Apr 2025 23:18:35 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 7801682B45 for ; Tue, 15 Apr 2025 23:18:32 +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=jerome.forissier@linaro.org Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3912d2c89ecso5769613f8f.2 for ; Tue, 15 Apr 2025 14:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751912; x=1745356712; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tgM4cLiCJ9uzG8h9WiqEBy5itKu7ia2cOKYoWvK8MPE=; b=rvsEM+LlFrvH009YfF4BA8J1bcSL4QERq7yAckJo0zXjhBhaBpDu7sEPQgJvDt9LkB IqikjP4OlKWgeywi3F/V+iZBzgv9Q5MiDEOMpzY91ZcTFww21MKrmZ/csSu6/s8G0iJO H/lhuYXhZ3heGXqS+HM4MmoCtNvbvqjP+nS3l0CRswao+eNQW+0ErZADP/kFdqnRBWg+ qhRvRGC6ukCjwWLMvj/bTBbYHLRRqM5DmtWa0trEaIvNZ6XHFd9Z/aaaPnvp92BzdUVs c7SrYfitcwvJ17SN+LUhzmixB2VFWHP8S4WFDJjaudp94pZRu5drVPxFO1ByonWhwWhR KoTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751912; x=1745356712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tgM4cLiCJ9uzG8h9WiqEBy5itKu7ia2cOKYoWvK8MPE=; b=jcr7QswXKwnQ1N9S6DWKNTB4VQTMo6bYURd65ATAgdcuHVmFlR9SYwywxlbMNKkn1I oX6w90BwMC2p0Qxt07lb9gtFOqgmU9VPhGQ73r4+osFpVmsN91B6CjoPX3GZy4pf4HqM HHuq504GK+y6hTBWUksDQheXo8sN9Dt1l3foNsk/h5SnzCZ1yGouyxQ2lPyJ4ZoHjqoY GXJ7W1hZ/LodjFnPeTyFNCp9On5XK9dlIQtQjptHQCeEteMwW409pVUpTRXNsivNb9q1 JLOyXPKpTboOu1k1wovcMOecHfTW99pEdOyhvbZ/RlFbt4hAmotYIIXgQc2Wkyl0bha2 g9iQ== X-Gm-Message-State: AOJu0YyXghasXDSOPduNzLhjsLK1ZJEKXuynVQToDYECdiYbrZrcZX0e 71c+fgsEXtDdYu2K14QwxpEH2DagdPNwSdrn3smQ0lnV05rjcSGjITdYWqEH50bFAGjE2ZJqbag Mt0M= X-Gm-Gg: ASbGnctVJWKaVVd8ILRi3YzblbVH9oo1HS6JGUut8OQkAYgvH8Z4Jjv5FJBbWYX7R2W 0o7iH4VxHiTIWhwe4DGlaZMgf/+WbUwrqE640QyGW/FeVZabvk+OBuFUQFhxpclIz/rJouw/Txx iHgS8vK/Xq2eXuGgC1hJtdlVUB9NRG0KS3eqSc863NNoA8bb4WkdVoLllfc4Sxt2INsV9WKaczt nL4UMJtlPkNoU7vnAtV9Ksq/HnVqxUZDYM0tdCOXJnqO7lGYIusg3Ze7Ywb8VEAozsWLN2UOfRK NK2BDU65R1F1vUO0936kkynMWxVNwmVVoH7eS7uuJUx7f0YM/XgwlEhCli0= X-Received: by 2002:a05:6000:4a1a:b0:39c:1257:cd41 with SMTP id ffacd0b85a97d-39ee2777206mr619344f8f.59.1744751911799; Tue, 15 Apr 2025 14:18:31 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:31 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Tom Rini Subject: [PATCH v2 03/11] net: lwip: add restart support to ping Date: Tue, 15 Apr 2025 23:17:38 +0200 Message-ID: <20250415211819.1254435-4-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Use net_start_again() in do_ping() to determine if a failed ping should be restarted on a different interface. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) net/lwip/ping.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/net/lwip/ping.c b/net/lwip/ping.c index 542ef2cb148..d8042ceecf9 100644 --- a/net/lwip/ping.c +++ b/net/lwip/ping.c @@ -168,11 +168,13 @@ int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (!ipaddr_aton(argv[1], &addr)) return CMD_RET_USAGE; - if (net_lwip_eth_start() < 0) - return CMD_RET_FAILURE; - - if (ping_loop(eth_get_dev(), &addr) < 0) - return CMD_RET_FAILURE; +restart: + if (net_lwip_eth_start() < 0 || ping_loop(eth_get_dev(), &addr) < 0) { + if (net_start_again() == 0) + goto restart; + else + return CMD_RET_FAILURE; + } return CMD_RET_SUCCESS; } From patchwork Tue Apr 15 21:17:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881390 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665257wrr; Tue, 15 Apr 2025 14:19:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVIuwRX1W8Z/CX51FQ3fg4JXaGVc62y9yCLFph4rZY4XE0Ow/+N0xFWxIBzvkyP8bKwOnUX4A==@linaro.org X-Google-Smtp-Source: AGHT+IFb4/UXT+6Ig6ODMzR3beb/o/6lg9ZMNor4L2jRnvDsO+RqlCHcEU7xtGjA2UgYjyw2dHjA X-Received: by 2002:a05:6102:458b:b0:4c1:924e:1a1d with SMTP id ada2fe7eead31-4cb52a6d864mr704767137.18.1744751945129; Tue, 15 Apr 2025 14:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751945; cv=none; d=google.com; s=arc-20240605; b=IIWpQTx/wk9YTGMX3Cg8vclwamD5mr0n7vBbgwpYPKc6KzYG9KCC9QkoU+dghqLQq0 9c7te1/sUQjKhfraLXXizokHxRZI71ziu6Kf77a2rCRc9nRE8buTN8X9HZDpEkbPcRvO lzXqBeBur59e3+5Gax/BKPyP1hvmagZsLfpIGBNS0zCyvlMBKNaMt9H27/AQZOOCbsOJ V5lP+VKF9Ni2rYtPqmwS/oIJ/X0P4A/q+g5kiYb0LSPYll5GZgtpEySmL8swisWq5h7Q DnkYpr+hOfuCE+GUsLiCM799X9Wm0Y40d/v8TxIjdYeNesSCSwkaLFv6whU90Kfz3jGO 0tnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BMFSo5rTzMOkXMbVrWRVb8mV2yauGRyvMKAne1KLBYI=; fh=Hg8VU9RXwiw4XNPDaK5KI+CuFbFwBUWGi2JjeFXGHNs=; b=QHO4zcnf6xiKUcQWRTj5mJgRzn1F6tmOrobwYT+uxmHocwRy4UfBtMuvPEja+9FJYm S1G1Y5FKEzlkhSx4FbegCz4Fk325cURlC5/IpMxDpGwkb7OCGoGY5GwVH9WsTOVVYdX5 RlbO/Rklr774mVwkBhxGwarb+++LSTIw73Ytts35OgNP5EdJuc1Xy27sufqpO4Fez94u 2sKVmpvwXHuhz2TttpHstHE36bYRHJIx4uQ3alE1inkaN1IQtQC153anmHmhfsp4Mf9F +bcieO7Jt5aUYyJTKXFpnw/CGb1Ui7ZvYWNEvPo+DPm5B5bW8G4pMH5tx6K3gSPapIU0 hxBw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fgha74XX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c9c989101csi4341517137.275.2025.04.15.14.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:19:05 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fgha74XX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CD9FC82B97; Tue, 15 Apr 2025 23:18:36 +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="Fgha74XX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 248AA82B97; Tue, 15 Apr 2025 23:18:35 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 1BABF808AF for ; Tue, 15 Apr 2025 23:18:33 +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=jerome.forissier@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-39c1efbefc6so3665698f8f.1 for ; Tue, 15 Apr 2025 14:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751912; x=1745356712; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BMFSo5rTzMOkXMbVrWRVb8mV2yauGRyvMKAne1KLBYI=; b=Fgha74XXfNg8T/6uzm7I7yohzqGtMTGmsinCM7d1bRro1ySiyVAoFaGJNDIlL/eFi6 +TcDEEH86hXsveXaYJMUfHPWYF322K3HRxF809VLaI0voDlgVL4Fh7jaicIwcN/Fnt2A n456LJsu2l53w+GUYXb1OST2o7dLVGWRxDqblZ5Oc61f//G78RnpFSTj3TcOCuRJDuLg PDpAH0NGXJyFpr8zJzXQnQyLP0Nsmsu2FH+azgoH50saDnRPY3B6AHKOardhgCUtfITt b0g6vVd1r1rSrrbpj0ssP1W+a7zstAticgcBzuPusSSCJm10Aev84foZMi2zBKEMK7TW 2hrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751912; x=1745356712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BMFSo5rTzMOkXMbVrWRVb8mV2yauGRyvMKAne1KLBYI=; b=i/n7rBWNE4TrymCP6Lo1szHgy0aj2yOu3i7HLlPiGkUG05irT4yaSzkWjzu50vR4CG 9JL9FYOCtPdo4nn2OP6hQGHFIFtIhGFFWc0g0LQZoDlbBnHE3+y5+VYfdAN9MX7LN0zm KY4YpxX62DLVkBA3Oo0kbq1FxAp9kPy0knOin11u9wQFrsqCpy5altwiZVuhwoMymtA+ Csz49pwUmPfdFRGMfYCi2cPyJbNzCIPooAR4d9zv51LJHhoOCBOsG5r5xZoXXKUFQJqs OsIcT/zHre5C7cYc5II8CQQf1uME7Zn9+mnTNr4aAgF0qTT1JifDqeG57Q3GCLUzrpwW b6rg== X-Gm-Message-State: AOJu0YwED5ulIZp8aYPrUPe/IXFNCcI1JXQzc8jvCKNZXjjwE9sPPuvl koMcNk5K6bvhX9tz4TlTttdkyNzgSCIuCfzlyUB8OUbo/x4xVwJtFoJKCkRcd3T23r2guMqngxq bU34= X-Gm-Gg: ASbGnculFttrEaNT+9YVrcpdRTlgOVUcH4gymIFmWgk638tyImyB2Et7r3ee5//xoew p3KENjzQ080aK0UqC2ru4teOQAh0OEzgXKeXGnlD/c9wn+jlLnQtikiehcOXbghi9yCZMBCAGCr jWy6bRWclA/vh7pwyN5p5daOKpj0kt4hPw5CTfcBvW5O8Jaith0A2JpiOSY2QoDkKVXxJpxPpVq gNLnOIlCVMTJSjWF7g6hr1TNCABRiSnIo7nl71k3/MMGKFBZQDrPhWrJyHDNO4U+3zHO1UgQJFX aj+YZ11GWzAp+lVv/ImfT/8l8t2OmTpWlxBmzGpelTfv05rX X-Received: by 2002:a5d:598e:0:b0:39c:12ce:1054 with SMTP id ffacd0b85a97d-39ee2737d2amr783938f8f.8.1744751912448; Tue, 15 Apr 2025 14:18:32 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:32 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Tom Rini Subject: [PATCH v2 04/11] net: lwip: use timer_early_get_count() when CONFIG_SANDBOX_TIMER=y Date: Tue, 15 Apr 2025 23:17:39 +0200 Message-ID: <20250415211819.1254435-5-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 When the sandbox timer is available, use it. This allows skipping time in the tests (sandbox_eth_skip_timeout()). Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) net/lwip/net-lwip.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index d566f9f8e6b..f05c4cd3f64 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -14,6 +14,7 @@ #include #include #include +#include /* xx:xx:xx:xx:xx:xx\0 */ #define MAC_ADDR_STRLEN 18 @@ -339,7 +340,11 @@ int net_loop(enum proto_t protocol) u32_t sys_now(void) { +#if CONFIG_IS_ENABLED(SANDBOX_TIMER) + return timer_early_get_count(); +#else return get_timer(0); +#endif } int net_start_again(void) From patchwork Tue Apr 15 21:17:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881392 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665342wrr; Tue, 15 Apr 2025 14:19:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX/GL9Ybcb+CJyRfrISV+P1FLk5zgmR/qnErv2SfXCGbr4WXXiNG7YddRaT8PIo/8tbI/Hi2w==@linaro.org X-Google-Smtp-Source: AGHT+IF3WuPUiI0V0QcP7CnKqAiorCQJEUu0HDHN+W85GP1Txw5Da4zeathqKkuEYvC6vxbIpyl5 X-Received: by 2002:a05:6102:1178:b0:4c3:2803:61c1 with SMTP id ada2fe7eead31-4cb52a05cbdmr659386137.18.1744751962581; Tue, 15 Apr 2025 14:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751962; cv=none; d=google.com; s=arc-20240605; b=GNSLYXvibQlS7j95P2Ca8GIGdlzPmaEX61A/LZ/+M0usV3haS92lLAAHYKCl2KLCxq XpbgVL12dVh9FcJQjwbh41n+kYXkUlZ7dOzMqXp4yrcIEYcsXSXGSRRXWlBp7mN4PVf0 W77tPcbW9EJZ3fx7M9sFuhYIxbU4hy4Eds1JJbFPUTBnAAu6s4UREqe+eaGQZYxVLiEB qlubRIkXoZQE7EXlHfrcse4OSlPz8ZO9npWKswNDyC7olv8OKa1Qk9PekVIi0iBqsTi7 LLFUR2IxTVgVExA9sMFlQ+wFUyLkSVE2zW0uL7vn9OBfLl4gMUpdgffuU6vDiqZzkuWf TIOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nF+a3elx5t5wSW2ShO5zA1eAO1aO2amXsczOOvtouI4=; fh=DEs2mEXLPAg/APgpVGcqlElz9W6o+5Gdetb+sIf4w84=; b=A6LkTlWpT8SPShYPhkVTSkZBCz9ZilOzsNSkRW5DiJadxp7/uxaCTcmayTI8xKL8Cy RUwIOa7vHiyQpEueGWg+KgSCIH/VDw3OD37QlIlkx4BWFw21+6EfZU42n2aWo6IPaEYZ siMOGrgufEgRDpuZP+eib7lR37bdLhYx62yT6DKzTbLksyKJh/QvH24hh5pQK2VQPUDn nk4qYX1rUAqKim0qO3QytJiNkdOOtoL+CPuS1mZQTYfjcFKb22+HvE9IgirhjKtYi2X/ pqX+Pv2WrT9JlOGh0mbiQZHDOeYpFOb6za27JixpVZmGM6oKBDOs8itzja1LII3WFotv Dr2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sT+5Xyz2; 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; dara=neutral header.i=@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 a1e0cc1a2514c-875572eb138si3916776241.168.2025.04.15.14.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:19:22 -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=sT+5Xyz2; 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; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D63982BB4; Tue, 15 Apr 2025 23:18:39 +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="sT+5Xyz2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84F4482B97; Tue, 15 Apr 2025 23:18:36 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 1101282B54 for ; Tue, 15 Apr 2025 23:18:34 +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=jerome.forissier@linaro.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-39c0dfad22aso3546455f8f.2 for ; Tue, 15 Apr 2025 14:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751913; x=1745356713; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nF+a3elx5t5wSW2ShO5zA1eAO1aO2amXsczOOvtouI4=; b=sT+5Xyz2fu3dOpB9UfudJcIco4eNd9rB+N44F3QcnyEvLnopnf2HJFVmw9liHbbtP0 r7Da55pFDeDBfmyIY/fGU4SsjPYRP8kVZ/9tzd4C1mk+FB6uBUEzzKVv/ZvKl1R2wxZ1 +oyhwg4nIYB+SrPpEiqirjbbMmnaT/LZZkwNRqaXzHGScOQBO07+heRP3YhReAQc0KNS dhW/UdntWR5yVsuLcG8CWtIt5PIpzwJ7/UCKrT0B8Q651nx0TwZ8Hhj4/fHEt8Kue4ru ycZ3TmUNjx3/tbfiGbtjdm603zIZhbl445TGwoVcT5GR7as3skuv9ZrYwFoMrnj2JX8M zR0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751913; x=1745356713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nF+a3elx5t5wSW2ShO5zA1eAO1aO2amXsczOOvtouI4=; b=QveAloAnZ8J8ixu6fK7NVp7qIqjTlrDojU+oImAwjec2hMxiyC97VnJ5lCeWkAa9Cp oU+t6tZFFXwbdR+mI0ONLITEbMYcopVWqWuEmIFRpQuTIX7mC6EqF0ml0XISAxBg2XnA JfO1g7E1DQj0tBQh/wcDuR0PCyYK3JYEAJ4NAueOS1bzqIJRdTR7BRqxSPA9Rk2k7tEg ++UA2z2qj60rCGKaLYq9qMtvGjLshpN20WPDPKxisRi2xPsy+k6vvR9wzVH66QAVZwk7 yIIXTijFAOLtkFTiNEifqtKblDl0xEw8noV6ojhCpd0fbMu0odOrhyQzzNyRoI2NDCO1 oEoQ== X-Gm-Message-State: AOJu0Yx8Dz0ctefvsAihFKcvNuIHce7iiqxZEfAevJt8lh3UuOeaO+a+ 0VU71y3N6KsiTQhM8GWxGVIqZX40TMmJ/H1t2oEm7aMG/x8Xk8DJ/n0g7kkvyqjdQGfWFEaNjhY f14w= X-Gm-Gg: ASbGncuQzu25MzAE+7IbMdQFhT93I2m+ktuvTQOyW+7CrOWsEgEol1HzWQcLR9zlklt I+D1YvVEdm5XfQ5rtcs9NM8su9ruNloJezxq/69/HKkGVAnyLjY9ldu3BhtQVh7vd8k6I5gHOEk JY9FX7UJvmFfR/ANrKPOHEz2D6hpA7t/7Eevqu2KYEIoDcgsXo2a06X8q0j3RiyHHmragXG/1SR PAFvbVLX73rlp/MFCFMsRWmFtDAZ6o0lI0f9owbnIrTdWZDxLp+Npocg8wwLI6ZIPurFDfr+pfE g6dkDRlupZfMAWVrM38iaHjnjktS4FfW2OGstYoOz3jp9WxO X-Received: by 2002:a05:6000:4020:b0:39c:1401:679c with SMTP id ffacd0b85a97d-39ee2736cdamr861799f8f.21.1744751913267; Tue, 15 Apr 2025 14:18:33 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:33 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Boon Khai Ng , Christophe ROULLIER , Hanyuan Zhao , Ilias Apalodimas , Joe Hershberger , Marek Vasut , Markus Gothe , Philip Oberfichtner , Ramon Fried , Robert Marko , Romain Naour , Tom Rini , Weijie Gao Subject: [PATCH v2 05/11] drivers: net: sandbox: add support for NET_LWIP Date: Tue, 15 Apr 2025 23:17:40 +0200 Message-ID: <20250415211819.1254435-6-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Make the sandbox mock ethernet driver (drivers/net/sandbox.c) compatible with NET_LWIP by not relying on any of the structures or functions defined in net-legacy.h. This is done by providing local definitions of the various protocol structures (Ethernet, ARP, IPv4, ICMP). Drop the stub driver that was introduced specifically for NET_LWIP (drivers/net/sandbox-lwip.c). Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) drivers/net/Kconfig | 13 +- drivers/net/Makefile | 1 - drivers/net/sandbox-lwip.c | 85 ------------- drivers/net/sandbox.c | 240 ++++++++++++++++++++++++------------- 4 files changed, 160 insertions(+), 179 deletions(-) delete mode 100644 drivers/net/sandbox-lwip.c diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 3db784faedd..933bad9b00b 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -350,7 +350,7 @@ config ESSEDMA config ETH_SANDBOX depends on SANDBOX - depends on NET + depends on NET || NET_LWIP default y bool "Sandbox: Mocked Ethernet driver" help @@ -359,17 +359,6 @@ config ETH_SANDBOX This driver is particularly useful in the test/dm/eth.c tests -config ETH_SANDBOX_LWIP - depends on SANDBOX - depends on NET_LWIP - default y - bool "Sandbox: Mocked Ethernet driver (for NET_LWIP)" - help - This driver is meant as a replacement for ETH_SANDBOX when - the network stack is NET_LWIP rather than NET. It currently - does nothing, i.e. it drops the sent packets and never receives - data. - config ETH_SANDBOX_RAW depends on SANDBOX depends on NET diff --git a/drivers/net/Makefile b/drivers/net/Makefile index d919d437c08..128ae89db05 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -40,7 +40,6 @@ obj-$(CONFIG_ETH_DESIGNWARE_SOCFPGA) += dwmac_socfpga.o obj-$(CONFIG_ETH_SANDBOX) += sandbox.o obj-$(CONFIG_ETH_SANDBOX_RAW) += sandbox-raw-bus.o obj-$(CONFIG_ETH_SANDBOX_RAW) += sandbox-raw.o -obj-$(CONFIG_ETH_SANDBOX_LWIP) += sandbox-lwip.o obj-$(CONFIG_FEC_MXC) += fec_mxc.o obj-$(CONFIG_FMAN_ENET) += fm/ obj-$(CONFIG_FMAN_ENET) += fsl_mdio.o diff --git a/drivers/net/sandbox-lwip.c b/drivers/net/sandbox-lwip.c deleted file mode 100644 index 3721033c310..00000000000 --- a/drivers/net/sandbox-lwip.c +++ /dev/null @@ -1,85 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (c) 2015 National Instruments - * - * (C) Copyright 2015 - * Joe Hershberger - */ - -#include -#include -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -static int sb_lwip_eth_start(struct udevice *dev) -{ - debug("eth_sandbox_lwip: Start\n"); - - return 0; -} - -static int sb_lwip_eth_send(struct udevice *dev, void *packet, int length) -{ - debug("eth_sandbox_lwip: Send packet %d\n", length); - - return -ENOTSUPP; -} - -static int sb_lwip_eth_recv(struct udevice *dev, int flags, uchar **packetp) -{ - return -EAGAIN; -} - -static int sb_lwip_eth_free_pkt(struct udevice *dev, uchar *packet, int length) -{ - return 0; -} - -static void sb_lwip_eth_stop(struct udevice *dev) -{ -} - -static int sb_lwip_eth_write_hwaddr(struct udevice *dev) -{ - return 0; -} - -static const struct eth_ops sb_eth_ops = { - .start = sb_lwip_eth_start, - .send = sb_lwip_eth_send, - .recv = sb_lwip_eth_recv, - .free_pkt = sb_lwip_eth_free_pkt, - .stop = sb_lwip_eth_stop, - .write_hwaddr = sb_lwip_eth_write_hwaddr, -}; - -static int sb_lwip_eth_remove(struct udevice *dev) -{ - return 0; -} - -static int sb_lwip_eth_of_to_plat(struct udevice *dev) -{ - return 0; -} - -static const struct udevice_id sb_eth_ids[] = { - { .compatible = "sandbox,eth" }, - { } -}; - -U_BOOT_DRIVER(eth_sandbox) = { - .name = "eth_lwip_sandbox", - .id = UCLASS_ETH, - .of_match = sb_eth_ids, - .of_to_plat = sb_lwip_eth_of_to_plat, - .remove = sb_lwip_eth_remove, - .ops = &sb_eth_ops, - .priv_auto = 0, - .plat_auto = sizeof(struct eth_pdata), -}; diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c index fe3627db6e3..2011fd31f41 100644 --- a/drivers/net/sandbox.c +++ b/drivers/net/sandbox.c @@ -9,13 +9,84 @@ #include #include #include -#include #include #include #include +#include + +/* + * Structure definitions for network protocols. Since this file is used for + * both NET and NET_LWIP, and given that the two network stacks do have + * conflicting types (for instance struct icmp_hdr), it is on purpose that the + * structures are defined locally with minimal dependencies -- is + * included for the bit types and that's it. + */ + +#define ETHADDR_LEN 6 +#define IP4_LEN 4 + +struct ethhdr { + u8 dst[ETHADDR_LEN]; + u8 src[ETHADDR_LEN]; + u16 protlen; +} __attribute__((packed)); + +#define ETHHDR_SIZE (sizeof(struct ethhdr)) + +struct arphdr { + u16 htype; + u16 ptype; + u8 hlen; + u8 plen; + u16 op; +} __attribute__((packed)); + +#define ARPHDR_SIZE (sizeof(struct arphdr)) + +#define ARP_REQUEST 1 +#define ARP_REPLY 2 + +struct arpdata { + u8 sha[ETHADDR_LEN]; + u32 spa; + u8 tha[ETHADDR_LEN]; + u32 tpa; +} __attribute__((packed)); + +#define ARPDATA_SIZE (sizeof(struct arpdata)) + +struct iphdr { + u8 hl_v; + u8 tos; + u16 len; + u16 id; + u16 off; + u8 ttl; + u8 prot; + u16 sum; + u32 src; + u32 dst; +} __attribute__((packed)); + +#define IPHDR_SIZE (sizeof(struct iphdr)) + +struct icmphdr { + u8 type; + u8 code; + u16 checksum; + u16 id; + u16 sequence; +} __attribute__((packed)); + +#define ICMPHDR_SIZE (sizeof(struct icmphdr)) + +#define ICMP_ECHO_REQUEST 8 +#define ICMP_ECHO_REPLY 0 +#define IPPROTO_ICMP 1 DECLARE_GLOBAL_DATA_PTR; +static const u8 null_ethaddr[6]; static bool skip_timeout; /* @@ -59,17 +130,19 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev, void *packet, unsigned int len) { struct eth_sandbox_priv *priv = dev_get_priv(dev); - struct ethernet_hdr *eth = packet; - struct arp_hdr *arp; - struct ethernet_hdr *eth_recv; - struct arp_hdr *arp_recv; + struct ethhdr *eth = packet; + struct arphdr *arp; + struct arpdata *arpd; + struct ethhdr *eth_recv; + struct arphdr *arp_recv; + struct arpdata *arp_recvd; - if (ntohs(eth->et_protlen) != PROT_ARP) + if (ntohs(eth->protlen) != PROT_ARP) return -EAGAIN; - arp = packet + ETHER_HDR_SIZE; + arp = packet + ETHHDR_SIZE; - if (ntohs(arp->ar_op) != ARPOP_REQUEST) + if (ntohs(arp->op) != ARP_REQUEST) return -EAGAIN; /* Don't allow the buffer to overrun */ @@ -77,27 +150,29 @@ int sandbox_eth_arp_req_to_reply(struct udevice *dev, void *packet, return 0; /* store this as the assumed IP of the fake host */ - priv->fake_host_ipaddr = net_read_ip(&arp->ar_tpa); + arpd = (struct arpdata *)(arp + 1); + priv->fake_host_ipaddr.s_addr = arpd->tpa; /* Formulate a fake response */ eth_recv = (void *)priv->recv_packet_buffer[priv->recv_packets]; - memcpy(eth_recv->et_dest, eth->et_src, ARP_HLEN); - memcpy(eth_recv->et_src, priv->fake_host_hwaddr, ARP_HLEN); - eth_recv->et_protlen = htons(PROT_ARP); + memcpy(eth_recv->dst, eth->src, ETHADDR_LEN); + memcpy(eth_recv->src, priv->fake_host_hwaddr, ETHADDR_LEN); + eth_recv->protlen = htons(PROT_ARP); - arp_recv = (void *)eth_recv + ETHER_HDR_SIZE; - arp_recv->ar_hrd = htons(ARP_ETHER); - arp_recv->ar_pro = htons(PROT_IP); - arp_recv->ar_hln = ARP_HLEN; - arp_recv->ar_pln = ARP_PLEN; - arp_recv->ar_op = htons(ARPOP_REPLY); - memcpy(&arp_recv->ar_sha, priv->fake_host_hwaddr, ARP_HLEN); - net_write_ip(&arp_recv->ar_spa, priv->fake_host_ipaddr); - memcpy(&arp_recv->ar_tha, &arp->ar_sha, ARP_HLEN); - net_copy_ip(&arp_recv->ar_tpa, &arp->ar_spa); + arp_recv = (void *)eth_recv + ETHHDR_SIZE; + arp_recv->htype = htons(ARP_ETHER); + arp_recv->ptype = htons(PROT_IP); + arp_recv->hlen = ETHADDR_LEN; + arp_recv->plen = IP4_LEN; + arp_recv->op = htons(ARP_REPLY); + arp_recvd = (struct arpdata *)(arp_recv + 1); + memcpy(&arp_recvd->sha, priv->fake_host_hwaddr, ETHADDR_LEN); + arp_recvd->spa = priv->fake_host_ipaddr.s_addr; + memcpy(&arp_recvd->tha, &arpd->sha, ETHADDR_LEN); + arp_recvd->tpa = arpd->spa; - priv->recv_packet_length[priv->recv_packets] = - ETHER_HDR_SIZE + ARP_HDR_SIZE; + priv->recv_packet_length[priv->recv_packets] = ETHHDR_SIZE + + ARPHDR_SIZE + ARPDATA_SIZE; ++priv->recv_packets; return 0; @@ -114,22 +189,22 @@ int sandbox_eth_ping_req_to_reply(struct udevice *dev, void *packet, unsigned int len) { struct eth_sandbox_priv *priv = dev_get_priv(dev); - struct ethernet_hdr *eth = packet; - struct ip_udp_hdr *ip; - struct icmp_hdr *icmp; - struct ethernet_hdr *eth_recv; - struct ip_udp_hdr *ipr; - struct icmp_hdr *icmpr; + struct ethhdr *eth = packet; + struct iphdr *ip; + struct icmphdr *icmp; + struct ethhdr *eth_recv; + struct iphdr *ipr; + struct icmphdr *icmpr; - if (ntohs(eth->et_protlen) != PROT_IP) + if (ntohs(eth->protlen) != PROT_IP) return -EAGAIN; - ip = packet + ETHER_HDR_SIZE; + ip = packet + ETHHDR_SIZE; - if (ip->ip_p != IPPROTO_ICMP) + if (ip->prot != IPPROTO_ICMP) return -EAGAIN; - icmp = (struct icmp_hdr *)&ip->udp_src; + icmp = (struct icmphdr *)(ip + 1); if (icmp->type != ICMP_ECHO_REQUEST) return -EAGAIN; @@ -141,19 +216,19 @@ int sandbox_eth_ping_req_to_reply(struct udevice *dev, void *packet, /* reply to the ping */ eth_recv = (void *)priv->recv_packet_buffer[priv->recv_packets]; memcpy(eth_recv, packet, len); - ipr = (void *)eth_recv + ETHER_HDR_SIZE; - icmpr = (struct icmp_hdr *)&ipr->udp_src; - memcpy(eth_recv->et_dest, eth->et_src, ARP_HLEN); - memcpy(eth_recv->et_src, priv->fake_host_hwaddr, ARP_HLEN); - ipr->ip_sum = 0; - ipr->ip_off = 0; - net_copy_ip((void *)&ipr->ip_dst, &ip->ip_src); - net_write_ip((void *)&ipr->ip_src, priv->fake_host_ipaddr); - ipr->ip_sum = compute_ip_checksum(ipr, IP_HDR_SIZE); + ipr = (void *)eth_recv + ETHHDR_SIZE; + icmpr = (struct icmphdr *)(ipr + 1); + memcpy(eth_recv->dst, eth->src, ETHADDR_LEN); + memcpy(eth_recv->src, priv->fake_host_hwaddr, ETHADDR_LEN); + ipr->sum = 0; + ipr->off = 0; + ipr->dst = ip->src; + ipr->src = priv->fake_host_ipaddr.s_addr; + ipr->sum = compute_ip_checksum(ipr, IPHDR_SIZE); icmpr->type = ICMP_ECHO_REPLY; icmpr->checksum = 0; - icmpr->checksum = compute_ip_checksum(icmpr, ICMP_HDR_SIZE); + icmpr->checksum = compute_ip_checksum(icmpr, ICMPHDR_SIZE); priv->recv_packet_length[priv->recv_packets] = len; ++priv->recv_packets; @@ -171,8 +246,9 @@ int sandbox_eth_ping_req_to_reply(struct udevice *dev, void *packet, int sandbox_eth_recv_arp_req(struct udevice *dev) { struct eth_sandbox_priv *priv = dev_get_priv(dev); - struct ethernet_hdr *eth_recv; - struct arp_hdr *arp_recv; + struct ethhdr *eth_recv; + struct arphdr *arp_recv; + struct arpdata *arp_recvd; /* Don't allow the buffer to overrun */ if (priv->recv_packets >= PKTBUFSRX) @@ -180,23 +256,24 @@ int sandbox_eth_recv_arp_req(struct udevice *dev) /* Formulate a fake request */ eth_recv = (void *)priv->recv_packet_buffer[priv->recv_packets]; - memcpy(eth_recv->et_dest, net_bcast_ethaddr, ARP_HLEN); - memcpy(eth_recv->et_src, priv->fake_host_hwaddr, ARP_HLEN); - eth_recv->et_protlen = htons(PROT_ARP); + memcpy(eth_recv->dst, net_bcast_ethaddr, ETHADDR_LEN); + memcpy(eth_recv->src, priv->fake_host_hwaddr, ETHADDR_LEN); + eth_recv->protlen = htons(PROT_ARP); - arp_recv = (void *)eth_recv + ETHER_HDR_SIZE; - arp_recv->ar_hrd = htons(ARP_ETHER); - arp_recv->ar_pro = htons(PROT_IP); - arp_recv->ar_hln = ARP_HLEN; - arp_recv->ar_pln = ARP_PLEN; - arp_recv->ar_op = htons(ARPOP_REQUEST); - memcpy(&arp_recv->ar_sha, priv->fake_host_hwaddr, ARP_HLEN); - net_write_ip(&arp_recv->ar_spa, priv->fake_host_ipaddr); - memcpy(&arp_recv->ar_tha, net_null_ethaddr, ARP_HLEN); - net_write_ip(&arp_recv->ar_tpa, net_ip); + arp_recv = (void *)eth_recv + ETHHDR_SIZE; + arp_recv->htype = htons(ARP_ETHER); + arp_recv->ptype = htons(PROT_IP); + arp_recv->hlen = ETHADDR_LEN; + arp_recv->plen = IP4_LEN; + arp_recv->op = htons(ARP_REQUEST); + arp_recvd = (struct arpdata *)(arp_recv + 1); + memcpy(&arp_recvd->sha, priv->fake_host_hwaddr, ETHADDR_LEN); + arp_recvd->spa = priv->fake_host_ipaddr.s_addr; + memcpy(&arp_recvd->tha, null_ethaddr, ETHADDR_LEN); + arp_recvd->tpa = net_ip.s_addr; priv->recv_packet_length[priv->recv_packets] = - ETHER_HDR_SIZE + ARP_HDR_SIZE; + ETHHDR_SIZE + ARPHDR_SIZE + ARPDATA_SIZE; ++priv->recv_packets; return 0; @@ -212,9 +289,10 @@ int sandbox_eth_recv_arp_req(struct udevice *dev) int sandbox_eth_recv_ping_req(struct udevice *dev) { struct eth_sandbox_priv *priv = dev_get_priv(dev); - struct ethernet_hdr *eth_recv; - struct ip_udp_hdr *ipr; - struct icmp_hdr *icmpr; + struct eth_pdata *pdata = dev_get_plat(dev); + struct ethhdr *eth_recv; + struct iphdr *ipr; + struct icmphdr *icmpr; /* Don't allow the buffer to overrun */ if (priv->recv_packets >= PKTBUFSRX) @@ -223,31 +301,31 @@ int sandbox_eth_recv_ping_req(struct udevice *dev) /* Formulate a fake ping */ eth_recv = (void *)priv->recv_packet_buffer[priv->recv_packets]; - memcpy(eth_recv->et_dest, net_ethaddr, ARP_HLEN); - memcpy(eth_recv->et_src, priv->fake_host_hwaddr, ARP_HLEN); - eth_recv->et_protlen = htons(PROT_IP); + memcpy(eth_recv->dst, pdata->enetaddr, ETHADDR_LEN); + memcpy(eth_recv->src, priv->fake_host_hwaddr, ETHADDR_LEN); + eth_recv->protlen = htons(PROT_IP); - ipr = (void *)eth_recv + ETHER_HDR_SIZE; - ipr->ip_hl_v = 0x45; - ipr->ip_len = htons(IP_ICMP_HDR_SIZE); - ipr->ip_off = htons(IP_FLAGS_DFRAG); - ipr->ip_p = IPPROTO_ICMP; - ipr->ip_sum = 0; - net_write_ip(&ipr->ip_src, priv->fake_host_ipaddr); - net_write_ip(&ipr->ip_dst, net_ip); - ipr->ip_sum = compute_ip_checksum(ipr, IP_HDR_SIZE); + ipr = (void *)eth_recv + ETHHDR_SIZE; + ipr->hl_v = 0x45; + ipr->len = htons(IPHDR_SIZE + ICMPHDR_SIZE); + ipr->off = htons(IP_FLAGS_DFRAG); + ipr->prot = IPPROTO_ICMP; + ipr->sum = 0; + ipr->src = priv->fake_host_ipaddr.s_addr; + ipr->dst = net_ip.s_addr; + ipr->sum = compute_ip_checksum(ipr, IPHDR_SIZE); - icmpr = (struct icmp_hdr *)&ipr->udp_src; + icmpr = (struct icmphdr *)(ipr + 1); icmpr->type = ICMP_ECHO_REQUEST; icmpr->code = 0; icmpr->checksum = 0; - icmpr->un.echo.id = 0; - icmpr->un.echo.sequence = htons(1); - icmpr->checksum = compute_ip_checksum(icmpr, ICMP_HDR_SIZE); + icmpr->id = 0; + icmpr->sequence = htons(1); + icmpr->checksum = compute_ip_checksum(icmpr, ICMPHDR_SIZE); priv->recv_packet_length[priv->recv_packets] = - ETHER_HDR_SIZE + IP_ICMP_HDR_SIZE; + ETHHDR_SIZE + IPHDR_SIZE + ICMPHDR_SIZE; ++priv->recv_packets; return 0; @@ -398,7 +476,7 @@ static int sb_eth_write_hwaddr(struct udevice *dev) debug("eth_sandbox %s: Write HW ADDR - %pM\n", dev->name, pdata->enetaddr); - memcpy(priv->fake_host_hwaddr, pdata->enetaddr, ARP_HLEN); + memcpy(priv->fake_host_hwaddr, pdata->enetaddr, ETHADDR_LEN); return 0; } From patchwork Tue Apr 15 21:17:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881393 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665401wrr; Tue, 15 Apr 2025 14:19:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/8U92ZwXews637ImnAl6+7ioxqCiP9WEFUYaazOQH+u7WJK5kYJaAWetyIvlyIY1NdjIgXQ==@linaro.org X-Google-Smtp-Source: AGHT+IHJ8UoUmY+J4fQ9Izm2TphsuNEQ3xV8FUMg48vEtm7pv0DHIW4kd8PuhlLJSCdxlmIlWutL X-Received: by 2002:a05:6122:2a01:b0:526:1dde:c5 with SMTP id 71dfb90a1353d-52908f992aemr770589e0c.0.1744751971732; Tue, 15 Apr 2025 14:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751971; cv=none; d=google.com; s=arc-20240605; b=UCMaaZpVXskovYkYYvsEuiU5WUTSEohoteJeBV638Ls9CqYdZ6KhIYeQsS6Tw95QU+ 69HOi3UFBjV/ezwUx6ZPKOpSXlyAwVpBapIgVCszEUM3xRv5dGnZZubjtuCsPyiET76i hpPCEWP5ORgUh/nvxXkkUvvTOEAbmcjc/iDee7pgcs0XWW0tFHuUaczIw4YD70rG72rA k9fpG4S6t8Osl7yA78x3zKhQVNIOMNfx6XbI0AdCRHJ/EO6bCesqj2+1glHIWzaUQg84 6Nje7cXWVP4fOz8rfx2q07WIOut1xljwB2gt/D6Lb7YuvJXuYNgMeG/JrO6F/yWxEV3j PwDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3ohqNOY5VP7rOggwHli2uwz++MOq8E8XGIM1+khD4xA=; fh=IRpKgPkbdGEVWDL5wjisQrtYSYeN0lVZ/8Opo8x/2BA=; b=TZY2rBhV3VhcTi6HP9iOfKPECL6p4FmYAns9J+gP4Tsr4gikILy96AQhuVfLMWAU2M 06L7d7UFAvSR2Byg0a2jemWP6/D5i8Y4h+2IMyqMIRKo769uEUK/83zH48ZgfVipXQux Kiw3Uu4J9njszAdG3p0ZmvuqMyXouKAhEiHpijhM6CL3eAvyidCzxL/e9MHMjstwWCkh tDdQnns3hww6fl0pl0C0Ya2Grdk4khNVT8sxOSv5iTBXzlGHaWIVgKt0mXE0nhrZjxUc oi1AxDxE4zkbjDnzyq07DbENxP1pQXpLDJYor86Lf/M83JThHVIZ75zgJ9vPaapB3lx8 A49g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yoDtx2xh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@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 71dfb90a1353d-527abeadc99si4513239e0c.262.2025.04.15.14.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:19:31 -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=fail header.i=@linaro.org header.s=google header.b=yoDtx2xh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B796B82C0C; Tue, 15 Apr 2025 23:18:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="yoDtx2xh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A7CFB82B97; Tue, 15 Apr 2025 23:18:36 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 A7EB38209C for ; Tue, 15 Apr 2025 23:18:34 +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=jerome.forissier@linaro.org Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-39c0dfba946so4465656f8f.3 for ; Tue, 15 Apr 2025 14:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751914; x=1745356714; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3ohqNOY5VP7rOggwHli2uwz++MOq8E8XGIM1+khD4xA=; b=yoDtx2xhnOgArlJIIZrqIr/oB9oBGQSDP555I/A591mQSmSo0A2VfCFrjvK4Jzj3La LruQWA233nltLl0lOUgV5yJ/LRRW7Z9rdl+BzFAnigDa5ivxRU1Vwfun7Ub6oiRq647k yM/Rt1y0YqdfW8SB4BM67d9KreRf7tn1wXgMyBolTFHPH/1vjhUdykKq9Kj+EnA5u+E9 Jt98LMyA9ScZleZQE9BHl/0BjZ5YJakd6y3fbAUfofp+xZ2pNwBkJRXXvs0NC70pTEDu AOA06UBdvzn8/zwMNLWw7EN6PuMcjrP2TPDQIQPkECnRrBOtBAKk8HAZ7qJccJSyVJkD FjtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751914; x=1745356714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ohqNOY5VP7rOggwHli2uwz++MOq8E8XGIM1+khD4xA=; b=mh4Z1yuk4ds5rPftFhlDgpiqwsli3mtgwA7rjPptt+O44ePN7jhxPC1SHa20vP6cHt 9kWxsITUqLHFJYsu2tlr6WQahX/Uh5XruV9SamjPuXcO5bY+Zi6UdNEDoJh5aVb5iyho F/EtPdcLp9nq1M/xGftfJiJDqKDPfj/61vG/hWrFvlbn/Hp23c2LqYijXOmXUb3iQeK3 YxGFLg/r7REo34NdAa2Fe5IBjGrtxVuvCqgP9hqSi80ycqqsS3t0xHAQkNCTYQo/TGxH Zw30BVAwFUKH2593JJ0dikdFiMbtkLypifGnaAY9XWTbVvgdJMiLsbIaw9ZtXOCiH1bB s+uQ== X-Gm-Message-State: AOJu0YwPgl5yC/5LnNda7Wr0sYMAcoS38tPxzyuV6hpAjgtkeFeUp1SX Qqt+9AhM/nv2+xgky2Omk46Czx2OHA8DQflQTWRJ/oRAjW4jyaJC1xcHHGub5y3be6kLKq780Uj E7+0= X-Gm-Gg: ASbGncvrerJRM6jlGHcy3lMIPfC+IpTNFen5mdPcenBDIqWs+yYFOOGjFTA8jWEbjlJ nRgFdow2a200bVXiLWr+L2yDQ+YxTQZbqfHydJSvmkWV/j1M1rOGMTOhTOtUmMIPJzW5EKzrnQo 8cvQBmSUAzPPQYCecxo5kbjbTxNs/HSPGn9R8C6Zf130B5Uu0EHD6EN6YWGiSmYZx4mcQguQHDx lq0iGAvPMbwd8gRwElFL5NIbBfvrbpcobiKchyWppFldSG45Wn2nrdcD+JyE7sq6d8GQah/sV6J XgmsAIsp3jo1a3i5OtcTVhoeOB34Noga85LfrH0W7tTexu5s X-Received: by 2002:a05:6000:4007:b0:391:2e6a:30fe with SMTP id ffacd0b85a97d-39ee276068emr764099f8f.39.1744751913997; Tue, 15 Apr 2025 14:18:33 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:33 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Mario Six , Tom Rini Subject: [PATCH v2 06/11] sandbox: provide static IP addresses for eth{2, 3, 5, 6, 7} Date: Tue, 15 Apr 2025 23:17:41 +0200 Message-ID: <20250415211819.1254435-7-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 The tests in test/dm/eth.c and test/dm/dsa.c use interfaces that have no static IP addresses configured in the board's default environment file. That will be a problem when NET_LWIP=y because the lwIP stack refuses to send ICMP packets through an interface that doesn't have an IP ("no route to host"). Therefore and in preparation for enabling the sandbox tests with NET_LWIP, provide such addresses in board/sandbox/sandbox.env. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) board/sandbox/sandbox.env | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/sandbox/sandbox.env b/board/sandbox/sandbox.env index a2c19702d64..29197f56e95 100644 --- a/board/sandbox/sandbox.env +++ b/board/sandbox/sandbox.env @@ -8,6 +8,11 @@ stderr=serial,vidconsole ethaddr=02:00:11:22:33:44 eth6addr=02:00:11:22:33:47 ipaddr=192.0.2.1 +ipaddr2=192.0.2.3 +ipaddr3=192.0.2.4 +ipaddr5=192.0.2.6 +ipaddr6=192.0.2.7 +ipaddr7=192.0.2.8 /* * These are used for distro boot which is not supported. But once bootmethod From patchwork Tue Apr 15 21:17:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881394 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665462wrr; Tue, 15 Apr 2025 14:19:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWmmPyILOCdB/E45cvhhNDRgvr6QGnNWf7T/syuSraQtZwkjBZMd0+7Un6Y6Kjs4l/7OmIxiA==@linaro.org X-Google-Smtp-Source: AGHT+IGM020W4xa/wfYrwR+GcuBAbrE2NMq/mUTXyuQkK3Qj6RK8bLy2ri01EubZzpFJ8sLhfFu1 X-Received: by 2002:a05:6102:233a:b0:4c5:1bb6:8165 with SMTP id ada2fe7eead31-4cb52902dcdmr832094137.12.1744751980474; Tue, 15 Apr 2025 14:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751980; cv=none; d=google.com; s=arc-20240605; b=KLs+NTNIvoMJjJXZOx4HzilvPhl7w9p0J3V88leBIirLu6B9sk5fLbfFXhD+DR7u52 SQo8/1x6o0X9r70yMKHSSKzcx4hzvSHP9JrrnygIvtxBF3dXRNIBbjO+GdOK9qwSOjzl d2Lf8LUKBgO2wPpV6KUl4nBDR1FGaPW+r7CF7laVS2ClwLBdkDEtkjIlmW+5XsnAhQ/8 Lw0dlIYvGv2AlBm4w/XC4VHYC/kdtUwxrkRCmBP9N3T9nzsxk6Xb9K12ea3+RrFnuT3T hC2k9+MqHFKVFXewQd8SPAhWspeh0zMfrlMMAoGyNDLZexHx/8kCuGVYcXwXZyW9bo31 wLZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dPapFxm3yxjBtHQRWGN3QR2UhbaPTtk+IO2db1XR8X0=; fh=BUqttbI8eAPp/boSomQ8i1ZMCg0Ovo5TBCwE+yFyXWQ=; b=bna2F35znsdqdoNJto05BbX0LpZw80gNpQXEJEjpHlliSFav36xFjAhhifd0NTbPu7 Hvagt61FrSWx5k/E3EgCMhDTJlSvAAaRAPH/obRfp4JXkTgtwFb9Fbb/wvhtySlguL9T CnD5Z6nN77B0vXPJ/BFs6PScm/Kxg6+G+byWe/Intl1sunf8HBG0D3sQ7Ke2eDg9dmUY AJi3RU4U2nCVcu9C1P0MHMrurDnMtJWff9ef8eLveJBw1MziX7uFo7iPPv07Trs8vorY U3W01efUpCdcLBX22cBNpwvTNGFRoBhFEA02m+JwHZ3qTmfngzYOwhr9/o6KmNXwaSvw UO5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wmk1ht+N; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c9c9890f4bsi5040258137.315.2025.04.15.14.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:19:40 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wmk1ht+N; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F4DC82C2B; Tue, 15 Apr 2025 23:18:40 +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="Wmk1ht+N"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5528782BC8; Tue, 15 Apr 2025 23:18:37 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 4ECA0808AF for ; Tue, 15 Apr 2025 23:18:35 +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=jerome.forissier@linaro.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43cf0d787eeso69789405e9.3 for ; Tue, 15 Apr 2025 14:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751914; x=1745356714; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dPapFxm3yxjBtHQRWGN3QR2UhbaPTtk+IO2db1XR8X0=; b=Wmk1ht+NtAhSaa/uZWwgBfSphaaWFNTyBGseebIy8Q5u09IUd0GaTU4CVswMrrOZbO kcFeoF3JiNi5ywhAPuBCeybcNlwNflu3fCAiSa7eaWoFeKzQdmbq/xk1fgYBjurtQ+SF 8ysIa5bmeKJ5t5+xBbZNBzYMkybpQeOETx5hO5Pk3Ed4B2/3OqqdqwkQv7THmj411dYY gnae70L/dA8peiTM1aJbJSNpi6A6qJDnY0TkbgWprh5qzRCUisFg4y0n3tZzys4IrbgZ xAkUeC3+oc0RBDeYtEQ/aNRnBJsK9BvacsL9Rpgk2S4DK+DdEUGINe0h7I5scLu7j66L tthg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751914; x=1745356714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dPapFxm3yxjBtHQRWGN3QR2UhbaPTtk+IO2db1XR8X0=; b=Dwz/id1dZ6R41UAk1Yg4SQSDIIWAkav5NXfvPEha/w/mdM6g5VzRLZPUVw5g5wwjbe SDIE7R4NWDa0gkic58uws/UH2RB8+aSG7uyYei+ttq05Ne4tToy1tPySpkqk0ZRyBDhl fuN5zTBoiICQDxqDDWKyH4WUB0P+mVhkUDmTsarDLDpGvUHyaPHQAnMZL98b7lymTlTa dzvAtV2ulMz1VFWD1AkV2XgTM0gsC1MRtLaXZaAz/UrsryTX5x1CSFkGnNyTb8htbcBh LjcvdvR2JOq4wgOS/pSnundT+aGk9sfepcolsbkdAf/46Q4OItIvSpqoMHpqPoG6SHSS sKIg== X-Gm-Message-State: AOJu0Yzrv2iUZFHjSekr5HuPcHxkqZ+KRh56XLhf4W0r7aBEHgaejTY0 /0D75Zm3bXdP39b5H/Nut2xisN1ebOS1zy3tTaFd9ntYaJXYM2fZCiHxAjj5dI8dmSVZrq+jCI0 oQNw= X-Gm-Gg: ASbGncupDFD+UyHgunB+g08SOuaqidUGwE7Y5Kv8JbQr2vWOvXUyPn4wTw1ylNHHAax qDWl1IdPFUPp+0vyFDJ1r5g4fW6XBXCfg3AR4+OTUXvy4ARILVllxPVSa87vOrYWRCqNlpUIpPI 2oIyQeq/eJiIJNbRljUd6Rm/qyoInRyCkyS6ExWDMYqj9Bm4Zu2CzIVbgkUzjTOjlNO/IavBDLF r28HCIjMV2H1APyrEMJtLZyLBqlxkjbvm21NxIyPKrjCes3LRtSQLF3ECZZOwSdBJOFrdVul7on eTnQUsu44plBAPTBVwSOcdtLriv3hhk7fiYhDLKU2NkdXqkz X-Received: by 2002:a05:600c:4e47:b0:43c:f895:cb4e with SMTP id 5b1f17b1804b1-4405a0313cfmr5825295e9.17.1744751914622; Tue, 15 Apr 2025 14:18:34 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:34 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Adriano Cordova , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Marek Vasut , Tom Rini Subject: [PATCH v2 07/11] net: ping: make do_ping() available via Date: Tue, 15 Apr 2025 23:17:42 +0200 Message-ID: <20250415211819.1254435-8-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Make the do_ping() function in cmd/net.c a global one by getting rid of the static qualifier, and move the prototype declaration from net-lwip.h to net-common.h. This makes the function available to other parts of U-Boot when CONFIG_NET=y, as was already the case when CONFIG_NET_LWIP=y. This is a peparation step to make the sandbox tests use a common API between NET and NET_LWIP. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) cmd/net.c | 3 +-- include/net-common.h | 12 ++++++++++++ include/net-lwip.h | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/net.c b/cmd/net.c index 79525f73a51..eaa1de5295f 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -456,8 +456,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, } #if defined(CONFIG_CMD_PING) -static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) +int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { if (argc < 2) return CMD_RET_USAGE; diff --git a/include/net-common.h b/include/net-common.h index 0b7edd7d76b..e536968a92b 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -493,6 +493,18 @@ int net_loop(enum proto_t protocol); */ int dhcp_run(ulong addr, const char *fname, bool autoload); + +/** + * do_ping - Run the ping command + * + * @cmdtp: Unused + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * Return: result (see enum command_ret_t) + */ +int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); + /** * do_tftpb - Run the tftpboot command * diff --git a/include/net-lwip.h b/include/net-lwip.h index 0d3bb8a8bd8..b762956e8fd 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -34,7 +34,6 @@ bool wget_validate_uri(char *uri); int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); -int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); #endif /* __NET_LWIP_H__ */ From patchwork Tue Apr 15 21:17:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881395 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665502wrr; Tue, 15 Apr 2025 14:19:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVmHPqfN0ApEPeNzJhtXSaBWJGu/slR7PuSXiXW3n64kIVVF0FOYf4F4LB3GfzSMlLzN8Biew==@linaro.org X-Google-Smtp-Source: AGHT+IEbRyKZKrwjT3c1tmUyoXlmXkCjmu36cAt5lGHaieXV6OEnxmAT2BryzhMh2pqgH1l9c30s X-Received: by 2002:a05:6102:2426:b0:4c1:9780:3830 with SMTP id ada2fe7eead31-4cb52ad07e8mr676946137.23.1744751988796; Tue, 15 Apr 2025 14:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744751988; cv=none; d=google.com; s=arc-20240605; b=AB15ekfGMztSuoNJYQmG+VLfiuAHnCtrRO5VLaC1+rdVH6BvnG2vI3RZFBgrkKFzxn Y0F9NtnkoIl5GAbQbMhQ/VUktzWkFPazU3omNhzqb91sRJlOYOVnUsJEi2ELkFbg+oTA QE1cLdIRAqRh1q6fk2syKnpWt3wMpiQ33tTp4FtkAYSIB97nqgOD27kA9vbCjSa4sBrL 6/Lz/N41ZV3N5F1O767/h0jNXQR1v9utHKGEdUrnNM/96/Ad17Gnb3g5Dxf9u1C453kG EIvjsOL6wzBlB3S5f2VkOS8klc0pF+8NY1AmA6Zc0J+LuyVfZRJhNVb8SW5b5WTCPK70 7pHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ErFDwS1/r/w248TiTv9376n3jwj/iLkxpAWYvgK53Js=; fh=znLBsqjKYrHvjxfYPD99cDZjkW3bTDnk0KOVUJg83EQ=; b=MPWrFjOwDY7WDBXUmw3xu6Nrgax98Mje2ZZdyAba8QBaMAlQotxj4rH5AmUnkrOHVu GU0dn3r6qXP17SUkvh0IfCx1p7NAq5v2R91k9550xD7BQ0/a1zmGLNUdZr9225ux+qoW qn31UUzxshQq5fqOoo+l70oCf5Ir52wvqP2/CcyWHDAFDkmxcy12hEvJT5Dev2bV1bNh ++WrThdQTG2qqASUFMoC+6MeW2NSE+g8p3/SbVgEHH30delV74zHJL9mPMW72URYsCdt /MosGonFlDeYEhHWCqJ9W7PvKG1m7PKW1SEyQ3R5HlXrppK91DgfITGylfXTGpzVEiBx 2vRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ajrblWOn; 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; dara=neutral header.i=@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 ada2fe7eead31-4c9c9891165si4968857137.249.2025.04.15.14.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:19:48 -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=ajrblWOn; 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; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5909282C49; Tue, 15 Apr 2025 23:18:40 +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="ajrblWOn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6891B82BDC; Tue, 15 Apr 2025 23:18:38 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 28D3181E1F for ; Tue, 15 Apr 2025 23:18:36 +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=jerome.forissier@linaro.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-39c1efbefc6so3665713f8f.1 for ; Tue, 15 Apr 2025 14:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751915; x=1745356715; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ErFDwS1/r/w248TiTv9376n3jwj/iLkxpAWYvgK53Js=; b=ajrblWOnIx5a7rlf2db8D593WVD6WL4BPxGHeqYPUa5Rw37TAsdkEp3JIxA8BE8YLp 7l6WUJcMfJHtSZE7/P9Ors65PYNEk9VDFcqgcvCCZSvKskIYOU2TLkI5yCSt8vMP0FnZ J8dK3fAMpLnJG2Pt6KwxEWQnLRH+r7znw8+1YTRkiN1TaJuaEVBLo/tqDrjLuWKcdYPC +50yx6MQr/dYoEn1KYKqdYh3EOD6w8UljAM4Rqka82shx1Ondy2k/P0sPxQnkPZ4mByK xMwvzQE5Rgm69HWK7ZT1QS/OFphBAIFdcX4PxvW64GVAevzWxibj2LhNbmJaHudtsJM9 4KaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751915; x=1745356715; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ErFDwS1/r/w248TiTv9376n3jwj/iLkxpAWYvgK53Js=; b=YgqpcxE2oV6hNfn/tvsjJ74PC7vOl42tglBkIL5WUyainPdZYtxrBd0K0TvhSo8bgN lVme5L77L0bjAzRVI1uN4Zra+bGFKNEzupwPqdXLPZ9n7hDWlhNsiMRSNVVGCPwhvTIg tz0HmXDcTLwtUPOooriG7Ug/EwL+hcF1xGNNJegF9JtcF2dDk9t9LpOPNzEDMb19q6+7 8a+6oCqiSKF5q75Cn9yuygRx/JCoQhfBjm6TorBYOYoCKMkJLIddyVJ8H2yfLCZt9No5 OnLORV4qNLwJrf8xrGGNUwiD3ainJG4tp6ND/xzrhm/z2vNheEXaCURjN5i3JMaXqrwQ 4/LQ== X-Gm-Message-State: AOJu0YyGfDAyWjzV/kaLgnp7ID3QlBtf6q3AHA7zXDAuyxwTNbl02/RS VC9+1wwPCPkgkqSisXl4RkDJSDGchf8+d9txOhNBx9xtqio4k+tjI1n+jvysd7loYnvdP3UXK/f o8Ec= X-Gm-Gg: ASbGnctXSWGgcexkHb54aNti8PWl2kCpb9WOTxxJTC6mKvPLcrfnedrv8/zCQwqoQeN bVLjAKTNnPqpDfIkBnWEMosYglJn+NsWrotKqmLTTqMgfG68VwkJxM0BTjZVVc8Azn9SoI5iZOF 0GU+msei2nu3ZJ52lrYDxTehVDTGmGyDzXZu4p542QW4orjlhV8iw+JC9XQo5c1uRRA/daK6nzG Xx2/09UHthOmX7jxFbv33BqPaRusErkOsJA8TmBFtNjIwYbVoNwlMJEY7PuNzZONh0qiewqpayF AOLIhOWS0l+mafDckRpVK8uUEsz4wU2+AddL9PSu795/7AUT X-Received: by 2002:a05:6000:2913:b0:391:3094:d696 with SMTP id ffacd0b85a97d-39ee27706e6mr827274f8f.54.1744751915290; Tue, 15 Apr 2025 14:18:35 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:35 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Ilias Apalodimas , Marek Vasut , Svyatoslav Ryhel , Tom Rini Subject: [PATCH v2 08/11] test: dm: eth, dsa: update tests for NET_LWIP Date: Tue, 15 Apr 2025 23:17:43 +0200 Message-ID: <20250415211819.1254435-9-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Convert the tests to use the do_ping() interface which is now common to NET and NET_LWIP. This allows running most network test with SANDBOX and NET_LWIP. A few things to note though: 1. The ARP and IPv6 tests are enabled for NET only 2. The net_retry test is modified to use eth0 (eth@10002000) as the active (but disabled) interface, and therefore we expect eth1 (eth@10003000) to be the fallback when "netretry" is "yes". This is in replacement of eth7 (lan1) and eth0 (eth@10002000) respectively. Indeed, it seems eth7 works with NET by chance and it certainly does not work with NET_LWIP. I observed that even with NET, sandbox_eth_disable_response(1, true) has no effect: remove it and the test still passes. The interface ID is not correct to begin with; 1 corresponds to eth1 (eth@10003000) as shown by debug traces, it is not eth7 (lan1). And using index 7 causes a SEGV. In fact, it is not the call to sandbox_eth_disable_response() that prevents the stack from processing the ICMP reply but the timeout caused by the call to sandbox_eth_skip_timeout(). Here is what happens when trying to ping using the eth7 (lan1) interface with NET: do_ping(...) net_loop(PING) ping_start() eth_rx() sb_eth_recv() time_test_add_offset(11000UL); if (get_timer(0) - time_start > time_delta) ping_timeout_handler() // ping error, as expected And the same with NET_LWIP: do_ping(...) ping_loop(...) sys_check_timeouts() net_lwip_rx(...) sb_eth_recv() time_test_add_offset(11000UL); netif->input(...) // the packet is processed succesfully By choosing eth0 and sandbox_eth_disable_response(0, true), the incoming packet is indeed discarded and things work as expected with both network stacks. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) test/dm/Makefile | 2 -- test/dm/dsa.c | 8 ++--- test/dm/eth.c | 77 +++++++++++++++++++++++++++--------------------- 3 files changed, 47 insertions(+), 40 deletions(-) diff --git a/test/dm/Makefile b/test/dm/Makefile index 3afcc26ca57..917dafe7d22 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -46,9 +46,7 @@ obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi_host.o obj-$(CONFIG_DM_DSA) += dsa.o obj-$(CONFIG_ECDSA_VERIFY) += ecdsa.o obj-$(CONFIG_EFI_MEDIA_SANDBOX) += efi_media.o -ifdef CONFIG_NET obj-$(CONFIG_DM_ETH) += eth.o -endif obj-$(CONFIG_EXTCON) += extcon.o ifneq ($(CONFIG_EFI_PARTITION),) obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fastboot.o diff --git a/test/dm/dsa.c b/test/dm/dsa.c index c6b4e12a758..9a31ae39d95 100644 --- a/test/dm/dsa.c +++ b/test/dm/dsa.c @@ -63,15 +63,15 @@ DM_TEST(dm_test_dsa_probe, UTF_SCAN_FDT); */ static int dm_test_dsa(struct unit_test_state *uts) { - net_ping_ip = string_to_ip("1.2.3.5"); + char *argv[] = { "ping", "1.1.2.2" }; env_set("ethact", "eth2"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); env_set("ethact", "lan0"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); env_set("ethact", "lan1"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); env_set("ethact", ""); diff --git a/test/dm/eth.c b/test/dm/eth.c index 467495863e1..1087ae9572d 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -171,18 +171,18 @@ DM_TEST(dm_test_ip6_make_lladdr, UTF_SCAN_FDT); static int dm_test_eth(struct unit_test_state *uts) { - net_ping_ip = string_to_ip("1.1.2.2"); + char *argv[] = { "ping", "1.1.2.2" }; env_set("ethact", "eth@10002000"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10002000", env_get("ethact")); env_set("ethact", "eth@10003000"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10003000", env_get("ethact")); env_set("ethact", "eth@10004000"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10004000", env_get("ethact")); return 0; @@ -191,22 +191,23 @@ DM_TEST(dm_test_eth, UTF_SCAN_FDT); static int dm_test_eth_alias(struct unit_test_state *uts) { - net_ping_ip = string_to_ip("1.1.2.2"); + char *argv[] = { "ping", "1.1.2.2" }; + env_set("ethact", "eth0"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10002000", env_get("ethact")); env_set("ethact", "eth6"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10004000", env_get("ethact")); /* Expected to fail since eth1 is not defined in the device tree */ env_set("ethact", "eth1"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10002000", env_get("ethact")); env_set("ethact", "eth5"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10003000", env_get("ethact")); return 0; @@ -215,18 +216,18 @@ DM_TEST(dm_test_eth_alias, UTF_SCAN_FDT); static int dm_test_eth_prime(struct unit_test_state *uts) { - net_ping_ip = string_to_ip("1.1.2.2"); + char *argv[] = { "ping", "1.1.2.2" }; /* Expected to be "eth@10003000" because of ethprime variable */ env_set("ethact", NULL); env_set("ethprime", "eth5"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10003000", env_get("ethact")); /* Expected to be "eth@10002000" because it is first */ env_set("ethact", NULL); env_set("ethprime", NULL); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10002000", env_get("ethact")); return 0; @@ -249,6 +250,7 @@ DM_TEST(dm_test_eth_prime, UTF_SCAN_FDT); */ static int dm_test_eth_act(struct unit_test_state *uts) { + char *argv[] = { "ping", "1.1.2.2" }; struct udevice *dev[DM_TEST_ETH_NUM]; const char *ethname[DM_TEST_ETH_NUM] = {"eth@10002000", "eth@10003000", "sbe5", "eth@10004000"}; @@ -258,7 +260,6 @@ static int dm_test_eth_act(struct unit_test_state *uts) int i; memset(ethaddr, '\0', sizeof(ethaddr)); - net_ping_ip = string_to_ip("1.1.2.2"); /* Prepare the test scenario */ for (i = 0; i < DM_TEST_ETH_NUM; i++) { @@ -281,7 +282,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) env_set("ethact", ethname[0]); /* Segment fault might happen if something is wrong */ - ut_asserteq(-ENODEV, net_loop(PING)); + ut_asserteq(CMD_RET_FAILURE, do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); for (i = 0; i < DM_TEST_ETH_NUM; i++) { /* Restore the env */ @@ -334,15 +335,17 @@ DM_TEST(dm_test_ethaddr, UTF_SCAN_FDT); /* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1(struct unit_test_state *uts) { + char *argv[] = { "ping", "1.1.2.2" }; + /* Make sure that the default is to rotate to the next interface */ env_set("ethact", "eth@10004000"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10002000", env_get("ethact")); /* If ethrotate is no, then we should fail on a bad MAC */ env_set("ethact", "eth@10004000"); env_set("ethrotate", "no"); - ut_asserteq(-EINVAL, net_loop(PING)); + ut_asserteq(CMD_RET_FAILURE, do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10004000", env_get("ethact")); return 0; @@ -350,14 +353,16 @@ static int _dm_test_eth_rotate1(struct unit_test_state *uts) static int _dm_test_eth_rotate2(struct unit_test_state *uts) { + char *argv[] = { "ping", "1.1.2.2" }; + /* Make sure we can skip invalid devices */ env_set("ethact", "eth@10004000"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("eth@10004000", env_get("ethact")); /* Make sure we can handle device name which is not eth# */ env_set("ethact", "sbe5"); - ut_assertok(net_loop(PING)); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); ut_asserteq_str("sbe5", env_get("ethact")); return 0; @@ -368,9 +373,6 @@ static int dm_test_eth_rotate(struct unit_test_state *uts) char ethaddr[18]; int retval; - /* Set target IP to mock ping */ - net_ping_ip = string_to_ip("1.1.2.2"); - /* Invalidate eth1's MAC address */ memset(ethaddr, '\0', sizeof(ethaddr)); strncpy(ethaddr, env_get("eth6addr"), 17); @@ -396,6 +398,7 @@ static int dm_test_eth_rotate(struct unit_test_state *uts) /* Restore the env */ env_set("ethaddr", ethaddr); } + /* Restore the env */ env_set(".flags", NULL); @@ -406,26 +409,28 @@ DM_TEST(dm_test_eth_rotate, UTF_SCAN_FDT); /* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_net_retry(struct unit_test_state *uts) { + char *argv[] = { "ping", "1.1.2.2" }; + /* - * eth1 is disabled and netretry is yes, so the ping should succeed and - * the active device should be eth0 + * eth0 is disabled and netretry is yes, so the ping should succeed and + * the active device should be eth1 */ - sandbox_eth_disable_response(1, true); - env_set("ethact", "lan1"); + sandbox_eth_disable_response(0, true); + env_set("ethact", "eth@10002000"); env_set("netretry", "yes"); sandbox_eth_skip_timeout(); - ut_assertok(net_loop(PING)); - ut_asserteq_str("eth@10002000", env_get("ethact")); + ut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); + ut_asserteq_str("eth@10003000", env_get("ethact")); /* - * eth1 is disabled and netretry is no, so the ping should fail and the - * active device should be eth1 + * eth0 is disabled and netretry is no, so the ping should fail and the + * active device should be eth0 */ - env_set("ethact", "lan1"); + env_set("ethact", "eth@10002000"); env_set("netretry", "no"); sandbox_eth_skip_timeout(); - ut_asserteq(-ENONET, net_loop(PING)); - ut_asserteq_str("lan1", env_get("ethact")); + ut_asserteq(CMD_RET_FAILURE, do_ping(NULL, 0, ARRAY_SIZE(argv), argv)); + ut_asserteq_str("eth@10002000", env_get("ethact")); return 0; } @@ -434,8 +439,6 @@ static int dm_test_net_retry(struct unit_test_state *uts) { int retval; - net_ping_ip = string_to_ip("1.1.2.2"); - retval = _dm_test_net_retry(uts); /* Restore the env */ @@ -446,6 +449,7 @@ static int dm_test_net_retry(struct unit_test_state *uts) } DM_TEST(dm_test_net_retry, UTF_SCAN_FDT); +#if CONFIG_IS_ENABLED(NET) static int sb_check_arp_reply(struct udevice *dev, void *packet, unsigned int len) { @@ -511,7 +515,9 @@ static int sb_with_async_arp_handler(struct udevice *dev, void *packet, return sb_check_arp_reply(dev, packet, len); } +#endif +#if CONFIG_IS_ENABLED(NET) static int dm_test_eth_async_arp_reply(struct unit_test_state *uts) { net_ping_ip = string_to_ip("1.1.2.2"); @@ -529,7 +535,9 @@ static int dm_test_eth_async_arp_reply(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_eth_async_arp_reply, UTF_SCAN_FDT); +#endif +#if CONFIG_IS_ENABLED(NET) static int sb_check_ping_reply(struct udevice *dev, void *packet, unsigned int len) { @@ -613,6 +621,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_eth_async_ping_reply, UTF_SCAN_FDT); +#endif #if IS_ENABLED(CONFIG_IPV6_ROUTER_DISCOVERY) From patchwork Tue Apr 15 21:17:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881396 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665601wrr; Tue, 15 Apr 2025 14:20:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX9RxnD/f1VVXg4TVPzvtyoZrqi2kzxXq3uZittFHjhfQeXrIljdl0aiTZ1snYMgFmqC8AB/w==@linaro.org X-Google-Smtp-Source: AGHT+IHiRrpsIX0KdzgF6YiUVsHHZcsjz0SbaiQGsOi7o5tV9zwUPEo9bxKkOend1mcp2o9hb2HK X-Received: by 2002:a05:6122:3127:b0:527:b7a3:dda8 with SMTP id 71dfb90a1353d-529087ac098mr1282344e0c.7.1744752003864; Tue, 15 Apr 2025 14:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744752003; cv=none; d=google.com; s=arc-20240605; b=HKe3E95+9O+z0NkU3sPQ70OnEccsF+dPIEbfK4vHjGtR3/etDTsmn/22QfJ90dp3am j4F0TZNLJUJK1ZGPXGRizUbL2dcl8BwIjxSE/G6HgvWqUoa2YqV7wqrM7Fs5+EXddpx3 +HN7xYA//WDI53kRulACe8aW9KUqQKYm7JyLZ4ITE+Nxd7+moWJ3DmmTp8fAIb89/n0o Y9oYgshXoKIxFDlFguOZJnzkGBLwV3iSTQ1wvReg35v2QLrQDNH5pBfaCw48IUfHv32j w4QEqMskEXCOyuDonfQPdOEg7TuunH9LFqVTRqduMwaBviesQ3U1QEgG9sJ8+7Jd3OTb fNjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O0Zm8Na5fwVuYfu9BObkGOuH/jGZrLK/SEqltjGvPys=; fh=9I/Bup1yInh5+2TidOqO5NsiFRRgC8i53au05tioTZI=; b=VvWDYnPkGV7FGovrH70gA3Bch2OwURBtFaEvnif3LRnBll0sd+dTKuvBjCTSpF7S1j +mKPHaZVi0d4/9wyjB5u8kZdW39iGzmSfX3VWl9S4qKN7j2OfyNVn9LB0wQ40Hk6r3ZP Yxbuq3dYKjZ+RyuN35YwhWG5MBQ/5l0UobhBMkf4eiQCYGSYt+vBO7kWXxSEwSz9zELj LSLADkzpVI/MHAdY+T4p2GI6CPmySVt29rFy+iPLaeRsRYFpxzywlhawrmgLOXxwzh2H Cep1armo8TkG1a+5BBrZ7RRPfKgor2N6QCgRSKnD0iXfYRC1SZOLaWtTvGOTM+dRqWXB sRWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zM8GiUT8; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 71dfb90a1353d-527abd47ba2si4983648e0c.41.2025.04.15.14.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zM8GiUT8; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6061C82BBF; Tue, 15 Apr 2025 23:18:43 +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="zM8GiUT8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B19A82BF6; Tue, 15 Apr 2025 23:18:39 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 067C381F0D for ; Tue, 15 Apr 2025 23:18:37 +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=jerome.forissier@linaro.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43cfb6e9031so56106825e9.0 for ; Tue, 15 Apr 2025 14:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751916; x=1745356716; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O0Zm8Na5fwVuYfu9BObkGOuH/jGZrLK/SEqltjGvPys=; b=zM8GiUT8xw+IZC46ZYh89bm8L7JiMNGw5yWSd0fSK8tpzO0qLA5j8mpSjsK9rWh1fQ lZnUuADp5Uf9hVXcmmKc0gZC6zdZPQ3XOLinjlmG8DvhkPjPIdbbzACSAHoClCnPk+yr MCnbPLNLvq3tW4LM7tTwDb9fvmT/9lO5+CJnrTVV9zxpulZjnZtUDuPkZptdyWxJg1ii Rm2xHbC++wDDZhAHwcrOedoXja1wKKMZD/mP0GXCF2FA5dSeSAawx51T1/BIWnJRhQXw gGfp/0d3me/Wd9tel014WN9/HzZVm3vZmjjjM8yNW6xjBPNytXXrU9Yuelo7HtwpXFtb qaZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751916; x=1745356716; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O0Zm8Na5fwVuYfu9BObkGOuH/jGZrLK/SEqltjGvPys=; b=XSOmAjfsWTMRRw57m+lfeYsTWETR+ZGBcTo3jwd4tNF04h+saS0G3pQX4ol8ytd4+J ImtTRYYXN+L9U30BxUAGExmSJI2tg/F86/gR0vKqHwgTrduqSuFoj2OVUR9wq+6ZAnK2 h9aH9Fqer6IWONhGpyBEcmNsdzrHJg+YViIEW82zsa+yb5JyTwVKw6fhldIPR3cskVi5 A/cSWlEscW0Ybw0xr8NnJHHxovZx9ve98lq0PC8cBADaC82kzb0txJCI/4wGO6635G5N EYLNVybnKPLZEd85figMV1xEV/KhYtlhmItD6B1sms48ZAd468h1CY9AfBmt9kfVNdFn sakA== X-Gm-Message-State: AOJu0YyuFCjyJbag/dPeTBAq7NLWSv+wIh1SEdIkSAt/GNfj3C59OI8V YuGW+OqPSHEMlA04fyqDt7fdo4GTPjwgw0Xjr+smbSLV9Vv8mPVMVnfLprNvgPJSuHOK4OFBEl+ e7gY= X-Gm-Gg: ASbGncuwpxyRy9G5P1axr+bokAh4toMufSXVHcT3WrEgTgvBnk4bw2ErL9TNGBmW7NB GyB5+NpYhOjyZRDaspdAr60GnX449f+mzfIJbgUIwb3vSh3gdt1mlSgzEmTQf7L+5DGQm04oRyi C/OkV+5zxvSf886lldJJrJ+CJ4oHfspF+43jKmwq2XDMQ6tYi6D/R2hcrjhyLggciHe/SsPHUY1 r3rBHcEYA36TiPNluQ9kxuftnoj1JMcASMejqOgRIy0i8vBSGxWw4IKPzoi4WB9zs6dUxoLzTfo GlD9ju1s7tL5vQx3MsMM+ZPG5lJSlRHqIoDTl/kp0Cn7l2UNk/wX9RkJOyo= X-Received: by 2002:a05:600c:8709:b0:43d:683:8cb2 with SMTP id 5b1f17b1804b1-4405a015cb2mr6233295e9.14.1744751916112; Tue, 15 Apr 2025 14:18:36 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:35 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Adriano Cordova , Boon Khai Ng , Hanyuan Zhao , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Marek Vasut , Ramon Fried , Romain Naour , Tom Rini , Weijie Gao Subject: [PATCH v2 09/11] net: lwip: allow DM_DSA=y when NET_LWIP=y Date: Tue, 15 Apr 2025 23:17:44 +0200 Message-ID: <20250415211819.1254435-10-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Now that the DSA tests in test/dm/dsa.c are compatible with NET_LWIP, remove the dependency of DM_DSA on NET. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) drivers/net/Kconfig | 1 - net/Makefile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 933bad9b00b..3d338a81e81 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -48,7 +48,6 @@ config DM_DSA bool "Enable Driver Model for DSA switches" depends on DM_MDIO depends on PHY_FIXED - depends on !NET_LWIP help Enable driver model for DSA switches diff --git a/net/Makefile b/net/Makefile index 41edbacabc9..d63f62b7c8a 100644 --- a/net/Makefile +++ b/net/Makefile @@ -11,7 +11,6 @@ obj-$(CONFIG_NET) += arp.o obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o -obj-$(CONFIG_DM_DSA) += dsa-uclass.o obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o obj-$(CONFIG_IPV6) += ndisc.o obj-$(CONFIG_$(PHASE_)DM_ETH) += net.o @@ -39,6 +38,7 @@ CFLAGS_eth_common.o += -Wno-format-extra-args endif ifeq ($(filter y,$(CONFIG_NET) $(CONFIG_NET_LWIP)),y) +obj-$(CONFIG_DM_DSA) += dsa-uclass.o obj-$(CONFIG_$(PHASE_)DM_ETH) += eth-uclass.o obj-$(CONFIG_$(PHASE_)BOOTDEV_ETH) += eth_bootdev.o obj-$(CONFIG_DM_MDIO) += mdio-uclass.o From patchwork Tue Apr 15 21:17:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881397 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665656wrr; Tue, 15 Apr 2025 14:20:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlEP8tU/MBfAqRw6kDUvc0RMLsK7PuT/JdQFx1try2VaQ7hvSacKWxeFvgYq4driFYO45iZg==@linaro.org X-Google-Smtp-Source: AGHT+IFKjZj4YobIq/Ivzoc8rhn01tHABium3SnPcxYAVil3OyUjkdkoUvDcHug6JFmpmAAhv8vZ X-Received: by 2002:a05:6102:6a98:b0:4bb:9b46:3f71 with SMTP id ada2fe7eead31-4cb52896324mr798848137.8.1744752013183; Tue, 15 Apr 2025 14:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744752013; cv=none; d=google.com; s=arc-20240605; b=Rw3tx42v/qclLTjnvIDxCap2mOVNsPRDz8+irhHuVeIvfWiegSl4nlISDXxA7I8TDv JOgQCEUtkRyD8LPzpRIYTnyFpZeIsUBk87YbVV4QlKyWu/d/I4SYnthf5yjgleA2re7l NBar9GtTvc4RcNS3/kjHhOyJMwfMAcD0DE7f/BWSYs3OhNHvg6Hw6WYM0m4PWGeOTPgU y+WNBNPNO33LguaOmEGEehiAv+HrtR+BafE98N0FsepyaUFtryC7jBayKxwm2FRGcqxO vjoUraKKtXK6NQuFffCe7NdgRkp1LGZj3bZ7qNYtu+QygQZC6ofpTS59GiPaZ9oHoi/K ynkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cdMU/EbfK6U0f1W9N0eR+lOtwJhaDFZbo9KfaF/CUyg=; fh=RGwgpjXm6226xsHa4hVzOOKFz+g4P28uvt2JCVcO0E8=; b=BqQa8xGebPHLP6UhutFj452W2o0CPPoP43p9gsa1+tt0IRGqLJywmYbjia383sPBii 5/Td7IGmJ5I0fzmZr/WPPvQVnuisjqAeeq1mT8h0pxa0pguLHM1wy4chtM2/uJNMzqu4 jadLtI31rJ7VXnb1dsQqgRE5oQNOTYKx09T6AV5+Awjv9NqQfFw/jRUEUMtTs5oDoIwC FvrDTfWuSK6YAULarYswvXqYkUDQ7zN/tAkSzMA/1OIJBTSFlIzhLG/7LH8Dt4jM9e44 /1qMEpiAcGViEO5F2vVoFMc4ksUYBhiRxFA6zT/1Zd/xZrQU+g8XueYd0ukk5cWwI8/8 0yqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrbJu3bb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c9c98bd278si5045025137.358.2025.04.15.14.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrbJu3bb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A141C82BF2; Tue, 15 Apr 2025 23:18:43 +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="qrbJu3bb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49B53820F8; Tue, 15 Apr 2025 23:18:39 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 530C482BD7 for ; Tue, 15 Apr 2025 23:18:37 +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=jerome.forissier@linaro.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3914bc3e01aso3472201f8f.2 for ; Tue, 15 Apr 2025 14:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751916; x=1745356716; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cdMU/EbfK6U0f1W9N0eR+lOtwJhaDFZbo9KfaF/CUyg=; b=qrbJu3bbpilGZ22JuaIivtJH5nUgV+8MQw/5vjtrmdxzaBRJbcPvMPh1PTKkkLz7MR 2UJdUyyvgw+l7TQhI228TY66Rl1yBKoXmj6swjQxcjtAzlx+PYt5h6/V3IZD6sY6XWNx pJQNlzATYCcbdVvf5jwvI+GbZLEsFLIMBgCYc/oTUQQTrOH14mB9qerwmHdonJ2OKJxR KLPhMEv6sRDAT8Ox9oGkMFol0qHIyWDV9rCHMonqa75J16FZHnv7RzbIt3TrnzZk8api jEBdpVZ8gkeSciQpGIJcuqWa/EQzWazC2sMAgBJbrzpJbcOxU7wSifzy7a0enLbVaaqe Gzxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751916; x=1745356716; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cdMU/EbfK6U0f1W9N0eR+lOtwJhaDFZbo9KfaF/CUyg=; b=Ex9YUz4FCLR9My+t8vTwanyVCSkhb9vyZoXUn3QSCiWRHUC9ToqQh/WyLMVCqPxRat bRXlnlyxsAm+Wz8zOpa0VeqIyqBLddPkTsoMb1jktHVGgaom2KGoZ8OpYtUUVjeyPjD/ mHv57/0o/4fVjngkNfEZFHUPcUkLRkiDRRtIWr2izgknz1hr749Ha4Dd3cX0awsvabkE R3LLjLRY/NF+t8CBMEPWgmtm7aAT6nT4a9D4QefalqUrbLcnbKwTl7vCOJQUfq8AHkMT nU8KQr9mSEyRFSJ2a3Ju5rlOqCKHpaReWV654kuE3BPjBxdzeAcu1NLDHX32OzJcclPq 3itQ== X-Gm-Message-State: AOJu0YxiLr2lfUVADKHINabW21RuGOKx2o+LTfnUVjJNo+p4BZ3W2U8Q o6VN/M7DryS0xkSuGP5NkxJ1Or5gRpP0U0UiZw07Q1bN+y88kskzegQGTDv8g5CNxvlP+eOr4xG YOwI= X-Gm-Gg: ASbGncsjSz/RV7+H9KHhPgKtAWE0DxyfqUpyt7gh4huuv2NOhpm1uYLjWHIGcizGoqr c1NELuW2yWM4vMCzdadcpf4On8P+W6hyR7GMYVMYcG8VsMV4rNJCILzCfcwO3ThfJ9AT+qKeN1X bKBIlpVWmYTBWlmCWUawzAt8ANAHbR2DLuOVGOeVtN1/9SWYBevoCghXvIFCdxIr4tSE56R4TBi hykAZxfL1pi4u4nWv5tKlw6ZeGWL0miApy5lSB1Rm0Nb4Cx6WkWtXARGbOUQW1pSM8GbHg5OUG2 6QpYIg78S0ZZZg9XiX/zopNRatmsatbjaWvI3Oh5GRxZce6sQ++ydzffuzA= X-Received: by 2002:a5d:59a7:0:b0:38f:503a:d93f with SMTP id ffacd0b85a97d-39ee27610camr757771f8f.40.1744751916684; Tue, 15 Apr 2025 14:18:36 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:36 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Tom Rini Subject: [PATCH v2 10/11] configs: add sandbox64_lwip_defconfig Date: Tue, 15 Apr 2025 23:17:45 +0200 Message-ID: <20250415211819.1254435-11-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Add sandbox64_lwip_defconfig based on sandbox64_defconfig with NET_LWIP enabled. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) configs/sandbox64_lwip_defconfig | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 configs/sandbox64_lwip_defconfig diff --git a/configs/sandbox64_lwip_defconfig b/configs/sandbox64_lwip_defconfig new file mode 100644 index 00000000000..0e92728533f --- /dev/null +++ b/configs/sandbox64_lwip_defconfig @@ -0,0 +1,5 @@ +#include + +CONFIG_SANDBOX=y + +CONFIG_NET_LWIP=y From patchwork Tue Apr 15 21:17:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 881398 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp665721wrr; Tue, 15 Apr 2025 14:20:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXlPupZBIvTBRUhhf5yAHj6QTz+tUwDTPRPD8/zF+rbodQ5SIkff5LQ0jfb7OnSF8iAw07aFw==@linaro.org X-Google-Smtp-Source: AGHT+IEPktbpslldhFnCaYFsGMRl+bqsnlSq4poVDgdqrSjv/zI65lsEEJaPU8oSdsQWBsW9ThOk X-Received: by 2002:a05:6102:53ce:b0:4b2:c391:7d16 with SMTP id ada2fe7eead31-4cb529087e3mr684717137.7.1744752022569; Tue, 15 Apr 2025 14:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744752022; cv=none; d=google.com; s=arc-20240605; b=lHK/hg9N3l8pL0KKwGauRHxsdK6HB/zTAQZXRjRQ03K4hw3tCXrEH6sSZfCUjdtQqU 95C1v6IHTQBl5e5Ob2ix5qFa612gyvmG5SFOpY+3xrsZIrTNpmTN0Nj7/wxRoEHdLMFC 3GgitCXWmw7z0VT1WxyQHidxqL2nQCdE0MpqofEtOUo/BloEB7TkJXv9JIre7/K+OSRc JjAflCZ7KS15gUq1VfObzLHJZtM/psh1IcYlFYOA96JvtpwWGOl1WN1543TbRjKWhs8u vomitTucRBqq0P1w0sP38o9QXBWVpZyvEGSgAU4f8dypGaIttqW16aWV30wpnrlFqQue TbmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LkP5Bcms/nyn0YXLuMG2fTx1wYMuCd6jOe/gbm85Qj4=; fh=UI+qadiwcVnkACF2Lc8Z++Cqx0eQZnmBlAGjwyinHFA=; b=foWLBJSThShLnwbZ+hOpNSGb/5aAXVYsRBfKf/rWBftnlckFh4RF8VJ267Oct6f8If YrWOdn5xafK0tVkZv3amJv/8nruiTkoehm1IQtVLZJ1PPeooXissa5JfTXUoMfPvQzai cTUAFWDNMo4SAP+2i48DDnDW2mmiinxFc5DDE9fWkfZwEN/P6XhENAkt/lLh5u7Uk/31 SqoaIGXGmD4fzSrBfnm0/T31p/Z1qxU0O/PQDShPsNkdKufBsRN9ZmIL2+5OC40alQYp QOOgbBcA3lbpa0LqSzC/Y/ZFRI7Rkpzgn/tZcqKqVT/nmpi4IvOhxqv665FUkbM7h2qK kjcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RQ25774L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c9c98c1ef2si5171910137.378.2025.04.15.14.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:20:22 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RQ25774L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F0A6C82C44; Tue, 15 Apr 2025 23:18:43 +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="RQ25774L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB6BB82C2B; Tue, 15 Apr 2025 23:18:39 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 DF23482B53 for ; Tue, 15 Apr 2025 23:18:37 +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=jerome.forissier@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-39c30d9085aso3859790f8f.1 for ; Tue, 15 Apr 2025 14:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744751917; x=1745356717; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LkP5Bcms/nyn0YXLuMG2fTx1wYMuCd6jOe/gbm85Qj4=; b=RQ25774LAlPqRVet6yE5ot88VkmYcATYdrraMnrFXYZC599CPyqYeBZCgmRqDzIzyt a9IRr9shBKuzG0ddzqorDvZyFyCxha4Oy30HLm8RUG5YZKT46aw+QSOtCfmIh2G93veE cWsfD/kQi49mBZtrfkLRTJu3s1OfmO5ddkvOaVRAT8kXXNvzH9d7TAmBP9i6V1nHfQ5b 1wMEPYtbqSnyxljUFc5a6544XjA6tpZPscKW7qbZyaWcvTud6XjO/i/WlmDmY4U1S8OC V5Ct1bMnC9dRAOXjcGMvb1HiayldQJNo2LJsuCudOGOpzlwLSeZCUtleXVqkRfPrAq90 MofA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744751917; x=1745356717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LkP5Bcms/nyn0YXLuMG2fTx1wYMuCd6jOe/gbm85Qj4=; b=aW+fAdeUWjiRw4bs0CRpINKa1bLrqaRM8YuoXKnCYr/8eWRvjQ4t4lBz1TteA6HWZF Kft0jqadsAil9cUFDmEs0xzw+sXV7rEYTDFLL6LEJS0pGgIAYxwvmJBUw+Jug6AheUlD TtuS0U4L9sekINDIhM4BpNxkB4/qZeQfVV7ddz3yoOOom9QQE93bnCIFn71SYdpsWER6 hORhBqjDXLLD2aj+pfeDuDa2tKHBZI7oFkRGdX6U8rcGCT8gxXO3Ka+034pVocBRG2Nf grme+zIouP8J4MTwK+gvhyLJQsA/hwa5CiNyKfAyyzqWyzkxPFfo9SrGgHAbqOuE4kYa X5pA== X-Gm-Message-State: AOJu0YxUIHyfc2qJkH9kAcCbTedaC1vPUXhQFeL03xWT+zyRb4zPFyhj utJdX+zpAC4yMs0U+waGjO22rYUQZW8ZPinjf7tmwYHSwy+97pmQGzhaKiNU3QCYOO1ty5tDdIj VvrQ= X-Gm-Gg: ASbGncvgtk9sDe0yioN07V+zgS+U1kBmRQ2Jc2TFmVAPct2jZYSw10LYlt98ymPWrfN I+lSam8b55ojG4+mhfBob4ztPYcT9sDFfkKA9MqLpfA58h/G4OKWK13Ua1mrh84ihQ98RNJaanK pq/pXov3AkJE+xFh6j7xu5pPWDTddtAPxCiblwahdWOguWVuhmetEcT9a/r5gZRsd1/LO4JKVWV KZrPbAlY7OGDIcryuZcZ1pISi3MRlObJkAb0MLBytckznAHMN/XZnKHTMt4PHzVYxzcwBXGXEv1 yjyKgQpiRHOeBjkD327RCVJAb57xCxJXctMOwBv1iZoQrE3T X-Received: by 2002:a05:6000:22c2:b0:390:e5c6:920 with SMTP id ffacd0b85a97d-39ee272a0e6mr872158f8f.3.1744751917254; Tue, 15 Apr 2025 14:18:37 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 14:18:37 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Simon Glass , Ilias Apalodimas , Jiaxun Yang , Patrick Rudolph , Tom Rini Subject: [PATCH v2 11/11] CI: add sandbox64_lwip Date: Tue, 15 Apr 2025 23:17:46 +0200 Message-ID: <20250415211819.1254435-12-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250415211819.1254435-1-jerome.forissier@linaro.org> References: <20250415211819.1254435-1-jerome.forissier@linaro.org> 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 Add sandbox64_lwip_defconfig to the list of tested boards. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- (no changes since v1) .azure-pipelines.yml | 2 ++ .gitlab-ci.yml | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index cb787d32f14..01ab0c11f98 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -350,6 +350,8 @@ stages: sandbox64_clang: TEST_PY_BD: "sandbox64" OVERRIDE: "-O clang-18" + sandbox64_lwip: + TEST_PY_BD: "sandbox64_lwip" sandbox_spl: TEST_PY_BD: "sandbox_spl" TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f3418e482f..145bdad83bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -290,6 +290,17 @@ sandbox64 with clang test.py: OVERRIDE: "-O clang-18" <<: *buildman_and_testpy_dfn +sandbox64_lwip test.py: + parallel: + matrix: + - HOST: "fast arm64" + - HOST: "fast amd64" + tags: + - ${HOST} + variables: + TEST_PY_BD: "sandbox64_lwip" + <<: *buildman_and_testpy_dfn + sandbox_spl test.py: variables: TEST_PY_BD: "sandbox_spl"