]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.8-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2024 15:14:32 +0000 (17:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2024 15:14:32 +0000 (17:14 +0200)
added patches:
ice-pass-vsi-pointer-into-ice_vc_isvalid_q_id.patch
ice-remove-unnecessary-duplicate-checks-for-vf-vsi-id.patch
net-ks8851-fix-another-tx-stall-caused-by-wrong-isr-flag-handling.patch

queue-6.8/ice-pass-vsi-pointer-into-ice_vc_isvalid_q_id.patch [new file with mode: 0644]
queue-6.8/ice-remove-unnecessary-duplicate-checks-for-vf-vsi-id.patch [new file with mode: 0644]
queue-6.8/net-ks8851-fix-another-tx-stall-caused-by-wrong-isr-flag-handling.patch [new file with mode: 0644]
queue-6.8/series

diff --git a/queue-6.8/ice-pass-vsi-pointer-into-ice_vc_isvalid_q_id.patch b/queue-6.8/ice-pass-vsi-pointer-into-ice_vc_isvalid_q_id.patch
new file mode 100644 (file)
index 0000000..de369aa
--- /dev/null
@@ -0,0 +1,127 @@
+From a21605993dd5dfd15edfa7f06705ede17b519026 Mon Sep 17 00:00:00 2001
+From: Jacob Keller <jacob.e.keller@intel.com>
+Date: Fri, 16 Feb 2024 14:06:35 -0800
+Subject: ice: pass VSI pointer into ice_vc_isvalid_q_id
+
+From: Jacob Keller <jacob.e.keller@intel.com>
+
+commit a21605993dd5dfd15edfa7f06705ede17b519026 upstream.
+
+The ice_vc_isvalid_q_id() function takes a VSI index and a queue ID. It
+looks up the VSI from its index, and then validates that the queue number
+is valid for that VSI.
+
+The VSI ID passed is typically a VSI index from the VF. This VSI number is
+validated by the PF to ensure that it matches the VSI associated with the
+VF already.
+
+In every flow where ice_vc_isvalid_q_id() is called, the PF driver already
+has a pointer to the VSI associated with the VF. This pointer is obtained
+using ice_get_vf_vsi(), rather than looking up the VSI using the index sent
+by the VF.
+
+Since we already know which VSI to operate on, we can modify
+ice_vc_isvalid_q_id() to take a VSI pointer instead of a VSI index. Pass
+the VSI we found from ice_get_vf_vsi() instead of re-doing the lookup. This
+removes some unnecessary computation and scanning of the VSI list.
+
+It also removes the last place where the driver directly used the VSI
+number from the VF. This will pave the way for refactoring to communicate
+relative VSI numbers to the VF instead of absolute numbers from the PF
+space.
+
+Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
+Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
+Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/intel/ice/ice_virtchnl.c |   22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
++++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+@@ -550,17 +550,15 @@ bool ice_vc_isvalid_vsi_id(struct ice_vf
+ /**
+  * ice_vc_isvalid_q_id
+- * @vf: pointer to the VF info
+- * @vsi_id: VSI ID
++ * @vsi: VSI to check queue ID against
+  * @qid: VSI relative queue ID
+  *
+  * check for the valid queue ID
+  */
+-static bool ice_vc_isvalid_q_id(struct ice_vf *vf, u16 vsi_id, u8 qid)
++static bool ice_vc_isvalid_q_id(struct ice_vsi *vsi, u8 qid)
+ {
+-      struct ice_vsi *vsi = ice_find_vsi(vf->pf, vsi_id);
+       /* allocated Tx and Rx queues should be always equal for VF VSI */
+-      return (vsi && (qid < vsi->alloc_txq));
++      return qid < vsi->alloc_txq;
+ }
+ /**
+@@ -1318,7 +1316,7 @@ static int ice_vc_ena_qs_msg(struct ice_
+        */
+       q_map = vqs->rx_queues;
+       for_each_set_bit(vf_q_id, &q_map, ICE_MAX_RSS_QS_PER_VF) {
+-              if (!ice_vc_isvalid_q_id(vf, vqs->vsi_id, vf_q_id)) {
++              if (!ice_vc_isvalid_q_id(vsi, vf_q_id)) {
+                       v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                       goto error_param;
+               }
+@@ -1340,7 +1338,7 @@ static int ice_vc_ena_qs_msg(struct ice_
+       q_map = vqs->tx_queues;
+       for_each_set_bit(vf_q_id, &q_map, ICE_MAX_RSS_QS_PER_VF) {
+-              if (!ice_vc_isvalid_q_id(vf, vqs->vsi_id, vf_q_id)) {
++              if (!ice_vc_isvalid_q_id(vsi, vf_q_id)) {
+                       v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                       goto error_param;
+               }
+@@ -1445,7 +1443,7 @@ static int ice_vc_dis_qs_msg(struct ice_
+               q_map = vqs->tx_queues;
+               for_each_set_bit(vf_q_id, &q_map, ICE_MAX_RSS_QS_PER_VF) {
+-                      if (!ice_vc_isvalid_q_id(vf, vqs->vsi_id, vf_q_id)) {
++                      if (!ice_vc_isvalid_q_id(vsi, vf_q_id)) {
+                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                               goto error_param;
+                       }
+@@ -1471,7 +1469,7 @@ static int ice_vc_dis_qs_msg(struct ice_
+               bitmap_zero(vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF);
+       } else if (q_map) {
+               for_each_set_bit(vf_q_id, &q_map, ICE_MAX_RSS_QS_PER_VF) {
+-                      if (!ice_vc_isvalid_q_id(vf, vqs->vsi_id, vf_q_id)) {
++                      if (!ice_vc_isvalid_q_id(vsi, vf_q_id)) {
+                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                               goto error_param;
+                       }
+@@ -1527,7 +1525,7 @@ ice_cfg_interrupt(struct ice_vf *vf, str
+       for_each_set_bit(vsi_q_id_idx, &qmap, ICE_MAX_RSS_QS_PER_VF) {
+               vsi_q_id = vsi_q_id_idx;
+-              if (!ice_vc_isvalid_q_id(vf, vsi->vsi_num, vsi_q_id))
++              if (!ice_vc_isvalid_q_id(vsi, vsi_q_id))
+                       return VIRTCHNL_STATUS_ERR_PARAM;
+               q_vector->num_ring_rx++;
+@@ -1541,7 +1539,7 @@ ice_cfg_interrupt(struct ice_vf *vf, str
+       for_each_set_bit(vsi_q_id_idx, &qmap, ICE_MAX_RSS_QS_PER_VF) {
+               vsi_q_id = vsi_q_id_idx;
+-              if (!ice_vc_isvalid_q_id(vf, vsi->vsi_num, vsi_q_id))
++              if (!ice_vc_isvalid_q_id(vsi, vsi_q_id))
+                       return VIRTCHNL_STATUS_ERR_PARAM;
+               q_vector->num_ring_tx++;
+@@ -1698,7 +1696,7 @@ static int ice_vc_cfg_qs_msg(struct ice_
+                   qpi->txq.headwb_enabled ||
+                   !ice_vc_isvalid_ring_len(qpi->txq.ring_len) ||
+                   !ice_vc_isvalid_ring_len(qpi->rxq.ring_len) ||
+-                  !ice_vc_isvalid_q_id(vf, qci->vsi_id, qpi->txq.queue_id)) {
++                  !ice_vc_isvalid_q_id(vsi, qpi->txq.queue_id)) {
+                       goto error_param;
+               }
diff --git a/queue-6.8/ice-remove-unnecessary-duplicate-checks-for-vf-vsi-id.patch b/queue-6.8/ice-remove-unnecessary-duplicate-checks-for-vf-vsi-id.patch
new file mode 100644 (file)
index 0000000..262c3bc
--- /dev/null
@@ -0,0 +1,47 @@
+From 363f689600dd010703ce6391bcfc729a97d21840 Mon Sep 17 00:00:00 2001
+From: Jacob Keller <jacob.e.keller@intel.com>
+Date: Fri, 16 Feb 2024 14:06:36 -0800
+Subject: ice: remove unnecessary duplicate checks for VF VSI ID
+
+From: Jacob Keller <jacob.e.keller@intel.com>
+
+commit 363f689600dd010703ce6391bcfc729a97d21840 upstream.
+
+The ice_vc_fdir_param_check() function validates that the VSI ID of the
+virtchnl flow director command matches the VSI number of the VF. This is
+already checked by the call to ice_vc_isvalid_vsi_id() immediately
+following this.
+
+This check is unnecessary since ice_vc_isvalid_vsi_id() already confirms
+this by checking that the VSI ID can locate the VSI associated with the VF
+structure.
+
+Furthermore, a following change is going to refactor the ice driver to
+report VSI IDs using a relative index for each VF instead of reporting the
+PF VSI number. This additional check would break that logic since it
+enforces that the VSI ID matches the VSI number.
+
+Since this check duplicates  the logic in ice_vc_isvalid_vsi_id() and gets
+in the way of refactoring that logic, remove it.
+
+Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
+Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
+Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c |    3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
++++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
+@@ -94,9 +94,6 @@ ice_vc_fdir_param_check(struct ice_vf *v
+       if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FDIR_PF))
+               return -EINVAL;
+-      if (vsi_id != vf->lan_vsi_num)
+-              return -EINVAL;
+-
+       if (!ice_vc_isvalid_vsi_id(vf, vsi_id))
+               return -EINVAL;
diff --git a/queue-6.8/net-ks8851-fix-another-tx-stall-caused-by-wrong-isr-flag-handling.patch b/queue-6.8/net-ks8851-fix-another-tx-stall-caused-by-wrong-isr-flag-handling.patch
new file mode 100644 (file)
index 0000000..344d3d4
--- /dev/null
@@ -0,0 +1,108 @@
+From 317a215d493230da361028ea8a4675de334bfa1a Mon Sep 17 00:00:00 2001
+From: Ronald Wahl <ronald.wahl@raritan.com>
+Date: Mon, 13 May 2024 16:39:22 +0200
+Subject: net: ks8851: Fix another TX stall caused by wrong ISR flag handling
+
+From: Ronald Wahl <ronald.wahl@raritan.com>
+
+commit 317a215d493230da361028ea8a4675de334bfa1a upstream.
+
+Under some circumstances it may happen that the ks8851 Ethernet driver
+stops sending data.
+
+Currently the interrupt handler resets the interrupt status flags in the
+hardware after handling TX. With this approach we may lose interrupts in
+the time window between handling the TX interrupt and resetting the TX
+interrupt status bit.
+
+When all of the three following conditions are true then transmitting
+data stops:
+
+  - TX queue is stopped to wait for room in the hardware TX buffer
+  - no queued SKBs in the driver (txq) that wait for being written to hw
+  - hardware TX buffer is empty and the last TX interrupt was lost
+
+This is because reenabling the TX queue happens when handling the TX
+interrupt status but if the TX status bit has already been cleared then
+this interrupt will never come.
+
+With this commit the interrupt status flags will be cleared before they
+are handled. That way we stop losing interrupts.
+
+The wrong handling of the ISR flags was there from the beginning but
+with commit 3dc5d4454545 ("net: ks8851: Fix TX stall caused by TX
+buffer overrun") the issue becomes apparent.
+
+Fixes: 3dc5d4454545 ("net: ks8851: Fix TX stall caused by TX buffer overrun")
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: Eric Dumazet <edumazet@google.com>
+Cc: Jakub Kicinski <kuba@kernel.org>
+Cc: Paolo Abeni <pabeni@redhat.com>
+Cc: Simon Horman <horms@kernel.org>
+Cc: netdev@vger.kernel.org
+Cc: stable@vger.kernel.org # 5.10+
+Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/micrel/ks8851_common.c |   18 +-----------------
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+--- a/drivers/net/ethernet/micrel/ks8851_common.c
++++ b/drivers/net/ethernet/micrel/ks8851_common.c
+@@ -328,7 +328,6 @@ static irqreturn_t ks8851_irq(int irq, v
+ {
+       struct ks8851_net *ks = _ks;
+       struct sk_buff_head rxq;
+-      unsigned handled = 0;
+       unsigned long flags;
+       unsigned int status;
+       struct sk_buff *skb;
+@@ -336,24 +335,17 @@ static irqreturn_t ks8851_irq(int irq, v
+       ks8851_lock(ks, &flags);
+       status = ks8851_rdreg16(ks, KS_ISR);
++      ks8851_wrreg16(ks, KS_ISR, status);
+       netif_dbg(ks, intr, ks->netdev,
+                 "%s: status 0x%04x\n", __func__, status);
+-      if (status & IRQ_LCI)
+-              handled |= IRQ_LCI;
+-
+       if (status & IRQ_LDI) {
+               u16 pmecr = ks8851_rdreg16(ks, KS_PMECR);
+               pmecr &= ~PMECR_WKEVT_MASK;
+               ks8851_wrreg16(ks, KS_PMECR, pmecr | PMECR_WKEVT_LINK);
+-
+-              handled |= IRQ_LDI;
+       }
+-      if (status & IRQ_RXPSI)
+-              handled |= IRQ_RXPSI;
+-
+       if (status & IRQ_TXI) {
+               unsigned short tx_space = ks8851_rdreg16(ks, KS_TXMIR);
+@@ -365,20 +357,12 @@ static irqreturn_t ks8851_irq(int irq, v
+               if (netif_queue_stopped(ks->netdev))
+                       netif_wake_queue(ks->netdev);
+               spin_unlock(&ks->statelock);
+-
+-              handled |= IRQ_TXI;
+       }
+-      if (status & IRQ_RXI)
+-              handled |= IRQ_RXI;
+-
+       if (status & IRQ_SPIBEI) {
+               netdev_err(ks->netdev, "%s: spi bus error\n", __func__);
+-              handled |= IRQ_SPIBEI;
+       }
+-      ks8851_wrreg16(ks, KS_ISR, handled);
+-
+       if (status & IRQ_RXI) {
+               /* the datasheet says to disable the rx interrupt during
+                * packet read-out, however we're masking the interrupt
index d3d37cd277198a102833320ab6d0d29061c11fa4..124fb1ef0b627c1c1c65ec2601b9cc8e98a01923 100644 (file)
@@ -1 +1,4 @@
 drm-amd-display-fix-division-by-zero-in-setup_dsc_config.patch
+net-ks8851-fix-another-tx-stall-caused-by-wrong-isr-flag-handling.patch
+ice-pass-vsi-pointer-into-ice_vc_isvalid_q_id.patch
+ice-remove-unnecessary-duplicate-checks-for-vf-vsi-id.patch