]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: add a define for the number of packets received as batch
authorPatrick Wildt <patrick@blueri.se>
Wed, 7 Oct 2020 09:03:30 +0000 (11:03 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 19 Oct 2020 20:59:53 +0000 (22:59 +0200)
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 <patrick@blueri.se>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/net.h
net/eth-uclass.c

index 778acf7da3f41bd6ea993ef27d6e5948d6e67d3f..aff6674bb3ebc834763ff998771c20ecd1af76eb 100644 (file)
@@ -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
 /*
index 4424d595f4643b51dd19d57fc962f02e6fba2ad1..e14695c0f16d8b8eaec3fdfb4daf13b5e7cf4629 100644 (file)
@@ -383,7 +383,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)