[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/20] hw/net/xilinx_ethlite: Correct maximum RX buffer size
From: |
Edgar E. Iglesias |
Subject: |
Re: [PATCH 05/20] hw/net/xilinx_ethlite: Correct maximum RX buffer size |
Date: |
Wed, 13 Nov 2024 16:15:04 +0100 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Tue, Nov 12, 2024 at 07:10:29PM +0100, Philippe Mathieu-Daudé wrote:
> The current max RX bufsize is set to 0x800. This is
> invalid, since it contains the MMIO registers region.
> Add the correct definition and use it.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
> hw/net/xilinx_ethlite.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c
> index 0f59811c78..e6f6179fce 100644
> --- a/hw/net/xilinx_ethlite.c
> +++ b/hw/net/xilinx_ethlite.c
> @@ -46,6 +46,8 @@
> #define R_RX_CTRL1 (0x1ffc / 4)
> #define R_MAX (0x2000 / 4)
>
> +#define RX_BUFSZ_MAX 0x07e0
> +
> #define GIE_GIE 0x80000000
>
> #define CTRL_I 0x8
> @@ -195,7 +197,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t
> *buf, size_t size)
> return -1;
> }
>
> - if (size > (R_MAX - R_RX_BUF0 - rxbase) * 4) {
> + if (size > RX_BUFSZ_MAX) {
> trace_ethlite_pkt_size_too_big(size);
> return -1;
> }
> --
> 2.45.2
>
- [PATCH 00/20] hw/net/xilinx_ethlite: Map RAM buffers as RAM and remove tswap() calls, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 01/20] hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 03/20] hw/net/xilinx_ethlite: Remove unuseful debug logs, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 02/20] hw/net/xilinx_ethlite: Convert some debug logs to trace events, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 04/20] hw/net/xilinx_ethlite: Update QOM style, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 05/20] hw/net/xilinx_ethlite: Correct maximum RX buffer size, Philippe Mathieu-Daudé, 2024/11/12
- Re: [PATCH 05/20] hw/net/xilinx_ethlite: Correct maximum RX buffer size,
Edgar E. Iglesias <=
- [PATCH 06/20] hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented), Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 07/20] hw/net/xilinx_ethlite: Rename rxbuf -> port_index, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 08/20] hw/net/xilinx_ethlite: Add addr_to_port_index() helper, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 09/20] hw/net/xilinx_ethlite: Introduce txbuf_ptr() helper, Philippe Mathieu-Daudé, 2024/11/12
- [PATCH 10/20] hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper, Philippe Mathieu-Daudé, 2024/11/12