Skip to content

Commit c1bca9a

Browse files
koaloanguy11
authored andcommitted
igc: Fix launchtime before start of cycle
It is possible (verified on a running system) that frames are processed by igc_tx_launchtime with a txtime before the start of the cycle (baset_est). However, the result of txtime - baset_est is written into a u32, leading to a wrap around to a positive number. The following launchtime > 0 check will only branch to executing launchtime = 0 if launchtime is already 0. Fix it by using a s32 before checking launchtime > 0. Fixes: db0b124 ("igc: Enhance Qbv scheduling by using first flag bit") Signed-off-by: Florian Kauer <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 8b86f10 commit c1bca9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ static __le32 igc_tx_launchtime(struct igc_ring *ring, ktime_t txtime,
10161016
ktime_t base_time = adapter->base_time;
10171017
ktime_t now = ktime_get_clocktai();
10181018
ktime_t baset_est, end_of_cycle;
1019-
u32 launchtime;
1019+
s32 launchtime;
10201020
s64 n;
10211021

10221022
n = div64_s64(ktime_sub_ns(now, base_time), cycle_time);

0 commit comments

Comments
 (0)