netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-next 0/2] iavf: make some functions static
@ 2023-06-13 14:12 Przemek Kitszel
  2023-06-13 14:12 ` [PATCH iwl-next 1/2] iavf: remove some unused functions and pointless wrappers Przemek Kitszel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Przemek Kitszel @ 2023-06-13 14:12 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: netdev, Tony Nguyen, Ahmed Zaki, Maciej Fijalkowski,
	Przemek Kitszel

Make static functions that are used in just one translation unit.
Remove all unused and unexported functions.

Przemek Kitszel (2):
  iavf: remove some unused functions and pointless wrappers
  iavf: make functions static where possible

 drivers/net/ethernet/intel/iavf/iavf.h        | 10 -----
 drivers/net/ethernet/intel/iavf/iavf_alloc.h  |  3 +-
 drivers/net/ethernet/intel/iavf/iavf_common.c | 45 -------------------
 drivers/net/ethernet/intel/iavf/iavf_main.c   | 34 ++++++--------
 drivers/net/ethernet/intel/iavf/iavf_osdep.h  |  9 ----
 .../net/ethernet/intel/iavf/iavf_prototype.h  |  5 ---
 drivers/net/ethernet/intel/iavf/iavf_txrx.c   | 43 +++++++++---------
 drivers/net/ethernet/intel/iavf/iavf_txrx.h   |  4 --
 8 files changed, 35 insertions(+), 118 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH iwl-next 1/2] iavf: remove some unused functions and pointless wrappers
  2023-06-13 14:12 [PATCH iwl-next 0/2] iavf: make some functions static Przemek Kitszel
@ 2023-06-13 14:12 ` Przemek Kitszel
  2023-06-13 14:12 ` [PATCH iwl-next 2/2] iavf: make functions static where possible Przemek Kitszel
  2023-06-14 17:27 ` [PATCH iwl-next 0/2] iavf: make some functions static Tony Nguyen
  2 siblings, 0 replies; 6+ messages in thread
From: Przemek Kitszel @ 2023-06-13 14:12 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: netdev, Tony Nguyen, Ahmed Zaki, Maciej Fijalkowski,
	Przemek Kitszel

Remove iavf_aq_get_rss_lut(), iavf_aq_get_rss_key(), iavf_vf_reset().

Remove some "OS specific memory free for shared code" wrappers ;)

Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_alloc.h  |  3 +-
 drivers/net/ethernet/intel/iavf/iavf_common.c | 45 -------------------
 drivers/net/ethernet/intel/iavf/iavf_main.c   | 20 +++------
 drivers/net/ethernet/intel/iavf/iavf_osdep.h  |  9 ----
 .../net/ethernet/intel/iavf/iavf_prototype.h  |  5 ---
 5 files changed, 7 insertions(+), 75 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_alloc.h b/drivers/net/ethernet/intel/iavf/iavf_alloc.h
index 2711573c14ec..162ea70685a6 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_alloc.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_alloc.h
@@ -28,7 +28,6 @@ enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw,
 				   struct iavf_dma_mem *mem);
 enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
 					struct iavf_virt_mem *mem, u32 size);
-enum iavf_status iavf_free_virt_mem(struct iavf_hw *hw,
-				    struct iavf_virt_mem *mem);
+void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem);
 
 #endif /* _IAVF_ALLOC_H_ */
diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
index dd11dbbd5551..1afd761d8052 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_common.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
@@ -35,7 +35,6 @@ enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
 		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
 	}
 
-	hw_dbg(hw, "found mac: %d, returns: %d\n", hw->mac.type, status);
 	return status;
 }
 
@@ -397,23 +396,6 @@ static enum iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw,
 	return status;
 }
 
