From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Wildt Date: Wed, 7 Oct 2020 11:03:30 +0200 Subject: [PATCH v3 1/2] net: add a define for the number of packets received as batch In-Reply-To: <20201006225901.GB15805@nox.fritz.box> References: <20201006145631.GA2844@jump> <20201006163224.GA2857@jump> <20201006222934.GA15578@nox.fritz.box> <20201006223051.GB15578@nox.fritz.box> <92745C9B-6D8B-4612-BAC6-82D7A6803FEC@gmx.de> <20201006225108.GC15578@nox.fritz.box> <20201006225714.GA15805@nox.fritz.box> <20201006225901.GB15805@nox.fritz.box> Message-ID: <20201007090330.GA28445@ryzen.blueri.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de With a define for the magic number of packets received as batch we can make sure that the EFI network stack caches the same amount of packets. Signed-off-by: Patrick Wildt --- Changes in v3: - Simple rebase to resend patches together. Changes in v2: - Split this commit out of another one. include/net.h | 3 +++ net/eth-uclass.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/net.h b/include/net.h index 219107194f..eab4ebdd38 100644 --- a/include/net.h +++ b/include/net.h @@ -44,6 +44,9 @@ struct udevice; #define PKTALIGN ARCH_DMA_MINALIGN +/* Number of packets processed together */ +#define ETH_PACKETS_BATCH_RECV 32 + /* ARP hardware address length */ #define ARP_HLEN 6 /* diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 396418eb39..963a0beaab 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -380,7 +380,7 @@ int eth_rx(void) /* Process up to 32 packets at one time */ flags = ETH_RECV_CHECK_DEVICE; - for (i = 0; i < 32; i++) { + for (i = 0; i < ETH_PACKETS_BATCH_RECV; i++) { ret = eth_get_ops(current)->recv(current, flags, &packet); flags = 0; if (ret > 0) -- 2.28.0