Commit 2fb0821f authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

ice: clean up arguments

There are a couple of functions that don't need two arguments
passed in when the second argument already had access to
the pointer pointed to by the first.

Remove the unnecessary arguments.
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent ade78c2e
...@@ -95,17 +95,16 @@ void ice_free_tx_ring(struct ice_ring *tx_ring) ...@@ -95,17 +95,16 @@ void ice_free_tx_ring(struct ice_ring *tx_ring)
/** /**
* ice_clean_tx_irq - Reclaim resources after transmit completes * ice_clean_tx_irq - Reclaim resources after transmit completes
* @vsi: the VSI we care about
* @tx_ring: Tx ring to clean * @tx_ring: Tx ring to clean
* @napi_budget: Used to determine if we are in netpoll * @napi_budget: Used to determine if we are in netpoll
* *
* Returns true if there's any budget left (e.g. the clean is finished) * Returns true if there's any budget left (e.g. the clean is finished)
*/ */
static bool static bool ice_clean_tx_irq(struct ice_ring *tx_ring, int napi_budget)
ice_clean_tx_irq(struct ice_vsi *vsi, struct ice_ring *tx_ring, int napi_budget)
{ {
unsigned int total_bytes = 0, total_pkts = 0; unsigned int total_bytes = 0, total_pkts = 0;
unsigned int budget = vsi->work_lmt; unsigned int budget = ICE_DFLT_IRQ_WORK;
struct ice_vsi *vsi = tx_ring->vsi;
s16 i = tx_ring->next_to_clean; s16 i = tx_ring->next_to_clean;
struct ice_tx_desc *tx_desc; struct ice_tx_desc *tx_desc;
struct ice_tx_buf *tx_buf; struct ice_tx_buf *tx_buf;
...@@ -114,6 +113,8 @@ ice_clean_tx_irq(struct ice_vsi *vsi, struct ice_ring *tx_ring, int napi_budget) ...@@ -114,6 +113,8 @@ ice_clean_tx_irq(struct ice_vsi *vsi, struct ice_ring *tx_ring, int napi_budget)
tx_desc = ICE_TX_DESC(tx_ring, i); tx_desc = ICE_TX_DESC(tx_ring, i);
i -= tx_ring->count; i -= tx_ring->count;
prefetch(&vsi->state);
do { do {
struct ice_tx_desc *eop_desc = tx_buf->next_to_watch; struct ice_tx_desc *eop_desc = tx_buf->next_to_watch;
...@@ -206,7 +207,7 @@ ice_clean_tx_irq(struct ice_vsi *vsi, struct ice_ring *tx_ring, int napi_budget) ...@@ -206,7 +207,7 @@ ice_clean_tx_irq(struct ice_vsi *vsi, struct ice_ring *tx_ring, int napi_budget)
smp_mb(); smp_mb();
if (__netif_subqueue_stopped(tx_ring->netdev, if (__netif_subqueue_stopped(tx_ring->netdev,
tx_ring->q_index) && tx_ring->q_index) &&
!test_bit(__ICE_DOWN, vsi->state)) { !test_bit(__ICE_DOWN, vsi->state)) {
netif_wake_subqueue(tx_ring->netdev, netif_wake_subqueue(tx_ring->netdev,
tx_ring->q_index); tx_ring->q_index);
++tx_ring->tx_stats.restart_q; ++tx_ring->tx_stats.restart_q;
...@@ -879,7 +880,7 @@ ice_rx_hash(struct ice_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc, ...@@ -879,7 +880,7 @@ ice_rx_hash(struct ice_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc,
/** /**
* ice_rx_csum - Indicate in skb if checksum is good * ice_rx_csum - Indicate in skb if checksum is good
* @vsi: the VSI we care about * @ring: the ring we care about
* @skb: skb currently being received and modified * @skb: skb currently being received and modified
* @rx_desc: the receive descriptor * @rx_desc: the receive descriptor
* @ptype: the packet type decoded by hardware * @ptype: the packet type decoded by hardware
...@@ -887,7 +888,7 @@ ice_rx_hash(struct ice_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc, ...@@ -887,7 +888,7 @@ ice_rx_hash(struct ice_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc,
* skb->protocol must be set before this function is called * skb->protocol must be set before this function is called
*/ */
static void static void
ice_rx_csum(struct ice_vsi *vsi, struct sk_buff *skb, ice_rx_csum(struct ice_ring *ring, struct sk_buff *skb,
union ice_32b_rx_flex_desc *rx_desc, u8 ptype) union ice_32b_rx_flex_desc *rx_desc, u8 ptype)
{ {
struct ice_rx_ptype_decoded decoded; struct ice_rx_ptype_decoded decoded;
...@@ -904,7 +905,7 @@ ice_rx_csum(struct ice_vsi *vsi, struct sk_buff *skb, ...@@ -904,7 +905,7 @@ ice_rx_csum(struct ice_vsi *vsi, struct sk_buff *skb,
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
/* check if Rx checksum is enabled */ /* check if Rx checksum is enabled */
if (!(vsi->netdev->features & NETIF_F_RXCSUM)) if (!(ring->netdev->features & NETIF_F_RXCSUM))
return; return;
/* check if HW has decoded the packet and checksum */ /* check if HW has decoded the packet and checksum */
...@@ -944,7 +945,7 @@ ice_rx_csum(struct ice_vsi *vsi, struct sk_buff *skb, ...@@ -944,7 +945,7 @@ ice_rx_csum(struct ice_vsi *vsi, struct sk_buff *skb,
return; return;
checksum_fail: checksum_fail:
vsi->back->hw_csum_rx_error++; ring->vsi->back->hw_csum_rx_error++;
} }
/** /**
...@@ -968,7 +969,7 @@ ice_process_skb_fields(struct ice_ring *rx_ring, ...@@ -968,7 +969,7 @@ ice_process_skb_fields(struct ice_ring *rx_ring,
/* modifies the skb - consumes the enet header */ /* modifies the skb - consumes the enet header */
skb->protocol = eth_type_trans(skb, rx_ring->netdev); skb->protocol = eth_type_trans(skb, rx_ring->netdev);
ice_rx_csum(rx_ring->vsi, skb, rx_desc, ptype); ice_rx_csum(rx_ring, skb, rx_desc, ptype);
} }
/** /**
...@@ -1354,14 +1355,13 @@ static u32 ice_buildreg_itr(u16 itr_idx, u16 itr) ...@@ -1354,14 +1355,13 @@ static u32 ice_buildreg_itr(u16 itr_idx, u16 itr)
/** /**
* ice_update_ena_itr - Update ITR and re-enable MSIX interrupt * ice_update_ena_itr - Update ITR and re-enable MSIX interrupt
* @vsi: the VSI associated with the q_vector
* @q_vector: q_vector for which ITR is being updated and interrupt enabled * @q_vector: q_vector for which ITR is being updated and interrupt enabled
*/ */
static void static void ice_update_ena_itr(struct ice_q_vector *q_vector)
ice_update_ena_itr(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
{ {
struct ice_ring_container *tx = &q_vector->tx; struct ice_ring_container *tx = &q_vector->tx;
struct ice_ring_container *rx = &q_vector->rx; struct ice_ring_container *rx = &q_vector->rx;
struct ice_vsi *vsi = q_vector->vsi;
u32 itr_val; u32 itr_val;
/* when exiting WB_ON_ITR lets set a low ITR value and trigger /* when exiting WB_ON_ITR lets set a low ITR value and trigger
...@@ -1419,15 +1419,14 @@ ice_update_ena_itr(struct ice_vsi *vsi, struct ice_q_vector *q_vector) ...@@ -1419,15 +1419,14 @@ ice_update_ena_itr(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
q_vector->itr_countdown--; q_vector->itr_countdown--;
} }
if (!test_bit(__ICE_DOWN, vsi->state)) if (!test_bit(__ICE_DOWN, q_vector->vsi->state))
wr32(&vsi->back->hw, wr32(&q_vector->vsi->back->hw,
GLINT_DYN_CTL(q_vector->reg_idx), GLINT_DYN_CTL(q_vector->reg_idx),
itr_val); itr_val);
} }
/** /**
* ice_set_wb_on_itr - set WB_ON_ITR for this q_vector * ice_set_wb_on_itr - set WB_ON_ITR for this q_vector
* @vsi: pointer to the VSI structure
* @q_vector: q_vector to set WB_ON_ITR on * @q_vector: q_vector to set WB_ON_ITR on
* *
* We need to tell hardware to write-back completed descriptors even when * We need to tell hardware to write-back completed descriptors even when
...@@ -1440,9 +1439,10 @@ ice_update_ena_itr(struct ice_vsi *vsi, struct ice_q_vector *q_vector) ...@@ -1440,9 +1439,10 @@ ice_update_ena_itr(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
* value that's not 0 due to ITR granularity. Also, set the INTENA_MSK bit to * value that's not 0 due to ITR granularity. Also, set the INTENA_MSK bit to
* make sure hardware knows we aren't meddling with the INTENA_M bit. * make sure hardware knows we aren't meddling with the INTENA_M bit.
*/ */
static void static void ice_set_wb_on_itr(struct ice_q_vector *q_vector)
ice_set_wb_on_itr(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
{ {
struct ice_vsi *vsi = q_vector->vsi;
/* already in WB_ON_ITR mode no need to change it */ /* already in WB_ON_ITR mode no need to change it */
if (q_vector->itr_countdown == ICE_IN_WB_ON_ITR_MODE) if (q_vector->itr_countdown == ICE_IN_WB_ON_ITR_MODE)
return; return;
...@@ -1473,7 +1473,6 @@ int ice_napi_poll(struct napi_struct *napi, int budget) ...@@ -1473,7 +1473,6 @@ int ice_napi_poll(struct napi_struct *napi, int budget)
{ {
struct ice_q_vector *q_vector = struct ice_q_vector *q_vector =
container_of(napi, struct ice_q_vector, napi); container_of(napi, struct ice_q_vector, napi);
struct ice_vsi *vsi = q_vector->vsi;
bool clean_complete = true; bool clean_complete = true;
struct ice_ring *ring; struct ice_ring *ring;
int budget_per_ring; int budget_per_ring;
...@@ -1483,7 +1482,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget) ...@@ -1483,7 +1482,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget)
* budget and be more aggressive about cleaning up the Tx descriptors. * budget and be more aggressive about cleaning up the Tx descriptors.
*/ */
ice_for_each_ring(ring, q_vector->tx) ice_for_each_ring(ring, q_vector->tx)
if (!ice_clean_tx_irq(vsi, ring, budget)) if (!ice_clean_tx_irq(ring, budget))
clean_complete = false; clean_complete = false;
/* Handle case where we are called by netpoll with a budget of 0 */ /* Handle case where we are called by netpoll with a budget of 0 */
...@@ -1519,9 +1518,9 @@ int ice_napi_poll(struct napi_struct *napi, int budget) ...@@ -1519,9 +1518,9 @@ int ice_napi_poll(struct napi_struct *napi, int budget)
* poll us due to busy-polling * poll us due to busy-polling
*/ */
if (likely(napi_complete_done(napi, work_done))) if (likely(napi_complete_done(napi, work_done)))
ice_update_ena_itr(vsi, q_vector); ice_update_ena_itr(q_vector);
else else
ice_set_wb_on_itr(vsi, q_vector); ice_set_wb_on_itr(q_vector);
return min_t(int, work_done, budget - 1); return min_t(int, work_done, budget - 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment