From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nRhGO-0006D5-0u for mharc-grub-devel@gnu.org; Tue, 08 Mar 2022 16:21:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRhGK-00065r-MY for grub-devel@gnu.org; Tue, 08 Mar 2022 16:20:56 -0500 Received: from [2607:f8b0:4864:20::833] (port=34576 helo=mail-qt1-x833.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRhGH-0006ep-Lc for grub-devel@gnu.org; Tue, 08 Mar 2022 16:20:56 -0500 Received: by mail-qt1-x833.google.com with SMTP id c4so302834qtx.1 for ; Tue, 08 Mar 2022 13:20:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Q5J434No8jFGxnvveFczsMPXrNHhL1uLBTtRcFQ/3PQ=; b=qc4A+2tdav8VEUbG+TGdtFxtgghQex+vWqPkSmNqc8g8xpulHuSpXPiScpFjP4wtd5 /pEpj8U4G73pa/fBtK6gZBHGmzq79/JQKpYq70tF4t/1WuvDqY0tjAJ/u4fp2i2FrtGo /6Qnxu+fqfG2j4WNVO+CS7YYqT+VroXEOAJK8tz5SoBTbcrjKR1mtiBHcQn+dtvCsssR xXknvWik2B81BU8BAQDiVyauaQHNM4pDchPknN4su5eQaNcamJ0VxsO70O8x36Cd2D6n kbv86ZIJVYQCoSFKOweeAHpWpSluEWLH3tskRbC+3q5/hLfgJMrfmz6QQhwBzCJkIcoY 1LVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Q5J434No8jFGxnvveFczsMPXrNHhL1uLBTtRcFQ/3PQ=; b=DcpKDtC8IxV2QCF9RQYP3go4WMtu19hbcdCsxPcL8t/ks+8JaD+4uTCHn1qRWCEsxn Q46xBezoAeRXv/4Lec+xMvrdyIKmYMb9kVB60zCaWDwQ4rCYVhUQO0cQZy5OMD2FNLq2 9R8DBoaLt9aeJNgQOyjBddme+CTj6N3Ttzpe4DPdpEvlOrhwkpIV4G9Fgidr/loJu5W3 TjDqNVyxN2Cq6o9rjc3r/MH8FduOLftKJe+JKcFuYmuvDxl2tE5MkzTiuPGKhMIBt4Gp ItZPDyRaFdLMSBzF9mafrnBxT/mdadeja/cqJ1zBCAiiFh8i1mF2Ya9/7JRsN7JhJ00h nF1Q== X-Gm-Message-State: AOAM530KqRzO12ihFT6Xedh6Qwsli1PEMcFXwmT90F7jOwwnHaB7OtXB yWP5fkSivH4n+mtOzONVKuNXtA== X-Google-Smtp-Source: ABdhPJyuiIvUZjF9OJpBeIN2Qn+dq2gR3zU9h2FH6LA69K/EZzOzLwxsZII0L7alBsCMJq5c9OxlyA== X-Received: by 2002:ac8:570d:0:b0:2dd:97c8:e413 with SMTP id 13-20020ac8570d000000b002dd97c8e413mr15459543qtw.3.1646774449831; Tue, 08 Mar 2022 13:20:49 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id w17-20020ac857d1000000b002e19feda592sm38088qta.85.2022.03.08.13.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 13:20:49 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH 0/3] Net fix and improvements Date: Tue, 8 Mar 2022 15:20:17 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::833 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=development@efficientek.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2022 21:20:56 -0000 The first patch looks like it was a copy/paste error. If the net module is unloaded, grub_net_poll_cards_idle should be NULL so that a function in the net module which now doesn't exist. The second and third patches are for performance and were helpful when debugging GRUB. When the net module is loaded, even if there are no net cards found, grub_net_poll_cards_idle will call grub_net_tcp_retransmit() unconditionally. But there's no need to go through tcp retransmit logic if there aren't any cards that we could be retransmitting on. As for the third patch, if the machine has network cards found, but there are no tcp open sockets (because the user doesn't use the network to boot), then grub_net_tcp_retransmit() should be a noop. Thus is doesn't need to call grub_get_time_ms(), which does a call into firmware on powerpc-ieee1275. So only call grub_get_time_ms() if there are tcp sockets. Calls to grub_net_poll_cards_idle can happen a lot when GRUB is waiting for a keypress (grub_getkey_noblock calls grub_net_poll_cards_idle). I found this annoying when debugging an issue in GRUB with GDB and I found that nearly every time I interrupted GRUB with the GDB I was landing in OpenBIOS's milliseconds call and then I had to step out back into GRUB which could be a hundred or more instructions. This reduces the probability that interrupting GRUB lands in the firmware when GRUB is blocked waiting on a keypress. Glenn Glenn Washburn (3): net: Unset grub_net_poll_cards_idle when net module has been unloaded net: Avoid unnecessary calls to grub_net_tcp_retransmit net/tcp: Only call grub_get_time_ms when there are sockets to potentially retransmit for grub-core/net/net.c | 5 +++-- grub-core/net/tcp.c | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) -- 2.27.0