From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7554C433EF for ; Sat, 18 Dec 2021 15:15:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A94278303B; Sat, 18 Dec 2021 16:15:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="gcfISyo0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F33388309A; Sat, 18 Dec 2021 16:15:15 +0100 (CET) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 8D10D82FE0 for ; Sat, 18 Dec 2021 16:15:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x72b.google.com with SMTP id d2so5116594qki.12 for ; Sat, 18 Dec 2021 07:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oZB/v9ZiuTrNe7mapuJY03KsOvL6ugSKb2uwZgETnJQ=; b=gcfISyo04akk3cGc+Zv9AwF/Vrk39YZdGGIup15jSKliHfalfhcmuyzHrwAcOb8Fzv dTJ1HdbRt5vlQ8ng29sKx0GN+2xBpk7bH4bOmE2zkBcjdM4jp/5jTdCioAd0sVvv2B6x v3qQHIaMGCtX9I0x8fuTm1ve51LLziN+SOIx7ZUaPyRnsefwmGVfzKB3NEDbaIn23vaw GkrUrt94IVYOQRDgFrWzoW2c8MuoLgho+Sqp4Zy9ML913qeUXHI4dUOlIteuypUtqiRn 5WhOR5hUND1S8hHjaP4JlQ1mycv11FhIUkkTrYeutyC7Ezz3XftH7XnAksMbo3WRcw3a G9dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oZB/v9ZiuTrNe7mapuJY03KsOvL6ugSKb2uwZgETnJQ=; b=XxVo8TbvPU7pqAZPiuIhBOCxgi6dGDpZv7UEJguebSkt8Y5d5yt7DoWXig6uWUH3+k QFgitY8K5Y4T4w5ox7IlPfcPCSe2UTp4702nbVYSCEtFdXbN418q0KNOulBbMhI7dptQ wmm5O09YBcGaTcLGGwijCD4g12MwA/dLzuPQxy7Wk2AuR/KMa72bbP2c0VmK/6s6Ge6w 8dftdiBVNvDY3cogRrE2Fd7L+cOXhv72tLT8oecKoVjFdnE3+uxCYpzVd34UBSPFPDke WYZ+QNhxb/LLf5NYRAJILrIFv4E9P5pnRFVM/ZGaxyq8RSB5jEl7//wuLg0gOZ4XBGmz 8DGw== X-Gm-Message-State: AOAM530MwYs5zQZZ8lsgwaushM0hWBLSkCRH9DBv4j5RS79b06rXVBIh ikzqK/lC1le+JGOCVobIZn8= X-Google-Smtp-Source: ABdhPJwidfGg8fa/Yr2nDij/oSdLE2yG9uzsveOFCVg3rEvU/gR/4+rw/xrinPWjX2ezAtQPthoA8g== X-Received: by 2002:a37:a087:: with SMTP id j129mr5013319qke.211.1639840510073; Sat, 18 Dec 2021 07:15:10 -0800 (PST) Received: from [192.168.1.201] (pool-108-18-207-184.washdc.fios.verizon.net. [108.18.207.184]) by smtp.googlemail.com with ESMTPSA id d6sm8848700qtq.15.2021.12.18.07.15.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Dec 2021 07:15:09 -0800 (PST) Subject: Re: [PATCH 1/4] Convert CONFIG_KEEP_SERVERADDR to Kconfig To: Simon Glass , U-Boot Mailing List Cc: Tom Rini , Joe Hershberger , Heinrich Schuchardt , =?UTF-8?Q?Marek_Beh=c3=ban?= , Mario Six , Patrick Delaunay , Priyanka Jain , Ramon Fried , Rasmus Villemoes , Stefan Roese References: <20211218150805.1083645-1-sjg@chromium.org> From: Sean Anderson Message-ID: <8bff779e-a537-3a80-8693-2e60f6f7c6f0@gmail.com> Date: Sat, 18 Dec 2021 10:15:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20211218150805.1083645-1-sjg@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean On 12/18/21 10:08 AM, Simon Glass wrote: > This converts the following to Kconfig: > CONFIG_KEEP_SERVERADDR > > Drop the preprocessor usage also. > > Signed-off-by: Simon Glass > --- > > README | 6 ------ > include/configs/sandbox.h | 1 - > net/Kconfig | 9 +++++++++ > net/arp.c | 5 ++--- > scripts/config_whitelist.txt | 1 - > 5 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/README b/README > index 056b717557b..eaf9170e952 100644 > --- a/README > +++ b/README > @@ -1193,12 +1193,6 @@ The following options need to be configured: > server to contact when using the "tftboot" command. > (Environment variable "serverip") > > - CONFIG_KEEP_SERVERADDR > - > - Keeps the server's MAC address, in the env 'serveraddr' > - for passing to bootargs (like Linux's netconsole option) > - > -- Gateway IP address: > CONFIG_GATEWAYIP > > Defines a default value for the IP address of the > diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h > index cd7d99ec69c..1dd21d5e925 100644 > --- a/include/configs/sandbox.h > +++ b/include/configs/sandbox.h > @@ -25,7 +25,6 @@ > #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ > 115200} > > -#define CONFIG_KEEP_SERVERADDR > #define CONFIG_UDP_CHECKSUM > #define CONFIG_TIMESTAMP > #define CONFIG_BOOTP_SERVERIP > diff --git a/net/Kconfig b/net/Kconfig > index 7a2d1450188..fb6420f9bbe 100644 > --- a/net/Kconfig > +++ b/net/Kconfig > @@ -98,4 +98,13 @@ config SERVERIP_FROM_PROXYDHCP_DELAY_MS > receiving response from main DHCP server. Has no effect if > SERVERIP_FROM_PROXYDHCP is false. > > +config KEEP_SERVERADDR > + bool "Write the server's MAC address to 'serveraddr'" > + default y if SANDBOX > + help > + Keeps the server's MAC address, in the env 'serveraddr' > + for passing to bootargs (like Linux's netconsole option). If this is > + enabled, when an ARP reply is received, the server's IP address is > + written there. > + This loses a bit of context originally present in the README. Can you note that this is the TFTP server's address we are keeping? --Sean > endif # if NET > diff --git a/net/arp.c b/net/arp.c > index 1d06ed25722..0b086dc8d21 100644 > --- a/net/arp.c > +++ b/net/arp.c > @@ -196,13 +196,12 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) > if (!arp_is_waiting()) > break; > > -#ifdef CONFIG_KEEP_SERVERADDR > - if (net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) { > + if (IS_ENABLED(CONFIG_KEEP_SERVERADDR) && > + net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) { > char buf[20]; > sprintf(buf, "%pM", &arp->ar_sha); > env_set("serveraddr", buf); > } > -#endif > > reply_ip_addr = net_read_ip(&arp->ar_spa); > > diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt > index 6d961ccb3e6..3285d3cd30e 100644 > --- a/scripts/config_whitelist.txt > +++ b/scripts/config_whitelist.txt > @@ -639,7 +639,6 @@ CONFIG_JFFS2_PART_SIZE > CONFIG_JFFS2_SUMMARY > CONFIG_JRSTARTR_JR0 > CONFIG_JTAG_CONSOLE > -CONFIG_KEEP_SERVERADDR > CONFIG_KEY_REVOCATION > CONFIG_KIRKWOOD_EGIGA_INIT > CONFIG_KIRKWOOD_GPIO >