-/**
- * iavf_aq_get_rss_lut
- * @hw: pointer to the hardware structure
- * @vsi_id: vsi fw index
- * @pf_lut: for PF table set true, for VSI table set false
- * @lut: pointer to the lut buffer provided by the caller
- * @lut_size: size of the lut buffer
- *
- * get the RSS lookup table, PF or VSI type
- **/
-enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id,
-				     bool pf_lut, u8 *lut, u16 lut_size)
-{
-	return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size,
-				       false);
-}
-
 /**
  * iavf_aq_set_rss_lut
  * @hw: pointer to the hardware structure
@@ -472,19 +454,6 @@ iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
 	return status;
 }
 
-/**
- * iavf_aq_get_rss_key
- * @hw: pointer to the hw struct
- * @vsi_id: vsi fw index
- * @key: pointer to key info struct
- *
- **/
-enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id,
-				     struct iavf_aqc_get_set_rss_key_data *key)
-{
-	return iavf_aq_get_set_rss_key(hw, vsi_id, key, false);
-}
-
 /**
  * iavf_aq_set_rss_key
  * @hw: pointer to the hw struct
@@ -828,17 +797,3 @@ void iavf_vf_parse_hw_config(struct iavf_hw *hw,
 		vsi_res++;
 	}
 }
-
-/**
- * iavf_vf_reset
- * @hw: pointer to the hardware structure
- *
- * Send a VF_RESET message to the PF. Does not wait for response from PF
- * as none will be forthcoming. Immediately after calling this function,
- * the admin queue should be shut down and (optionally) reinitialized.
- **/
-enum iavf_status iavf_vf_reset(struct iavf_hw *hw)
-{
-	return iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
-				      0, NULL, 0, NULL);
-}
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index cf43e71e9c4f..adb9d3fe1a28 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -231,12 +231,11 @@ enum iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
 }
 
 /**
- * iavf_free_dma_mem_d - OS specific memory free for shared code
+ * iavf_free_dma_mem - wrapper for DMA memory freeing
  * @hw:   pointer to the HW structure
  * @mem:  ptr to mem struct to free
  **/
-enum iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw,
-				     struct iavf_dma_mem *mem)
+enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem)
 {
 	struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back;
 
@@ -248,12 +247,12 @@ enum iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw,
 }
 
 /**
- * iavf_allocate_virt_mem_d - OS specific memory alloc for shared code
+ * iavf_allocate_virt_mem - virt memory alloc wrapper
  * @hw:   pointer to the HW structure
  * @mem:  ptr to mem struct to fill out
  * @size: size of memory requested
  **/
-enum iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
+enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
 					  struct iavf_virt_mem *mem, u32 size)
 {
 	if (!mem)
@@ -269,20 +268,13 @@ enum iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
 }
 
 /**
- * iavf_free_virt_mem_d - OS specific memory free for shared code
+ * iavf_free_virt_mem - virt memory free wrapper
  * @hw:   pointer to the HW structure
  * @mem:  ptr to mem struct to free
  **/
-enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw,
-				      struct iavf_virt_mem *mem)
+void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem)
 {
-	if (!mem)
-		return IAVF_ERR_PARAM;
-
-	/* it's ok to kfree a NULL pointer */
 	kfree(mem->va);
-
-	return 0;
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/iavf/iavf_osdep.h b/drivers/net/ethernet/intel/iavf/iavf_osdep.h
index a452ce90679a..77d33deaabb5 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_osdep.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_osdep.h
@@ -13,12 +13,6 @@
 /* get readq/writeq support for 32 bit kernels, use the low-first version */
 #include <linux/io-64-nonatomic-lo-hi.h>
 
-/* File to be the magic between shared code and
- * actual OS primitives
- */
-
-#define hw_dbg(hw, S, A...)	do {} while (0)
-
 #define wr32(a, reg, value)	writel((value), ((a)->hw_addr + (reg)))
 #define rd32(a, reg)		readl((a)->hw_addr + (reg))
 
@@ -35,14 +29,11 @@ struct iavf_dma_mem {
 
 #define iavf_allocate_dma_mem(h, m, unused, s, a) \
 	iavf_allocate_dma_mem_d(h, m, s, a)
-#define iavf_free_dma_mem(h, m) iavf_free_dma_mem_d(h, m)
 
 struct iavf_virt_mem {
 	void *va;
 	u32 size;
 };
-#define iavf_allocate_virt_mem(h, m, s) iavf_allocate_virt_mem_d(h, m, s)
-#define iavf_free_virt_mem(h, m) iavf_free_virt_mem_d(h, m)
 
 #define iavf_debug(h, m, s, ...)				\
 do {								\
diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
index edebfbbcffdc..940cb4203fbe 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
@@ -40,12 +40,8 @@ enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
 const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err);
 const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err);
 
-enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
-				     bool pf_lut, u8 *lut, u16 lut_size);
 enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
 				     bool pf_lut, u8 *lut, u16 lut_size);
-enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid,
-				     struct iavf_aqc_get_set_rss_key_data *key);
 enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
 				     struct iavf_aqc_get_set_rss_key_data *key);
 
@@ -60,7 +56,6 @@ static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
 
 void iavf_vf_parse_hw_config(struct iavf_hw *hw,
 			     struct virtchnl_vf_resource *msg);
-enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
 enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
 					enum virtchnl_ops v_opcode,
 					enum iavf_status v_retval,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH iwl-next 2/2] iavf: make functions static where possible
  2023-06-13 14:12 [PATCH iwl-next 0/2] iavf: make some functions static Przemek Kitszel
  2023-06-13 14:12 ` [PATCH iwl-next 1/2] iavf: remove some unused functions and pointless wrappers Przemek Kitszel
@ 2023-06-13 14:12 ` Przemek Kitszel
  2023-06-13 14:23   ` [Intel-wired-lan] " Paul Menzel
  2023-06-14 17:27 ` [PATCH iwl-next 0/2] iavf: make some functions static Tony Nguyen
  2 siblings, 1 reply; 6+ messages in thread
From: Przemek Kitszel @ 2023-06-13 14:12 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: netdev, Tony Nguyen, Ahmed Zaki, Maciej Fijalkowski,
	Przemek Kitszel

Make static all the possible funnctions.

Move iavf_force_wb() up to avoid forward declaration.

Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf.h      | 10 -----
 drivers/net/ethernet/intel/iavf/iavf_main.c | 14 +++----
 drivers/net/ethernet/intel/iavf/iavf_txrx.c | 43 ++++++++++-----------
 drivers/net/ethernet/intel/iavf/iavf_txrx.h |  4 --
 4 files changed, 28 insertions(+), 43 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h
index 8f29af80de8c..8cbdebc5b698 100644
--- a/drivers/net/ethernet/intel/iavf/iavf.h
+++ b/drivers/net/ethernet/intel/iavf/iavf.h
@@ -526,9 +526,6 @@ void iavf_schedule_finish_config(struct iavf_adapter *adapter);
 void iavf_reset(struct iavf_adapter *adapter);
 void iavf_set_ethtool_ops(struct net_device *netdev);
 void iavf_update_stats(struct iavf_adapter *adapter);
-void iavf_reset_interrupt_capability(struct iavf_adapter *adapter);
-int iavf_init_interrupt_scheme(struct iavf_adapter *adapter);
-void iavf_irq_enable_queues(struct iavf_adapter *adapter);
 void iavf_free_all_tx_resources(struct iavf_adapter *adapter);
 void iavf_free_all_rx_resources(struct iavf_adapter *adapter);
 
@@ -582,12 +579,6 @@ void iavf_enable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
 void iavf_disable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
 void iavf_enable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid);
 void iavf_disable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid);
-int iavf_replace_primary_mac(struct iavf_adapter *adapter,
-			     const u8 *new_mac);
-void
-iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
-			       netdev_features_t prev_features,
-			       netdev_features_t features);
 void iavf_add_fdir_filter(struct iavf_adapter *adapter);
 void iavf_del_fdir_filter(struct iavf_adapter *adapter);
 void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
