[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221205212414.3197525-4-anthony.l.nguyen@intel.com>
Date: Mon, 5 Dec 2022 13:24:09 -0800
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com
Cc: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>,
netdev@...r.kernel.org, anthony.l.nguyen@...el.com,
sasha.neftin@...el.com, Naama Meir <naamax.meir@...ux.intel.com>
Subject: [PATCH net-next 3/8] igc: Add checking for basetime less than zero
From: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>
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.
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>
Tested-by: Naama Meir <naamax.meir@...ux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index eb4b916a609d..35c473703950 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -5934,6 +5934,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;
--
2.35.1
Powered by blists - more mailing lists