diff options
| author | Charles Perry <charles.perry@microchip.com> | 2026-03-13 07:06:09 -0700 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-03-17 13:32:33 +0100 |
| commit | 363a99af19a7f5c7ddd7571e39f3ae6663397bb6 (patch) | |
| tree | b443def31972790a4094f70fe4d80e84332e691b /scripts/package/gen-diff-patch | |
| parent | 63e9d434ddc8b2f7b8b6a6d31611736981edc9ca (diff) | |
net: macb: add safeguards for jumbo frame larger than 10240
The RX buffers for GEM can have a maximum size of 16320 bytes
(0xff in the RXBS field of the DMACFG register means 255*64 =
16320 bytes).
The GEM IP has configurable maximum jumbo frame length that can go up to
16383. The actual value for this limit can be found in the
"jumbo_max_length" field (bits 0..13) of the DCFG2 register.
Currently, the macb driver doesn't use the DCFG2 register when
determining the max MTU, instead an hardcoded value (jumbo_max_len in
struct macb_config) is used for each platform. Right now the maximum
value for jumbo_max_len is 10240 (0x2800).
GEM uses one buffer per packet which means that one buffer must allow
room for the max MTU plus L2 encapsulation and alignment. This is a
limitation of the driver.
This commit adds a limit to max_mtu and rx_buffer_size so that the RXBS
field can never overflow when a large MTU is used.
With this commit, it is now possible to add new platforms with a
jumbo_max_len of 16383 so that the hardware properties of each IP can be
properly captured in struct macb_config.
Signed-off-by: Charles Perry <charles.perry@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260313140610.3681752-3-charles.perry@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts/package/gen-diff-patch')
0 files changed, 0 insertions, 0 deletions
