52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
|
|
From 01a9518a9f305ea0ade60028c6bf4c26431fd707 Mon Sep 17 00:00:00 2001
|
||
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Sat, 12 Oct 2024 09:01:55 +0000
|
||
|
|
Subject: [PATCH] hw/net/e1000e_core: Use definition to avoid dynamic stack
|
||
|
|
allocation mainline inclusion commit c140a69055bad798a335ea3c83aebceaca82bde0
|
||
|
|
category: bugfix
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
---------------------------------------------------------------
|
||
|
|
|
||
|
|
The compiler isn't clever enough to figure 'min_buf_size'
|
||
|
|
is a constant, so help it by using a definitions instead.
|
||
|
|
|
||
|
|
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||
|
|
Acked-by: Jason Wang <jasowang@redhat.com>
|
||
|
|
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||
|
|
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
||
|
|
Message-id: 20220819153931.3147384-6-peter.maydell@linaro.org
|
||
|
|
---
|
||
|
|
hw/net/e1000e_core.c | 7 ++++---
|
||
|
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
|
||
|
|
index 8ae6fb7e14..32c3507795 100644
|
||
|
|
--- a/hw/net/e1000e_core.c
|
||
|
|
+++ b/hw/net/e1000e_core.c
|
||
|
|
@@ -1620,15 +1620,16 @@ e1000e_rx_fix_l4_csum(E1000ECore *core, struct NetRxPkt *pkt)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
+/* Min. octets in an ethernet frame sans FCS */
|
||
|
|
+#define MIN_BUF_SIZE 60
|
||
|
|
+
|
||
|
|
ssize_t
|
||
|
|
e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt)
|
||
|
|
{
|
||
|
|
static const int maximum_ethernet_hdr_len = (14 + 4);
|
||
|
|
- /* Min. octets in an ethernet frame sans FCS */
|
||
|
|
- static const int min_buf_size = 60;
|
||
|
|
|
||
|
|
uint32_t n = 0;
|
||
|
|
- uint8_t min_buf[min_buf_size];
|
||
|
|
+ uint8_t min_buf[MIN_BUF_SIZE];
|
||
|
|
struct iovec min_iov;
|
||
|
|
uint8_t *filter_buf;
|
||
|
|
size_t size, orig_size;
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|