Skip to content

Commit a7d45bc

Browse files
Faizal Rahimanguy11
authored andcommitted
igc: add preemptible queue support in mqprio
igc already supports enabling MAC Merge for FPE. This patch adds support for preemptible queues in mqprio. Tested preemption with mqprio by: 1. Enable FPE: ethtool --set-mm enp1s0 pmac-enabled on tx-enabled on verify-enabled on 2. Enable preemptible queue in mqprio: mqprio num_tc 4 map 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 \ queues 1@0 1@1 1@2 1@3 \ fp P P P E Signed-off-by: Faizal Rahim <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Mor Bar-Gabay <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 1764348 commit a7d45bc

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6765,6 +6765,7 @@ static int igc_tsn_enable_mqprio(struct igc_adapter *adapter,
67656765

67666766
if (!mqprio->qopt.num_tc) {
67676767
adapter->strict_priority_enable = false;
6768+
igc_fpe_clear_preempt_queue(adapter);
67686769
netdev_reset_tc(adapter->netdev);
67696770
goto apply;
67706771
}
@@ -6792,13 +6793,6 @@ static int igc_tsn_enable_mqprio(struct igc_adapter *adapter,
67926793
return -EOPNOTSUPP;
67936794
}
67946795

6795-
/* Preemption is not supported yet. */
6796-
if (mqprio->preemptible_tcs) {
6797-
NL_SET_ERR_MSG_MOD(mqprio->extack,
6798-
"Preemption is not supported yet");
6799-
return -EOPNOTSUPP;
6800-
}
6801-
68026796
igc_save_mqprio_params(adapter, mqprio->qopt.num_tc,
68036797
mqprio->qopt.offset);
68046798

@@ -6818,6 +6812,7 @@ static int igc_tsn_enable_mqprio(struct igc_adapter *adapter,
68186812
adapter->queue_per_tc[i] = i;
68196813

68206814
mqprio->qopt.hw = TC_MQPRIO_HW_OFFLOAD_TCS;
6815+
igc_fpe_save_preempt_queue(adapter, mqprio);
68216816

68226817
apply:
68236818
return igc_tsn_offload_apply(adapter);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ void igc_fpe_init(struct igc_adapter *adapter)
160160
ethtool_mmsv_init(&adapter->fpe.mmsv, adapter->netdev, &igc_mmsv_ops);
161161
}
162162

163+
void igc_fpe_clear_preempt_queue(struct igc_adapter *adapter)
164+
{
165+
for (int i = 0; i < adapter->num_tx_queues; i++) {
166+
struct igc_ring *tx_ring = adapter->tx_ring[i];
167+
168+
tx_ring->preemptible = false;
169+
}
170+
}
171+
163172
static u32 igc_fpe_map_preempt_tc_to_queue(const struct igc_adapter *adapter,
164173
unsigned long preemptible_tcs)
165174
{

drivers/net/ethernet/intel/igc/igc_tsn.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ enum igc_txd_popts_type {
1717
DECLARE_STATIC_KEY_FALSE(igc_fpe_enabled);
1818

1919
void igc_fpe_init(struct igc_adapter *adapter);
20+
void igc_fpe_clear_preempt_queue(struct igc_adapter *adapter);
2021
void igc_fpe_save_preempt_queue(struct igc_adapter *adapter,
2122
const struct tc_mqprio_qopt_offload *mqprio);
2223
u32 igc_fpe_get_supported_frag_size(u32 frag_size);

0 commit comments

Comments
 (0)