mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
hw/net/e1000e_core: Use definition to avoid dynamic stack allocation
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
This commit is contained in:
parent
5e689840a1
commit
c140a69055
1 changed files with 4 additions and 3 deletions
|
@ -1622,15 +1622,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
|
ssize_t
|
||||||
e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt)
|
e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt)
|
||||||
{
|
{
|
||||||
static const int maximum_ethernet_hdr_len = (14 + 4);
|
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;
|
uint32_t n = 0;
|
||||||
uint8_t min_buf[min_buf_size];
|
uint8_t min_buf[MIN_BUF_SIZE];
|
||||||
struct iovec min_iov;
|
struct iovec min_iov;
|
||||||
uint8_t *filter_buf;
|
uint8_t *filter_buf;
|
||||||
size_t size, orig_size;
|
size_t size, orig_size;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue