Skip to content

Commit

Permalink
net: add a define for the number of packets received as batch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bluerise authored and xypron committed Oct 19, 2020
1 parent 3d19a7e commit 36ea0ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/net.h
Expand Up @@ -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
/*
Expand Down
2 changes: 1 addition & 1 deletion net/eth-uclass.c
Expand Up @@ -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)
Expand Down

0 comments on commit 36ea0ca

Please sign in to comment.