net: enetc: fix build warning when PAGE_SIZE is greater than 128K
Wei Fang
maintainerPATCH 1/1 net: enetc: fix build warning when PAGE_SIZE is greater than 128K
The max buffer size of ENETC RX BD is 0xFFFF bytes, so if the PAGE_SIZE is greater than 128K, ENETC_RXB_DMA_SIZE and ENETC_RXB_DMA_SIZE_XDP will be greater than 0xFFFF, thus causing a build warning.
This will not cause any practical issues because ENETC is currently only used on the ARM64 platform, and the max PAGE_SIZE is 64K. So this patch is only for fixing the build warning that occurs when compiling ENETC drivers for other platforms.
--- drivers/net/ethernet/freescale/enetc/enetc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.h +2 -2
@@ -79,9 +79,9 @@ struct enetc_lso_t {#define ENETC_RXB_TRUESIZE (PAGE_SIZE >> 1)#define ENETC_RXB_PAD NET_SKB_PAD/* add extra space if needed */ #define ENETC_RXB_DMA_SIZE \ - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD) + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD, 0xffff)#define ENETC_RXB_DMA_SIZE_XDP \ - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM) + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM, 0xffff)struct enetc_rx_swbd {dma_addr_t dma;
Signature · 1 line
2.34.1
Quoted 9 lines · Wei Fang
The max buffer size of ENETC RX BD is
0xFFFFbytes, so if thePAGE_SIZEis greater than 128K,ENETC_RXB_DMA_SIZEandENETC_RXB_DMA_SIZE_XDPwill be greater than0xFFFF, thus causing a build warning.This will not cause any practical issues because ENETC is currently only used on the ARM64 platform, and the max
PAGE_SIZEis 64K. So this patch is only for fixing the build warning that occurs when compiling ENETC drivers for other platforms.
Quoted 4 lines
Reported-by kernel test robot <[email protected]>Fixes e59bc32df2e9 ("net: enetc: correct the value of ENETC_RXB_TRUESIZE")Signed-off-by Wei Fang <[email protected]>
Quoted 23 lines
--- drivers/net/ethernet/freescale/enetc/enetc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/freescale/enetc/enetc.h +2
-3@@ -79,9 +79,9 @@ struct enetc_lso_t {#define ENETC_RXB_TRUESIZE (PAGE_SIZE >> 1)#define ENETC_RXB_PAD NET_SKB_PAD/* add extra space if needed */ #define ENETC_RXB_DMA_SIZE \ - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD) + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD, 0xffff)#define ENETC_RXB_DMA_SIZE_XDP \ - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM) + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM, 0xffff)struct enetc_rx_swbd {dma_addr_t dma; --2.34.1
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Wed, 7 Jan 2026 17:12:04 +0800 you wrote:
The max buffer size of ENETC RX BD is
0xFFFFbytes, so if thePAGE_SIZEis greater than 128K,ENETC_RXB_DMA_SIZEandENETC_RXB_DMA_SIZE_XDPwill be greater than0xFFFF, thus causing a build warning.This will not cause any practical issues because ENETC is currently only used on the ARM64 platform, and the max
PAGE_SIZEis 64K. So this patch is only for fixing the build warning that occurs when compiling ENETC drivers for other platforms.[...]
Here is the summary with links:
- [net] net: enetc: fix build warning when PAGE_SIZE is greater than 128K
https://git.kernel.org/netdev/net/c/4b5bdabb5449
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html