Skip to content

Commit c17ff47

Browse files
Sean Andersonkuba-moo
authored andcommitted
net: xilinx: axienet: Fix IRQ coalescing packet count overflow
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 <[email protected]> Reviewed-by: Shannon Nelson <[email protected]> Reviewed-by: Radhey Shyam Pandey <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 16ebb6f commit c17ff47

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,12 @@ axienet_ethtools_set_coalesce(struct net_device *ndev,
20562056
return -EBUSY;
20572057
}
20582058

2059+
if (ecoalesce->rx_max_coalesced_frames > 255 ||
2060+
ecoalesce->tx_max_coalesced_frames > 255) {
2061+
NL_SET_ERR_MSG(extack, "frames must be less than 256");
2062+
return -EINVAL;
2063+
}
2064+
20592065
if (ecoalesce->rx_max_coalesced_frames)
20602066
lp->coalesce_count_rx = ecoalesce->rx_max_coalesced_frames;
20612067
if (ecoalesce->rx_coalesce_usecs)

0 commit comments

Comments
 (0)