iavf: make functions static where possible

[ Upstream commit a4aadf0f59 ]

Make all possible functions static.

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>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Stable-dep-of: c2ed2403f1 ("iavf: Wait for reset in callbacks which trigger it")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Przemek Kitszel
2023-06-21 08:54:05 -07:00
committed by Greg Kroah-Hartman
parent 9e36533d66
commit f43ab442a8
4 changed files with 28 additions and 43 deletions

View File

@@ -523,9 +523,6 @@ void iavf_schedule_request_stats(struct iavf_adapter *adapter);
void iavf_reset(struct iavf_adapter *adapter); void iavf_reset(struct iavf_adapter *adapter);
void iavf_set_ethtool_ops(struct net_device *netdev); void iavf_set_ethtool_ops(struct net_device *netdev);
void iavf_update_stats(struct iavf_adapter *adapter); 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_tx_resources(struct iavf_adapter *adapter);
void iavf_free_all_rx_resources(struct iavf_adapter *adapter); void iavf_free_all_rx_resources(struct iavf_adapter *adapter);
@@ -579,17 +576,10 @@ 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_disable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);
void iavf_enable_vlan_insertion_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); 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_add_fdir_filter(struct iavf_adapter *adapter);
void iavf_del_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); void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter); void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
const u8 *macaddr); const u8 *macaddr);
int iavf_lock_timeout(struct mutex *lock, unsigned int msecs);
#endif /* _IAVF_H_ */ #endif /* _IAVF_H_ */

View File

@@ -253,7 +253,7 @@ enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw,
* *
* Returns 0 on success, negative on failure * 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; unsigned int wait, delay = 10;
@@ -362,7 +362,7 @@ static void iavf_irq_disable(struct iavf_adapter *adapter)
* iavf_irq_enable_queues - Enable interrupt for all queues * iavf_irq_enable_queues - Enable interrupt for all queues
* @adapter: board private structure * @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; struct iavf_hw *hw = &adapter->hw;
int i; int i;
@@ -1003,8 +1003,8 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
* *
* Do not call this with mac_vlan_list_lock! * Do not call this with mac_vlan_list_lock!
**/ **/
int iavf_replace_primary_mac(struct iavf_adapter *adapter, static int iavf_replace_primary_mac(struct iavf_adapter *adapter,
const u8 *new_mac) const u8 *new_mac)
{ {
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct iavf_mac_filter *f; struct iavf_mac_filter *f;
@@ -1860,7 +1860,7 @@ static void iavf_free_q_vectors(struct iavf_adapter *adapter)
* @adapter: board private structure * @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) if (!adapter->msix_entries)
return; return;
@@ -1875,7 +1875,7 @@ void iavf_reset_interrupt_capability(struct iavf_adapter *adapter)
* @adapter: board private structure to initialize * @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; int err;
@@ -2174,7 +2174,7 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
* the watchdog if any changes are requested to expedite the request via * the watchdog if any changes are requested to expedite the request via
* virtchnl. * virtchnl.
**/ **/
void static void
iavf_set_vlan_offload_features(struct iavf_adapter *adapter, iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
netdev_features_t prev_features, netdev_features_t prev_features,
netdev_features_t features) netdev_features_t features)

View File

@@ -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 * iavf_clean_tx_ring - Free any empty Tx buffers
* @tx_ring: ring to be cleaned * @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; unsigned long bi_size;
u16 i; 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 * Since there is no access to the ring head register
* in XL710, we need to use our local copies * 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; u32 head, tail;
@@ -127,6 +127,24 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
return 0; 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 * iavf_detect_recover_hung - Function to detect and recover hung_queues
* @vsi: pointer to vsi struct with tx 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; 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, static inline bool iavf_container_is_rx(struct iavf_q_vector *q_vector,
struct iavf_ring_container *rc) struct iavf_ring_container *rc)
{ {
@@ -687,7 +686,7 @@ err:
* iavf_clean_rx_ring - Free Rx buffers * iavf_clean_rx_ring - Free Rx buffers
* @rx_ring: ring to be cleaned * @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; unsigned long bi_size;
u16 i; u16 i;

View File

@@ -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); 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); 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_tx_descriptors(struct iavf_ring *tx_ring);
int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring); int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring);
void iavf_free_tx_resources(struct iavf_ring *tx_ring); void iavf_free_tx_resources(struct iavf_ring *tx_ring);
void iavf_free_rx_resources(struct iavf_ring *rx_ring); void iavf_free_rx_resources(struct iavf_ring *rx_ring);
int iavf_napi_poll(struct napi_struct *napi, int budget); 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); void iavf_detect_recover_hung(struct iavf_vsi *vsi);
int __iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size); int __iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size);
bool __iavf_chk_linearize(struct sk_buff *skb); bool __iavf_chk_linearize(struct sk_buff *skb);