[PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption

Vinicius Costa Gomes
2022-05-20T01:16:34Z

Frame Preemption and LaunchTime cannot be enabled on the same queue.
If that situation happens, emit an error to the user, and log the
error.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 69e96e9a3ec8..96ad00e33f4b 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -5916,6 +5916,11 @@ static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
if (queue < 0 || queue >= adapter->num_tx_queues)
return -EINVAL;

+ if (ring->preemptible) {
+ netdev_err(adapter->netdev, "Cannot enable LaunchTime on a preemptible queue\n");
+ return -EINVAL;
+ }
+
ring = adapter->tx_ring[queue];
ring->launchtime_enable = enable;

--
2.35.3