Skip to content

Commit 70b1aca

Browse files
committed
Merge branch 'intel-wired-lan-driver-updates-2023-10-19-idpf'
Jacob Keller says: ==================== Intel Wired LAN Driver Updates 2023-10-19 (idpf) This series contains two fixes for the recently merged idpf driver. Michal adds missing logic for programming the scheduling mode of completion queues. Pavan fixes a call trace caused by the mailbox work item not being canceled properly if an error occurred during initialization. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 81a4169 + 46d913d commit 70b1aca

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

drivers/net/ethernet/intel/idpf/idpf_txrx.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,13 +1160,17 @@ static void idpf_rxq_set_descids(struct idpf_vport *vport, struct idpf_queue *q)
11601160
*/
11611161
static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
11621162
{
1163+
bool flow_sch_en;
11631164
int err, i;
11641165

11651166
vport->txq_grps = kcalloc(vport->num_txq_grp,
11661167
sizeof(*vport->txq_grps), GFP_KERNEL);
11671168
if (!vport->txq_grps)
11681169
return -ENOMEM;
11691170

1171+
flow_sch_en = !idpf_is_cap_ena(vport->adapter, IDPF_OTHER_CAPS,
1172+
VIRTCHNL2_CAP_SPLITQ_QSCHED);
1173+
11701174
for (i = 0; i < vport->num_txq_grp; i++) {
11711175
struct idpf_txq_group *tx_qgrp = &vport->txq_grps[i];
11721176
struct idpf_adapter *adapter = vport->adapter;
@@ -1195,8 +1199,7 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
11951199
q->txq_grp = tx_qgrp;
11961200
hash_init(q->sched_buf_hash);
11971201

1198-
if (!idpf_is_cap_ena(adapter, IDPF_OTHER_CAPS,
1199-
VIRTCHNL2_CAP_SPLITQ_QSCHED))
1202+
if (flow_sch_en)
12001203
set_bit(__IDPF_Q_FLOW_SCH_EN, q->flags);
12011204
}
12021205

@@ -1215,6 +1218,9 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
12151218
tx_qgrp->complq->desc_count = vport->complq_desc_count;
12161219
tx_qgrp->complq->vport = vport;
12171220
tx_qgrp->complq->txq_grp = tx_qgrp;
1221+
1222+
if (flow_sch_en)
1223+
__set_bit(__IDPF_Q_FLOW_SCH_EN, tx_qgrp->complq->flags);
12181224
}
12191225

12201226
return 0;

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ static int idpf_send_config_tx_queues_msg(struct idpf_vport *vport)
14731473
/* Populate the queue info buffer with all queue context info */
14741474
for (i = 0; i < vport->num_txq_grp; i++) {
14751475
struct idpf_txq_group *tx_qgrp = &vport->txq_grps[i];
1476-
int j;
1476+
int j, sched_mode;
14771477

14781478
for (j = 0; j < tx_qgrp->num_txq; j++, k++) {
14791479
qi[k].queue_id =
@@ -1514,6 +1514,12 @@ static int idpf_send_config_tx_queues_msg(struct idpf_vport *vport)
15141514
qi[k].ring_len = cpu_to_le16(tx_qgrp->complq->desc_count);
15151515
qi[k].dma_ring_addr = cpu_to_le64(tx_qgrp->complq->dma);
15161516

1517+
if (test_bit(__IDPF_Q_FLOW_SCH_EN, tx_qgrp->complq->flags))
1518+
sched_mode = VIRTCHNL2_TXQ_SCHED_MODE_FLOW;
1519+
else
1520+
sched_mode = VIRTCHNL2_TXQ_SCHED_MODE_QUEUE;
1521+
qi[k].sched_mode = cpu_to_le16(sched_mode);
1522+
15171523
k++;
15181524
}
15191525

@@ -3140,6 +3146,7 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
31403146

31413147
err_intr_req:
31423148
cancel_delayed_work_sync(&adapter->serv_task);
3149+
cancel_delayed_work_sync(&adapter->mbx_task);
31433150
idpf_vport_params_buf_rel(adapter);
31443151
err_netdev_alloc:
31453152
kfree(adapter->vports);

0 commit comments

Comments
 (0)