From patchwork Thu Mar 6 14:32:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 870827 Delivered-To: patch@linaro.org Received: by 2002:ab3:6e57:0:b0:290:25b2:841c with SMTP id w23csp460913ltm; Thu, 6 Mar 2025 06:33:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWf1yrb88xJbYiTLiw5UH4bevIjW5Vb6dVLqJMvEeSaiWKFwtsDlC1du7eqBwqOCcYKgEJnKw==@linaro.org X-Google-Smtp-Source: AGHT+IFPJqleGQJEdWMeaW1ncEhAYlEZpNBPLeO1h2Nbz5fRwezukBS0pE7/u4UppT8lW7hwxd2Q X-Received: by 2002:a05:6a20:9185:b0:1f3:194b:30ae with SMTP id adf61e73a8af0-1f34944edf6mr11943529637.1.1741271619516; Thu, 06 Mar 2025 06:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741271619; cv=none; d=google.com; s=arc-20240605; b=TXl/4wnM10F9s8WqA6g7DYRukXCO44B1mPtTsuH0KulzOfG+a+f4JqnICPs/5n6B6B /Uqwn5wtcTYHdbPKIYH6uZ76bkoq5ZqwZpIJF2yMhKt8mYJTBp/Fi/K5RqZxVh4npaK3 xSBU9s+fSkc/UMgIJY80ghnxNuYUW8kgJvrh7eYrAipC4KUo5FqruhzDF71r45xYNGIX OwzVqURXaoGBF3SdFn1IAB6wz0zjqafo7k20nNftU3gjOxSk3Bi8r+PDsdtGbpPMRhmX BKvj4mhD1MDBTYwKmZqM87dICwynRGhWRlp+S3Pbjv9JE1oi8NHwL5PWIH/r56x7A3vq 8pWg== 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=6QCKbKpoW7qtcnKQqEqm3Pt/MttXIhUkzBeb9zyPhNg=; fh=K2z+O/wuUxDXr4r9ElYW9VeGQt0VuSnP60Ih4X8PPcU=; b=iTBvjip6gXGrdxkCs+N0fvtnFVTZ1w7DqnaqQwHL7OPm8dPU5spppjBHx2gaT+wV2o 2/6It3oNsbqgDsimZz9WxEoGy9MqLxd14L+uXwYMDe/g0vkOAPc5bUJGCKi6sgatgJGp FyZWwqEE6vURvUyNAa9rdJOnx5as1jknVks3N/0D1h3SftXBbI035//Z6FGKwMSWzFPd h69o35xHMCshhBFSpAzjsTvyYrTrrct2R1iCNF2UYAAne5qVu39C8vkNjYLGedKn08JC Xqk5hHIMXV9hBe/06rhLvSKNPwa0ShRW++n32odUA1L2axF1wS3HMVT1fn3rguV39VRH 73lA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z8SsAGIu; 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 41be03b00d2f7-af28127ec6asi2265569a12.464.2025.03.06.06.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 06:33:39 -0800 (PST) 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=Z8SsAGIu; 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 59D3681420; Thu, 6 Mar 2025 15:33:03 +0100 (CET) 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="Z8SsAGIu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 409B481417; Thu, 6 Mar 2025 15:33:01 +0100 (CET) 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 3F38C81253 for ; Thu, 6 Mar 2025 15:32:59 +0100 (CET) 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-39130ee05b0so127801f8f.3 for ; Thu, 06 Mar 2025 06:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741271578; x=1741876378; 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=6QCKbKpoW7qtcnKQqEqm3Pt/MttXIhUkzBeb9zyPhNg=; b=Z8SsAGIulmA2uyyfpo9SlD2YR5+rs1z6SzUvgjUUzycG41DsoBB7A02Gh6V7Efhm5F G8u4hajuxsq0vMKc3dfGC0sXK+CgD3AfzLsTv5vhxrIUvpRnpmeV33YBn7sAfAVIuc8r FvT8YP+xSRYi3BX/uHBSYef+3k/YjY03tvJpFFaKe6eIePgi3t3AtSCqgGFF09uzSdmj FdouKkOh0kj3UW/KpJon+rMRnR3HqcTHf0Pey+AjRz6JFkP7UNSsoh+bIE2TtzjlILRM /D80VKbqrxr2gzc3yG7wNaRKNS4qJaTdK9oytWUAAOeH5SOq0qZPCxjK0QYpkybunjrm M9Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741271578; x=1741876378; 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=6QCKbKpoW7qtcnKQqEqm3Pt/MttXIhUkzBeb9zyPhNg=; b=Wk16C++SKUo3x9WhFBRJFnDTRBBGba/NONRDneZHVeAaKSwmAGBShObjN2+k23X+ZM jqCDhuYfaa+L0PdetyUerSgdl4sUtd3H1/NJeVJwr2YkHaQeLyoAObCeG0TOyC1oVCpF U7TFTUCQWJ55xoVSvBvrnCV+RGau9+zTgDUkkZete3o4bPf/UivdbDSBhwn1P9fpT5tb XI+BFowkQ+idbd+iwkHN+4j0zPn+RwLS42MRl/QzPPYXkGZbGfUm1e7I9IxwmUSr7uFf YdwFgchMSx8haHag8Q/q11jBwB/Cq20m6fjUycguQ+DH7+3EaVy4+CnH2wwlBqOfYHth 4z6g== X-Gm-Message-State: AOJu0Ywmnx326RHkYOatCJOfrsXtU0UJ9IzxQ8Y7KKFJkEvcmzlwX6WC 6hdnoQPt5Hy8BZJa26EGQKn+X1G+yXeNNEjNVMgDSRsNNcRWlwpr0hMPeq1KihQIP0vhUDEFdw+ q X-Gm-Gg: ASbGnctgF22sS5BfBjyymxw+2XQ454+vVPC7pQTKjBcndwjmSR3Zu3PcDAgIx2Sg8nd 5r4YgA9MCvuC/69KK8v4Swd7QCoJAEVu8inWy9KZrvTqsSiM3WEcyRB5021rwoRKIz9Qos7DfWX nq07e084nH0ohO+NlE0N6SZbWcXTJxGdUKbL6TqfSZHmB/nZ3CHSPmX6tj5Bs/o1flgjgF/RZIN HmWdeLHpL8kXa8PpneIBNPXzTGth45dL0IX93xbmO/eAvhG2pSBPbJG0RKfchBEFtt4qXV3yXek 5aZzFBqb4S6eTLtrQqFVCkUYoKQCD7UoVvdXkPhlk8gH5TSpLhmKVA== X-Received: by 2002:a5d:5f91:0:b0:391:fcc:9ee8 with SMTP id ffacd0b85a97d-3911f740cb5mr7425482f8f.23.1741271578440; Thu, 06 Mar 2025 06:32:58 -0800 (PST) Received: from builder.. ([2a01:e0a:3cb:7bb0:af71:dfb2:66ef:80c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd9470e2sm21561065e9.33.2025.03.06.06.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 06:32:58 -0800 (PST) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Simon Glass Subject: [PATCH 2/2] net: lwip: add CONFIG_LWIP_DEBUG_RXTX Date: Thu, 6 Mar 2025 15:32:22 +0100 Message-ID: <20250306143224.3080316-3-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250306143224.3080316-1-jerome.forissier@linaro.org> References: <20250306143224.3080316-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 Kconfig symbol LWIP_DEBUG_RXTX to dump the incoming and outgoing packets when NET_LWIP=y. Signed-off-by: Jerome Forissier --- net/lwip/Kconfig | 6 ++++++ net/lwip/net-lwip.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/net/lwip/Kconfig b/net/lwip/Kconfig index 40345ced9c9..d28a8a7df94 100644 --- a/net/lwip/Kconfig +++ b/net/lwip/Kconfig @@ -10,6 +10,12 @@ config LWIP_DEBUG Prints messages to the console regarding network packets that go in and out of the lwIP library. +config LWIP_DEBUG_RXTX + bool "Dump packets sent and received by lwIP" + help + Performs an hexadecimal & ASCII dump of the data received and sent by + the lwIP network stack. + config LWIP_ASSERT bool "Enable assertions in the lwIP library" help diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 5a2a86686f4..c00a7fe97cd 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,12 @@ static err_t net_lwip_tx(struct netif *netif, struct pbuf *p) void *pp = NULL; int err; + if (CONFIG_IS_ENABLED(LWIP_DEBUG_RXTX)) { + printf("net_lwip_tx: %u bytes, udev %s\n", p->len, udev->name); + print_hex_dump("net_lwip_tx: ", 0, 16, 1, p->payload, p->len, + true); + } + if ((unsigned long)p->payload % PKTALIGN) { /* * Some net drivers have strict alignment requirements and may @@ -265,6 +272,13 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif) flags = 0; if (len > 0) { + if (CONFIG_IS_ENABLED(LWIP_DEBUG_RXTX)) { + printf("net_lwip_tx: %u bytes, udev %s \n", len, + udev->name); + print_hex_dump("net_lwip_rx: ", 0, 16, 1, + packet, len, true); + } + pbuf = alloc_pbuf_and_copy(packet, len); if (pbuf) netif->input(pbuf, netif);