From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next v4 07/12] igc: Add support for TC_SETUP_PREEMPT
Date: Fri, 25 Jun 2021 17:33:09 -0700 [thread overview]
Message-ID: <20210626003314.3159402-8-vinicius.gomes@intel.com> (raw)
In-Reply-To: <20210626003314.3159402-1-vinicius.gomes@intel.com>
Saves which queues are marked as preemptible, activating frame
preemption is done when the user requests it enabled, via ethtool.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
drivers/net/ethernet/intel/igc/igc.h | 1 +
drivers/net/ethernet/intel/igc/igc_main.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 9afee4712aeb..68c7262bd172 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -92,6 +92,7 @@ struct igc_ring {
u8 queue_index; /* logical index of the ring*/
u8 reg_idx; /* physical index of the ring */
bool launchtime_enable; /* true if LaunchTime is enabled */
+ bool preemptible; /* true if not express */
u32 start_time;
u32 end_time;
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 3f6b6d4543a8..b0981ea0ae63 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -5563,6 +5563,23 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
return 0;
}
+static int igc_save_frame_preemption(struct igc_adapter *adapter,
+ struct tc_preempt_qopt_offload *qopt)
+{
+ u32 preempt;
+ int i;
+
+ preempt = qopt->preemptible_queues;
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ struct igc_ring *ring = adapter->tx_ring[i];
+
+ ring->preemptible = preempt & BIT(i);
+ }
+
+ return 0;
+}
+
static int igc_tsn_enable_qbv_scheduling(struct igc_adapter *adapter,
struct tc_taprio_qopt_offload *qopt)
{
@@ -5591,6 +5608,9 @@ static int igc_setup_tc(struct net_device *dev, enum tc_setup_type type,
case TC_SETUP_QDISC_ETF:
return igc_tsn_enable_launchtime(adapter, type_data);
+ case TC_SETUP_PREEMPT:
+ return igc_save_frame_preemption(adapter, type_data);
+
default:
return -EOPNOTSUPP;
}
--
2.32.0
next prev parent reply other threads:[~2021-06-26 0:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-26 0:33 [Intel-wired-lan] [PATCH net-next v4 00/12] ethtool: Add support for frame preemption Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 01/12] ethtool: Add support for configuring " Vinicius Costa Gomes
2021-06-27 19:43 ` Vladimir Oltean
2022-04-11 22:39 ` Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 02/12] taprio: Add support for frame preemption offload Vinicius Costa Gomes
2021-06-27 19:58 ` Vladimir Oltean
2022-04-11 23:31 ` Vinicius Costa Gomes
2022-04-12 0:08 ` Vladimir Oltean
2022-04-12 0:38 ` Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 03/12] core: Introduce netdev_tc_map_to_queue_mask() Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 04/12] taprio: Replace tc_map_to_queue_mask() Vinicius Costa Gomes
2021-06-27 20:02 ` Vladimir Oltean
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 05/12] mqprio: Add support for frame preemption offload Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 06/12] igc: Add support for enabling frame preemption via ethtool Vinicius Costa Gomes
2021-06-26 0:33 ` Vinicius Costa Gomes [this message]
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 08/12] igc: Simplify TSN flags handling Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 09/12] igc: Add support for setting frame preemption configuration Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 10/12] ethtool: Add support for Frame Preemption verification Vinicius Costa Gomes
2021-06-28 9:17 ` Vladimir Oltean
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 11/12] igc: Check incompatible configs for Frame Preemption Vinicius Costa Gomes
2021-06-28 9:20 ` Vladimir Oltean
2022-04-11 23:36 ` Vinicius Costa Gomes
2021-06-26 0:33 ` [Intel-wired-lan] [PATCH net-next v4 12/12] igc: Add support for Frame Preemption verification Vinicius Costa Gomes
2021-06-28 9:59 ` Vladimir Oltean
2022-04-12 0:13 ` Vinicius Costa Gomes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210626003314.3159402-8-vinicius.gomes@intel.com \
--to=vinicius.gomes@intel.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox