]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ice: make ice_vsi_cfg_rxq() static
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Tue, 23 Jan 2024 11:58:45 +0000 (12:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:49:31 +0000 (09:49 +0200)
[ Upstream commit 3e5fb691faee1d43ee13d4ce2666b0a05e1555b3 ]

Currently, XSK control path in ice driver calls directly
ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that
purpose. Use the latter from XSK side and make ice_vsi_cfg_rxq() static.

ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce
the code churn let us move two callers of it from ice_lib.c to
ice_base.c.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Stable-dep-of: e77f43d531af ("Bluetooth: hci_core: Fix not handling hdev->le_num_of_adv_sets=1")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_base.c
drivers/net/ethernet/intel/ice/ice_base.h
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_lib.h
drivers/net/ethernet/intel/ice/ice_xsk.c

index c979192e44d108b370ad132ec900c19d8452db32..9263754c9525de7e20eff208eed2a021753093ce 100644 (file)
@@ -536,7 +536,7 @@ static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring)
  *
  * Return 0 on success and a negative value on error.
  */
-int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
+static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
 {
        struct device *dev = ice_pf_to_dev(ring->vsi->back);
        u32 num_bufs = ICE_RX_DESC_UNUSED(ring);
@@ -631,6 +631,62 @@ int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
        return 0;
 }
 
+int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx)
+{
+       if (q_idx >= vsi->num_rxq)
+               return -EINVAL;
+
+       return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]);
+}
+
+/**
+ * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length
+ * @vsi: VSI
+ */
+static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi)
+{
+       if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) {
+               vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX;
+               vsi->rx_buf_len = ICE_RXBUF_1664;
+#if (PAGE_SIZE < 8192)
+       } else if (!ICE_2K_TOO_SMALL_WITH_PADDING &&
+                  (vsi->netdev->mtu <= ETH_DATA_LEN)) {
+               vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN;
+               vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN;
+#endif
+       } else {
+               vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX;
+               vsi->rx_buf_len = ICE_RXBUF_3072;
+       }
+}
+
+/**
+ * ice_vsi_cfg_rxqs - Configure the VSI for Rx
+ * @vsi: the VSI being configured
+ *
+ * Return 0 on success and a negative value on error
+ * Configure the Rx VSI for operation.
+ */
+int ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
+{
+       u16 i;
+
+       if (vsi->type == ICE_VSI_VF)
+               goto setup_rings;
+
+       ice_vsi_cfg_frame_size(vsi);
+setup_rings:
+       /* set up individual rings */
+       ice_for_each_rxq(vsi, i) {
+               int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]);
+
+               if (err)
+                       return err;
+       }
+
+       return 0;
+}
+
 /**
  * __ice_vsi_get_qs - helper function for assigning queues from PF to VSI
  * @qs_cfg: gathered variables needed for pf->vsi queues assignment
index 17321ba75602d412f9971e38b684eebb7e001d20..85e6076445602c7c0df9ecdc67fffde083ebbf4b 100644 (file)
@@ -6,7 +6,8 @@
 
 #include "ice.h"
 
-int ice_vsi_cfg_rxq(struct ice_rx_ring *ring);
+int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx);
+int ice_vsi_cfg_rxqs(struct ice_vsi *vsi);
 int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg);
 int
 ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait);
index cfc20684f25ab8b3c583b56d66f9f10fc9d48b9e..27b3423c9ff23eab2979c3a31b1bba0f4c62a63c 100644 (file)
@@ -1671,27 +1671,6 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi)
        }
 }
 
-/**
- * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length
- * @vsi: VSI
- */
-static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi)
-{
-       if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) {
-               vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX;
-               vsi->rx_buf_len = ICE_RXBUF_1664;
-#if (PAGE_SIZE < 8192)
-       } else if (!ICE_2K_TOO_SMALL_WITH_PADDING &&
-                  (vsi->netdev->mtu <= ETH_DATA_LEN)) {
-               vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN;
-               vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN;
-#endif
-       } else {
-               vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX;
-               vsi->rx_buf_len = ICE_RXBUF_3072;
-       }
-}
-
 /**
  * ice_pf_state_is_nominal - checks the PF for nominal state
  * @pf: pointer to PF to check
@@ -1795,14 +1774,6 @@ ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio,
        wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
 }
 
-int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx)
-{
-       if (q_idx >= vsi->num_rxq)
-               return -EINVAL;
-
-       return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]);
-}
-
 int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx)
 {
        DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1);
@@ -1815,33 +1786,6 @@ int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u
        return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf);
 }
 
-/**
- * ice_vsi_cfg_rxqs - Configure the VSI for Rx
- * @vsi: the VSI being configured
- *
- * Return 0 on success and a negative value on error
- * Configure the Rx VSI for operation.
- */
-int ice_vsi_cfg_rxqs(struct ice_vsi *vsi)
-{
-       u16 i;
-
-       if (vsi->type == ICE_VSI_VF)
-               goto setup_rings;
-
-       ice_vsi_cfg_frame_size(vsi);
-setup_rings:
-       /* set up individual rings */
-       ice_for_each_rxq(vsi, i) {
-               int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]);
-
-               if (err)
-                       return err;
-       }
-
-       return 0;
-}
-
 /**
  * ice_vsi_cfg_txqs - Configure the VSI for Tx
  * @vsi: the VSI being configured
index bfcfc582a4c04ff143390e394d0b65a1d0970391..95505a501a935a7721e11bf205995eb93f7e6b7c 100644 (file)
@@ -54,12 +54,8 @@ bool ice_pf_state_is_nominal(struct ice_pf *pf);
 
 void ice_update_eth_stats(struct ice_vsi *vsi);
 
-int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx);
-
 int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx);
 
-int ice_vsi_cfg_rxqs(struct ice_vsi *vsi);
-
 int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi);
 
 void ice_vsi_cfg_msix(struct ice_vsi *vsi);
index 2eecd0f39aa696e1c24083f03bf9a1908c121fdd..9e01f410af77240de380aa1c0b9bc8c99271a418 100644 (file)
@@ -250,7 +250,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
                ice_tx_xsk_pool(vsi, q_idx);
        }
 
-       err = ice_vsi_cfg_rxq(rx_ring);
+       err = ice_vsi_cfg_single_rxq(vsi, q_idx);
        if (err)
                return err;