Skip to content

Commit

Permalink
igc: Add checking for basetime less than zero
Browse files Browse the repository at this point in the history
Using the tc qdisc command, the user can set basetime to any value.
Checking should be done on the driver's side to prevent registering
basetime values that are less than zero.

Fixes: ec50a9d ("igc: Add support for taprio offloading")
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
zulkifl3 authored and anguy11 committed Dec 15, 2022
1 parent d8f45be commit 3b61764
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/igc/igc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6047,6 +6047,9 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
if (!qopt->enable)
return igc_tsn_clear_schedule(adapter);

if (qopt->base_time < 0)
return -ERANGE;

if (adapter->base_time)
return -EALREADY;

Expand Down

0 comments on commit 3b61764

Please sign in to comment.