public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Patrick Wildt <patrick@blueri.se>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/2] net: add a define for the number of packets received as batch
Date: Wed, 7 Oct 2020 00:57:14 +0200	[thread overview]
Message-ID: <20201006225714.GA15805@nox.fritz.box> (raw)
In-Reply-To: <20201006225108.GC15578@nox.fritz.box>

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>
---
 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

  reply	other threads:[~2020-10-06 22:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 14:56 efi_loader: fix free() before use in RX path Patrick Wildt
2020-10-06 16:32 ` Patrick Wildt
2020-10-06 20:26   ` Heinrich Schuchardt
2020-10-06 22:29     ` Patrick Wildt
2020-10-06 22:30       ` [PATCH] efi_loader: fix use after free in receive path Patrick Wildt
2020-10-06 22:45         ` Heinrich Schuchardt
2020-10-06 22:51           ` Patrick Wildt
2020-10-06 22:57             ` Patrick Wildt [this message]
2020-10-06 22:59               ` [PATCH v2 2/2] " Patrick Wildt
2020-10-07  9:03                 ` [PATCH v3 1/2] net: add a define for the number of packets received as batch Patrick Wildt
2020-10-07  9:04                   ` [PATCH v3 2/2] efi_loader: fix use after free in receive path Patrick Wildt
2020-10-07 13:26                     ` Heinrich Schuchardt
2020-11-20 22:56                       ` Patrick Wildt
2020-11-20 23:31                         ` Tom Rini
2020-11-21  1:36                           ` Patrick Wildt
2020-10-07 10:51                   ` [PATCH v3 1/2] net: add a define for the number of packets received as batch Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201006225714.GA15805@nox.fritz.box \
    --to=patrick@blueri.se \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox