Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nV6Sy-0005IN-Py for mharc-grub-devel@gnu.org; Fri, 18 Mar 2022 02:52:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nV6Sw-0005E1-IM for grub-devel@gnu.org; Fri, 18 Mar 2022 02:52:02 -0400 Received: from [2607:f8b0:4864:20::734] (port=46645 helo=mail-qk1-x734.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nV6Sv-0006Bo-56 for grub-devel@gnu.org; Fri, 18 Mar 2022 02:52:02 -0400 Received: by mail-qk1-x734.google.com with SMTP id r127so6120582qke.13 for ; Thu, 17 Mar 2022 23:52:00 -0700 (PDT) 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=XjkwG6b23C6iu/tLertY31UP25wx4eU0++lpgOGMtSg=; b=MdEGpY1goNFo2ehGm5JWvgO8aF+u0ej9l7Grn5WtFdE6Z7ApXqi1V6vZGkbfmmFfoM KFCDQer8C//0V87YY3OF3oqlq/K3IkC6ljs58Za9omFpSr7E9DySuy8OlfFH1dYxmIZ7 SeGT7KSSlS6XIETNXuzLAKh8ODKVkJ6nwuuyLw/gG33RzdJgvuXDuE5dQX5gbcOZMQ9F B7MWF1V5VDC1K3L2YAKvW3I3oyMCEYBSbKESSw9W5VWzI3vvWTQ6Jh+TtWEA+r1DOkWD 6ndaXKfYQuLJuoAwTCRSK8iWbsQXaLeAr/Vl5vy0yGBCh0H4pf/W6xMhuo2RvCuq6DXK 1+kg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=XjkwG6b23C6iu/tLertY31UP25wx4eU0++lpgOGMtSg=; b=ZdCpV2hMg5mu7yipH8eKlbvB2rE61gygOx0DDibsq5t/h3L82WJkyEbg0qpR/rJNzG Kw1MN5gXouqGnhfNsCLnJFjnfRQJLALkogEYLiz8Q9CaW6m5QFgEDa7bllDO7PjP4Q7T vFB2PrLUkH5gs0zOQWyAMXa5OcX4JKC1frMMdbLquBf5Tp541IXqYf2ZE6HSjQRflcq7 voRWneLVXB/zsu2oLm+9ncWM2thX6QfrY7yJJyy7biTlpjFqfXGitxazQOoD8soC+iea bDqC/25uZIyEJiPZ+CUEOKayG7s/g0i3bO3hhmnJNVTxuHYkQVD47cKYWLG0FXkPcgFc 1IwA== X-Gm-Message-State: AOAM531hSiyMtDXnoSUH/x6oml8V6vwj4t/fN4StwxY4GodKB9fvdVnD uwUo8/wCHZxJf7uQczsGltgWwg== X-Google-Smtp-Source: ABdhPJzkAzxMpeiW2WKNf4evW3UREiMdq1gh/47Bx3/Ub74cw6zgqMzwRppgkZkv5S2hkxHNSEGqnw== X-Received: by 2002:a05:620a:44c9:b0:67e:ca0:ea26 with SMTP id y9-20020a05620a44c900b0067e0ca0ea26mr4933553qkp.376.1647586320322; Thu, 17 Mar 2022 23:52:00 -0700 (PDT) Received: from localhost.localdomain (51-15-0-88.rev.poneytelecom.eu. [51.15.0.88]) by smtp.gmail.com with ESMTPSA id o6-20020a05620a22c600b0067d247816eesm3471324qki.85.2022.03.17.23.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 23:52:00 -0700 (PDT) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH 2/3] net: Avoid unnecessary calls to grub_net_tcp_retransmit Date: Fri, 18 Mar 2022 01:51:32 -0500 Message-Id: <4efca58dab0f6e3efee6bcb138c6aeffd1491052.1647586160.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::734 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=development@efficientek.com; helo=mail-qk1-x734.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: Fri, 18 Mar 2022 06:52:02 -0000 In grub_net_poll_cards_idle_real, only call grub_net_tcp_retransmit if there are network cards found. If there are no network card found, there can be no tcp sockets to transmit on. So no need to go through that logic. Signed-off-by: Glenn Washburn --- grub-core/net/net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 3eac83d165..11b39877b9 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1580,7 +1580,8 @@ grub_net_poll_cards_idle_real (void) || ctime >= card->last_poll + card->idle_poll_delay_ms) receive_packets (card, 0); } - grub_net_tcp_retransmit (); + if (grub_net_cards == NULL) + grub_net_tcp_retransmit (); } /* Read from the packets list*/ -- 2.27.0