Skip to content

Commit 4a4a25b

Browse files
Sean Andersonopsiff
authored andcommitted
net: xilinx: axienet: Fix IRQ coalescing packet count overflow
[ Upstream commit c17ff47 ] If coalesce_count is greater than 255 it will not fit in the register and will overflow. This can be reproduced by running # ethtool -C ethX rx-frames 256 which will result in a timeout of 0us instead. Fix this by checking for invalid values and reporting an error. Fixes: 8a3b7a2 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> Link: https://patch.msgid.link/20250113163001.2335235-1-sean.anderson@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit c010a1f18020eea93dd9e63b0a66575f96839f4e)
1 parent c722a48 commit 4a4a25b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,12 @@ axienet_ethtools_set_coalesce(struct net_device *ndev,
15711571
return -EFAULT;
15721572
}
15731573

1574+
if (ecoalesce->rx_max_coalesced_frames > 255 ||
1575+
ecoalesce->tx_max_coalesced_frames > 255) {
1576+
NL_SET_ERR_MSG(extack, "frames must be less than 256");
1577+
return -EINVAL;
1578+
}
1579+
15741580
if (ecoalesce->rx_max_coalesced_frames)
15751581
lp->coalesce_count_rx = ecoalesce->rx_max_coalesced_frames;
15761582
if (ecoalesce->rx_coalesce_usecs)

0 commit comments

Comments
 (0)