@@ -595,5 +586,4 @@ void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
 struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
 					const u8 *macaddr);
 int iavf_wait_for_reset(struct iavf_adapter *adapter);
-int iavf_lock_timeout(struct mutex *lock, unsigned int msecs);
 #endif /* _IAVF_H_ */
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index adb9d3fe1a28..a61d1692c91d 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -284,7 +284,7 @@ void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem)
  *
  * Returns 0 on success, negative on failure
  **/
-int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
+static int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
 {
 	unsigned int wait, delay = 10;
 
@@ -395,7 +395,7 @@ static void iavf_irq_disable(struct iavf_adapter *adapter)
  * iavf_irq_enable_queues - Enable interrupt for all queues
  * @adapter: board private structure
  **/
-void iavf_irq_enable_queues(struct iavf_adapter *adapter)
+static void iavf_irq_enable_queues(struct iavf_adapter *adapter)
 {
 	struct iavf_hw *hw = &adapter->hw;
 	int i;
@@ -1036,8 +1036,8 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
  *
  * Do not call this with mac_vlan_list_lock!
  **/
-int iavf_replace_primary_mac(struct iavf_adapter *adapter,
-			     const u8 *new_mac)
+static int iavf_replace_primary_mac(struct iavf_adapter *adapter,
+				    const u8 *new_mac)
 {
 	struct iavf_hw *hw = &adapter->hw;
 	struct iavf_mac_filter *new_f;
@@ -1888,7 +1888,7 @@ static void iavf_free_q_vectors(struct iavf_adapter *adapter)
  * @adapter: board private structure
  *
  **/
-void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
+static void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
 {
 	if (!adapter->msix_entries)
 		return;
@@ -1903,7 +1903,7 @@ void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
  * @adapter: board private structure to initialize
  *
  **/
-int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)
+static int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)
 {
 	int err;
 
@@ -2272,7 +2272,7 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
  * the watchdog if any changes are requested to expedite the request via
  * virtchnl.
  **/
-void
+static void
 iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
 			       netdev_features_t prev_features,
 			       netdev_features_t features)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
index e989feda133c..8c5f6096b002 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
@@ -54,7 +54,7 @@ static void iavf_unmap_and_free_tx_resource(struct iavf_ring *ring,
  * iavf_clean_tx_ring - Free any empty Tx buffers
  * @tx_ring: ring to be cleaned
  **/
-void iavf_clean_tx_ring(struct iavf_ring *tx_ring)
+static void iavf_clean_tx_ring(struct iavf_ring *tx_ring)
 {
 	unsigned long bi_size;
 	u16 i;
@@ -110,7 +110,7 @@ void iavf_free_tx_resources(struct iavf_ring *tx_ring)
  * Since there is no access to the ring head register
  * in XL710, we need to use our local copies
  **/
-u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
+static u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
 {
 	u32 head, tail;
 
@@ -127,6 +127,24 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
 	return 0;
 }
 
+/**
+ * iavf_force_wb - Issue SW Interrupt so HW does a wb
+ * @vsi: the VSI we care about
+ * @q_vector: the vector on which to force writeback
+ **/
+static void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector)
+{
+	u32 val = IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
+		  IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */
+		  IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |
+		  IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK
+		  /* allow 00 to be written to the index */;
+
+	wr32(&vsi->back->hw,
+	     IAVF_VFINT_DYN_CTLN1(q_vector->reg_idx),
+	     val);
+}
+
 /**
  * iavf_detect_recover_hung - Function to detect and recover hung_queues
  * @vsi:  pointer to vsi struct with tx queues
@@ -352,25 +370,6 @@ static void iavf_enable_wb_on_itr(struct iavf_vsi *vsi,
 	q_vector->arm_wb_state = true;
 }
 
-/**
- * iavf_force_wb - Issue SW Interrupt so HW does a wb
- * @vsi: the VSI we care about
- * @q_vector: the vector  on which to force writeback
- *
- **/
-void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector)
-{
-	u32 val = IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
-		  IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */
-		  IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |
-		  IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK
-		  /* allow 00 to be written to the index */;
-
-	wr32(&vsi->back->hw,
-	     IAVF_VFINT_DYN_CTLN1(q_vector->reg_idx),
-	     val);
-}
-
 static inline bool iavf_container_is_rx(struct iavf_q_vector *q_vector,
 					struct iavf_ring_container *rc)
 {
@@ -687,7 +686,7 @@ int iavf_setup_tx_descriptors(struct iavf_ring *tx_ring)
  * iavf_clean_rx_ring - Free Rx buffers
  * @rx_ring: ring to be cleaned
  **/
-void iavf_clean_rx_ring(struct iavf_ring *rx_ring)
+static void iavf_clean_rx_ring(struct iavf_ring *rx_ring)
 {
 	unsigned long bi_size;
 	u16 i;
diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.h b/drivers/net/ethernet/intel/iavf/iavf_txrx.h
index 2624bf6d009e..7e6ee32d19b6 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_txrx.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.h
@@ -442,15 +442,11 @@ static inline unsigned int iavf_rx_pg_order(struct iavf_ring *ring)
 
 bool iavf_alloc_rx_buffers(struct iavf_ring *rxr, u16 cleaned_count);
 netdev_tx_t iavf_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
-void iavf_clean_tx_ring(struct iavf_ring *tx_ring);
-void iavf_clean_rx_ring(struct iavf_ring *rx_ring);
 int iavf_setup_tx_descriptors(struct iavf_ring *tx_ring);
 int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring);
 void iavf_free_tx_resources(struct iavf_ring *tx_ring);
 void iavf_free_rx_resources(struct iavf_ring *rx_ring);
 int iavf_napi_poll(struct napi_struct *napi, int budget);
-void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector);
-u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw);
 void iavf_detect_recover_hung(struct iavf_vsi *vsi);
 int __iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size);
 bool __iavf_chk_linearize(struct sk_buff *skb);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-next 2/2] iavf: make functions static where possible
  2023-06-13 14:12 ` [PATCH iwl-next 2/2] iavf: make functions static where possible Przemek Kitszel
@ 2023-06-13 14:23   ` Paul Menzel
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Menzel @ 2023-06-13 14:23 UTC (permalink / raw)
  To: Przemek Kitszel; +Cc: intel-wired-lan, netdev, Tony Nguyen

Dear Przemek,


Am 13.06.23 um 16:12 schrieb Przemek Kitszel:
> Make static all the possible funnctions.

functions

Maybe:

Make all possible functions static.


Kind regards,

Paul


> Move iavf_force_wb() up to avoid forward declaration.
> 
> Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
>   drivers/net/ethernet/intel/iavf/iavf.h      | 10 -----
>   drivers/net/ethernet/intel/iavf/iavf_main.c | 14 +++----
>   drivers/net/ethernet/intel/iavf/iavf_txrx.c | 43 ++++++++++-----------
>   drivers/net/ethernet/intel/iavf/iavf_txrx.h |  4 --
>   4 files changed, 28 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h
> index 8f29af80de8c..8cbdebc5b698 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf.h
> @@ -526,9 +526,6 @@ void iavf_schedule_finish_config(struct iavf_adapter *adapter);
>   void iavf_reset(struct iavf_adapter *adapter);
>   void iavf_set_ethtool_ops(struct net_device *netdev);
>   void iavf_update_stats(struct iavf_adapter *adapter);
> -void iavf_reset_interrupt_capability(struct iavf_adapter *adapter);
> -int iavf_init_interrupt_scheme(struct iavf_adapter *adapter);
> -void iavf_irq_enable_queues(struct iavf_adapter *adapter);
>   void iavf_free_all_tx_resources(struct iavf_adapter *adapter);
>   void iavf_free_all_rx_resources(struct iavf_adapter *adapter);
>   
> @@ -582,12 +579,6 @@ void iavf_enable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
>   void iavf_disable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
>   void iavf_enable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid);
>   void iavf_disable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid);
> -int iavf_replace_primary_mac(struct iavf_adapter *adapter,
> -			     const u8 *new_mac);
> -void
> -iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
> -			       netdev_features_t prev_features,
> -			       netdev_features_t features);
>   void iavf_add_fdir_filter(struct iavf_adapter *adapter);
>   void iavf_del_fdir_filter(struct iavf_adapter *adapter);
>   void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
> @@ -595,5 +586,4 @@ void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
>   struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
>   					const u8 *macaddr);
>   int iavf_wait_for_reset(struct iavf_adapter *adapter);
> -int iavf_lock_timeout(struct mutex *lock, unsigned int msecs);
>   #endif /* _IAVF_H_ */
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index adb9d3fe1a28..a61d1692c91d 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -284,7 +284,7 @@ void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem)
>    *
>    * Returns 0 on success, negative on failure
>    **/
> -int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
> +static int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
>   {
>   	unsigned int wait, delay = 10;
>   
> @@ -395,7 +395,7 @@ static void iavf_irq_disable(struct iavf_adapter *adapter)
>    * iavf_irq_enable_queues - Enable interrupt for all queues
>    * @adapter: board private structure
>    **/
> -void iavf_irq_enable_queues(struct iavf_adapter *adapter)
> +static void iavf_irq_enable_queues(struct iavf_adapter *adapter)
>   {
>   	struct iavf_hw *hw = &adapter->hw;
>   	int i;
> @@ -1036,8 +1036,8 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
>    *
>    * Do not call this with mac_vlan_list_lock!
>    **/
> -int iavf_replace_primary_mac(struct iavf_adapter *adapter,
> -			     const u8 *new_mac)
> +static int iavf_replace_primary_mac(struct iavf_adapter *adapter,
> +				    const u8 *new_mac)
>   {
>   	struct iavf_hw *hw = &adapter->hw;
>   	struct iavf_mac_filter *new_f;
> @@ -1888,7 +1888,7 @@ static void iavf_free_q_vectors(struct iavf_adapter *adapter)
>    * @adapter: board private structure
>    *
>    **/
> -void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
> +static void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
>   {
>   	if (!adapter->msix_entries)
>   		return;
> @@ -1903,7 +1903,7 @@ void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
>    * @adapter: board private structure to initialize
>    *
>    **/
> -int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)
> +static int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)
>   {
>   	int err;
>   
> @@ -2272,7 +2272,7 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
>    * the watchdog if any changes are requested to expedite the request via
>    * virtchnl.
>    **/
> -void
> +static void
>   iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
>   			       netdev_features_t prev_features,
>   			       netdev_features_t features)
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> index e989feda133c..8c5f6096b002 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> @@ -54,7 +54,7 @@ static void iavf_unmap_and_free_tx_resource(struct iavf_ring *ring,
>    * iavf_clean_tx_ring - Free any empty Tx buffers
>    * @tx_ring: ring to be cleaned
>    **/
> -void iavf_clean_tx_ring(struct iavf_ring *tx_ring)
> +static void iavf_clean_tx_ring(struct iavf_ring *tx_ring)
>   {
>   	unsigned long bi_size;
>   	u16 i;
> @@ -110,7 +110,7 @@ void iavf_free_tx_resources(struct iavf_ring *tx_ring)
>    * Since there is no access to the ring head register
>    * in XL710, we need to use our local copies
>    **/
> -u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
> +static u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
>   {
>   	u32 head, tail;
>   
> @@ -127,6 +127,24 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
>   	return 0;
>   }
>   
> +/**
> + * iavf_force_wb - Issue SW Interrupt so HW does a wb
> + * @vsi: the VSI we care about
> + * @q_vector: the vector on which to force writeback
> + **/
> +static void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector)
> +{
> +	u32 val = IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
> +		  IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */
> +		  IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |
> +		  IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK
> +		  /* allow 00 to be written to the index */;
> +
> +	wr32(&vsi->back->hw,
> +	     IAVF_VFINT_DYN_CTLN1(q_vector->reg_idx),
> +	     val);
> +}
> +
>   /**
>    * iavf_detect_recover_hung - Function to detect and recover hung_queues
>    * @vsi:  pointer to vsi struct with tx queues
> @@ -352,25 +370,6 @@ static void iavf_enable_wb_on_itr(struct iavf_vsi *vsi,
>   	q_vector->arm_wb_state = true;
>   }
>   
> -/**
> - * iavf_force_wb - Issue SW Interrupt so HW does a wb
> - * @vsi: the VSI we care about
> - * @q_vector: the vector  on which to force writeback
> - *
> - **/
> -void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector)
> -{
> -	u32 val = IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
> -		  IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK | /* set noitr */
> -		  IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |
> -		  IAVF_VFINT_DYN_CTLN1_SW_ITR_INDX_ENA_MASK
> -		  /* allow 00 to be written to the index */;
> -
> -	wr32(&vsi->back->hw,
> -	     IAVF_VFINT_DYN_CTLN1(q_vector->reg_idx),
> -	     val);
> -}
> -
>   static inline bool iavf_container_is_rx(struct iavf_q_vector *q_vector,
>   					struct iavf_ring_container *rc)
>   {
> @@ -687,7 +686,7 @@ int iavf_setup_tx_descriptors(struct iavf_ring *tx_ring)
>    * iavf_clean_rx_ring - Free Rx buffers
>    * @rx_ring: ring to be cleaned
>    **/
> -void iavf_clean_rx_ring(struct iavf_ring *rx_ring)
> +static void iavf_clean_rx_ring(struct iavf_ring *rx_ring)
>   {
>   	unsigned long bi_size;
>   	u16 i;
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.h b/drivers/net/ethernet/intel/iavf/iavf_txrx.h
> index 2624bf6d009e..7e6ee32d19b6 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.h
> @@ -442,15 +442,11 @@ static inline unsigned int iavf_rx_pg_order(struct iavf_ring *ring)
>   
>   bool iavf_alloc_rx_buffers(struct iavf_ring *rxr, u16 cleaned_count);
>   netdev_tx_t iavf_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
> -void iavf_clean_tx_ring(struct iavf_ring *tx_ring);
> -void iavf_clean_rx_ring(struct iavf_ring *rx_ring);
>   int iavf_setup_tx_descriptors(struct iavf_ring *tx_ring);
>   int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring);
>   void iavf_free_tx_resources(struct iavf_ring *tx_ring);
>   void iavf_free_rx_resources(struct iavf_ring *rx_ring);
>   int iavf_napi_poll(struct napi_struct *napi, int budget);
> -void iavf_force_wb(struct iavf_vsi *vsi, struct iavf_q_vector *q_vector);
> -u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw);
>   void iavf_detect_recover_hung(struct iavf_vsi *vsi);
>   int __iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size);
>   bool __iavf_chk_linearize(struct sk_buff *skb);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH iwl-next 0/2] iavf: make some functions static
  2023-06-13 14:12 [PATCH iwl-next 0/2] iavf: make some functions static Przemek Kitszel
  2023-06-13 14:12 ` [PATCH iwl-next 1/2] iavf: remove some unused functions and pointless wrappers Przemek Kitszel
  2023-06-13 14:12 ` [PATCH iwl-next 2/2] iavf: make functions static where possible Przemek Kitszel
@ 2023-06-14 17:27 ` Tony Nguyen
  2023-06-15  9:53   ` Przemek Kitszel
  2 siblings, 1 reply; 6+ messages in thread
From: Tony Nguyen @ 2023-06-14 17:27 UTC (permalink / raw)
  To: Przemek Kitszel, intel-wired-lan; +Cc: netdev, Ahmed Zaki, Maciej Fijalkowski

On 6/13/2023 7:12 AM, Przemek Kitszel wrote:
> Make static functions that are used in just one translation unit.
> Remove all unused and unexported functions.

This doesn't apply.

> Przemek Kitszel (2):
>    iavf: remove some unused functions and pointless wrappers
>    iavf: make functions static where possible
> 
>   drivers/net/ethernet/intel/iavf/iavf.h        | 10 -----
>   drivers/net/ethernet/intel/iavf/iavf_alloc.h  |  3 +-
>   drivers/net/ethernet/intel/iavf/iavf_common.c | 45 -------------------
>   drivers/net/ethernet/intel/iavf/iavf_main.c   | 34 ++++++--------
>   drivers/net/ethernet/intel/iavf/iavf_osdep.h  |  9 ----
>   .../net/ethernet/intel/iavf/iavf_prototype.h  |  5 ---
>   drivers/net/ethernet/intel/iavf/iavf_txrx.c   | 43 +++++++++---------
>   drivers/net/ethernet/intel/iavf/iavf_txrx.h   |  4 --
>   8 files changed, 35 insertions(+), 118 deletions(-)
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH iwl-next 0/2] iavf: make some functions static
  2023-06-14 17:27 ` [PATCH iwl-next 0/2] iavf: make some functions static Tony Nguyen
@ 2023-06-15  9:53   ` Przemek Kitszel
  0 siblings, 0 replies; 6+ messages in thread
