* [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf)
@ 2023-10-23 20:26 Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 1/2] idpf: set scheduling mode for completion queue Jacob Keller
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Jacob Keller @ 2023-10-23 20:26 UTC (permalink / raw)
To: netdev, David Miller, Jakub Kicinski; +Cc: Jacob Keller
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.
Changes since v1:
* Corrected subject line
Michal Kubiak (1):
idpf: set scheduling mode for completion queue
Pavan Kumar Linga (1):
idpf: cancel mailbox work in error path
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 10 ++++++++--
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 9 ++++++++-
2 files changed, 16 insertions(+), 3 deletions(-)
base-commit: 041c3466f39d7073bbc7fb91c4e5d14170d5eb08
--
2.41.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next v2 1/2] idpf: set scheduling mode for completion queue
2023-10-23 20:26 [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jacob Keller
@ 2023-10-23 20:26 ` Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 2/2] idpf: cancel mailbox work in error path Jacob Keller
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jacob Keller @ 2023-10-23 20:26 UTC (permalink / raw)
To: netdev, David Miller, Jakub Kicinski
Cc: Michal Kubiak, Alexander Lobakin, Alan Brady, Przemek Kitszel,
Krishneil Singh, Jacob Keller
From: Michal Kubiak <michal.kubiak@intel.com>
The HW must be programmed differently for queue-based scheduling mode.
To program the completion queue context correctly, the control plane
must know the scheduling mode not only for the Tx queue, but also for
the completion queue.
Unfortunately, currently the driver sets the scheduling mode only for
the Tx queues.
Propagate the scheduling mode data for the completion queue as
well when sending the queue configuration messages.
Fixes: 1c325aac10a8 ("idpf: configure resources for TX queues")
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Reviewed-by: Alan Brady <alan.brady@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Changes since v1:
* corrected subject line
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 10 ++++++++--
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 8 +++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index 6fa79898c42c..58c5412d3173 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -1160,6 +1160,7 @@ static void idpf_rxq_set_descids(struct idpf_vport *vport, struct idpf_queue *q)
*/
static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
{
+ bool flow_sch_en;
int err, i;
vport->txq_grps = kcalloc(vport->num_txq_grp,
@@ -1167,6 +1168,9 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
if (!vport->txq_grps)
return -ENOMEM;
+ flow_sch_en = !idpf_is_cap_ena(vport->adapter, IDPF_OTHER_CAPS,
+ VIRTCHNL2_CAP_SPLITQ_QSCHED);
+
for (i = 0; i < vport->num_txq_grp; i++) {
struct idpf_txq_group *tx_qgrp = &vport->txq_grps[i];
struct idpf_adapter *adapter = vport->adapter;
@@ -1195,8 +1199,7 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
q->txq_grp = tx_qgrp;
hash_init(q->sched_buf_hash);
- if (!idpf_is_cap_ena(adapter, IDPF_OTHER_CAPS,
- VIRTCHNL2_CAP_SPLITQ_QSCHED))
+ if (flow_sch_en)
set_bit(__IDPF_Q_FLOW_SCH_EN, q->flags);
}
@@ -1215,6 +1218,9 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
tx_qgrp->complq->desc_count = vport->complq_desc_count;
tx_qgrp->complq->vport = vport;
tx_qgrp->complq->txq_grp = tx_qgrp;
+
+ if (flow_sch_en)
+ __set_bit(__IDPF_Q_FLOW_SCH_EN, tx_qgrp->complq->flags);
}
return 0;
diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 9bc85b2f1709..e276b5360c2e 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -1473,7 +1473,7 @@ static int idpf_send_config_tx_queues_msg(struct idpf_vport *vport)
/* Populate the queue info buffer with all queue context info */
for (i = 0; i < vport->num_txq_grp; i++) {
struct idpf_txq_group *tx_qgrp = &vport->txq_grps[i];
- int j;
+ int j, sched_mode;
for (j = 0; j < tx_qgrp->num_txq; j++, k++) {
qi[k].queue_id =
@@ -1514,6 +1514,12 @@ static int idpf_send_config_tx_queues_msg(struct idpf_vport *vport)
qi[k].ring_len = cpu_to_le16(tx_qgrp->complq->desc_count);
qi[k].dma_ring_addr = cpu_to_le64(tx_qgrp->complq->dma);
+ if (test_bit(__IDPF_Q_FLOW_SCH_EN, tx_qgrp->complq->flags))
+ sched_mode = VIRTCHNL2_TXQ_SCHED_MODE_FLOW;
+ else
+ sched_mode = VIRTCHNL2_TXQ_SCHED_MODE_QUEUE;
+ qi[k].sched_mode = cpu_to_le16(sched_mode);
+
k++;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v2 2/2] idpf: cancel mailbox work in error path
2023-10-23 20:26 [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 1/2] idpf: set scheduling mode for completion queue Jacob Keller
@ 2023-10-23 20:26 ` Jacob Keller
2023-10-23 22:57 ` [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jakub Kicinski
2023-10-23 23:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Jacob Keller @ 2023-10-23 20:26 UTC (permalink / raw)
To: netdev, David Miller, Jakub Kicinski
Cc: Pavan Kumar Linga, Wojciech Drewek, Krishneil Singh, Jacob Keller
From: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
In idpf_vc_core_init, the mailbox work is queued
on a mailbox workqueue but it is not cancelled on error.
This results in a call trace when idpf_mbx_task tries
to access the freed mailbox queue pointer. Fix it by
cancelling the mailbox work in the error path.
Fixes: 4930fbf419a7 ("idpf: add core init and interrupt request")
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Changes since v1:
* corrected subject line
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index e276b5360c2e..2c1b051fdc0d 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -3146,6 +3146,7 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
err_intr_req:
cancel_delayed_work_sync(&adapter->serv_task);
+ cancel_delayed_work_sync(&adapter->mbx_task);
idpf_vport_params_buf_rel(adapter);
err_netdev_alloc:
kfree(adapter->vports);
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf)
2023-10-23 20:26 [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 1/2] idpf: set scheduling mode for completion queue Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 2/2] idpf: cancel mailbox work in error path Jacob Keller
@ 2023-10-23 22:57 ` Jakub Kicinski
2023-10-23 23:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2023-10-23 22:57 UTC (permalink / raw)
To: Jacob Keller; +Cc: netdev, David Miller
On Mon, 23 Oct 2023 13:26:53 -0700 Jacob Keller wrote:
> Changes since v1:
> * Corrected subject line
The bot guessed correctly, no need to repost for such minutiae unless
explicitly asked.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf)
2023-10-23 20:26 [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jacob Keller
` (2 preceding siblings ...)
2023-10-23 22:57 ` [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jakub Kicinski
@ 2023-10-23 23:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-23 23:00 UTC (permalink / raw)
To: Jacob Keller; +Cc: netdev, davem, kuba
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 23 Oct 2023 13:26:53 -0700 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] idpf: set scheduling mode for completion queue
https://git.kernel.org/netdev/net-next/c/d38b4d0d95bc
- [net-next,v2,2/2] idpf: cancel mailbox work in error path
https://git.kernel.org/netdev/net-next/c/46d913d4800e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-23 23:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 20:26 [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 1/2] idpf: set scheduling mode for completion queue Jacob Keller
2023-10-23 20:26 ` [PATCH net-next v2 2/2] idpf: cancel mailbox work in error path Jacob Keller
2023-10-23 22:57 ` [PATCH net-next v2 0/2] Intel Wired LAN Driver Updates 2023-10-19 (idpf) Jakub Kicinski
2023-10-23 23:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).