From: Przemek Kitszel @ 2023-06-15  9:53 UTC (permalink / raw)
  To: Tony Nguyen, intel-wired-lan; +Cc: netdev, Ahmed Zaki, Maciej Fijalkowski

On 6/14/23 19:27, Tony Nguyen wrote:
> On 6/13/2023 7:12 AM, Przemek Kitszel wrote:
>> Make static functions that are used in just one translation unit.
>> Remove all unused and unexported functions.
> 
> This doesn't apply.

Indeed it does not, I will repost mentioning prereq commits form yours 
dev-queue


> 
>> Przemek Kitszel (2):
>>    iavf: remove some unused functions and pointless wrappers
>>    iavf: make functions static where possible
>>
>>   drivers/net/ethernet/intel/iavf/iavf.h        | 10 -----
>>   drivers/net/ethernet/intel/iavf/iavf_alloc.h  |  3 +-
>>   drivers/net/ethernet/intel/iavf/iavf_common.c | 45 -------------------
>>   drivers/net/ethernet/intel/iavf/iavf_main.c   | 34 ++++++--------
>>   drivers/net/ethernet/intel/iavf/iavf_osdep.h  |  9 ----
>>   .../net/ethernet/intel/iavf/iavf_prototype.h  |  5 ---
>>   drivers/net/ethernet/intel/iavf/iavf_txrx.c   | 43 +++++++++---------
>>   drivers/net/ethernet/intel/iavf/iavf_txrx.h   |  4 --
>>   8 files changed, 35 insertions(+), 118 deletions(-)
>>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-15  9:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 14:12 [PATCH iwl-next 0/2] iavf: make some functions static Przemek Kitszel
2023-06-13 14:12 ` [PATCH iwl-next 1/2] iavf: remove some unused functions and pointless wrappers Przemek Kitszel
2023-06-13 14:12 ` [PATCH iwl-next 2/2] iavf: make functions static where possible Przemek Kitszel
2023-06-13 14:23   ` [Intel-wired-lan] " Paul Menzel
2023-06-14 17:27 ` [PATCH iwl-next 0/2] iavf: make some functions static Tony Nguyen
2023-06-15  9:53   ` Przemek Kitszel

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).