diff mbox series

[net,4/4] ibmvnic: remove unused ->wait_capability

Message ID 20220122025921.199446-4-sukadev@linux.ibm.com (mailing list archive)
State Accepted
Commit 3a5d9db7fbdfc8207ddf70d92668ced0ab330701
Delegated to: Netdev Maintainers
Headers show
Series [net,1/4] ibmvnic: Allow extra failures before disabling | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 2 blamed authors not CCed: davem@davemloft.net tlfalcon@linux.ibm.com; 7 maintainers not CCed: paulus@samba.org kuba@kernel.org benh@kernel.crashing.org mpe@ellerman.id.au linuxppc-dev@lists.ozlabs.org davem@davemloft.net tlfalcon@linux.ibm.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 68 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Sukadev Bhattiprolu Jan. 22, 2022, 2:59 a.m. UTC
With previous bug fix, ->wait_capability flag is no longer needed and can
be removed.

Fixes: 249168ad07cd ("ibmvnic: Make CRQ interrupt tasklet wait for all capabilities crqs")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 38 +++++++++++-------------------
 drivers/net/ethernet/ibm/ibmvnic.h |  1 -
 2 files changed, 14 insertions(+), 25 deletions(-)

Comments

Dany Madden Jan. 23, 2022, 12:33 a.m. UTC | #1
On 2022-01-21 18:59, Sukadev Bhattiprolu wrote:
> With previous bug fix, ->wait_capability flag is no longer needed and 
> can
> be removed.
> 
> Fixes: 249168ad07cd ("ibmvnic: Make CRQ interrupt tasklet wait for all
> capabilities crqs")
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>

> ---
>  drivers/net/ethernet/ibm/ibmvnic.c | 38 +++++++++++-------------------
>  drivers/net/ethernet/ibm/ibmvnic.h |  1 -
>  2 files changed, 14 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index 682a440151a8..8ed0b95147db 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -4876,10 +4876,8 @@ static void handle_request_cap_rsp(union
> ibmvnic_crq *crq,
>  	}
> 
>  	/* Done receiving requested capabilities, query IP offload support */
> -	if (atomic_read(&adapter->running_cap_crqs) == 0) {
> -		adapter->wait_capability = false;
> +	if (atomic_read(&adapter->running_cap_crqs) == 0)
>  		send_query_ip_offload(adapter);
> -	}
>  }
> 
>  static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
> @@ -5177,10 +5175,8 @@ static void handle_query_cap_rsp(union 
> ibmvnic_crq *crq,
>  	}
> 
>  out:
> -	if (atomic_read(&adapter->running_cap_crqs) == 0) {
> -		adapter->wait_capability = false;
> +	if (atomic_read(&adapter->running_cap_crqs) == 0)
>  		send_request_cap(adapter, 0);
> -	}
>  }
> 
>  static int send_query_phys_parms(struct ibmvnic_adapter *adapter)
> @@ -5476,27 +5472,21 @@ static void ibmvnic_tasklet(struct 
> tasklet_struct *t)
>  	struct ibmvnic_crq_queue *queue = &adapter->crq;
>  	union ibmvnic_crq *crq;
>  	unsigned long flags;
> -	bool done = false;
> 
>  	spin_lock_irqsave(&queue->lock, flags);
> -	while (!done) {
> -		/* Pull all the valid messages off the CRQ */
> -		while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
> -			/* This barrier makes sure ibmvnic_next_crq()'s
> -			 * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
> -			 * before ibmvnic_handle_crq()'s
> -			 * switch(gen_crq->first) and switch(gen_crq->cmd).
> -			 */
> -			dma_rmb();
> -			ibmvnic_handle_crq(crq, adapter);
> -			crq->generic.first = 0;
> -		}
> +
> +	/* Pull all the valid messages off the CRQ */
> +	while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
> +		/* This barrier makes sure ibmvnic_next_crq()'s
> +		 * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
> +		 * before ibmvnic_handle_crq()'s
> +		 * switch(gen_crq->first) and switch(gen_crq->cmd).
> +		 */
> +		dma_rmb();
> +		ibmvnic_handle_crq(crq, adapter);
> +		crq->generic.first = 0;
>  	}
> -	/* if capabilities CRQ's were sent in this tasklet, the following
> -	 * tasklet must wait until all responses are received
> -	 */
> -	if (atomic_read(&adapter->running_cap_crqs) != 0)
> -		adapter->wait_capability = true;
> +
>  	spin_unlock_irqrestore(&queue->lock, flags);
>  }
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.h
> b/drivers/net/ethernet/ibm/ibmvnic.h
> index b8e42f67d897..a80f94e161ad 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.h
> +++ b/drivers/net/ethernet/ibm/ibmvnic.h
> @@ -921,7 +921,6 @@ struct ibmvnic_adapter {
>  	int login_rsp_buf_sz;
> 
>  	atomic_t running_cap_crqs;
> -	bool wait_capability;
> 
>  	struct ibmvnic_sub_crq_queue **tx_scrq ____cacheline_aligned;
>  	struct ibmvnic_sub_crq_queue **rx_scrq ____cacheline_aligned;
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 682a440151a8..8ed0b95147db 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -4876,10 +4876,8 @@  static void handle_request_cap_rsp(union ibmvnic_crq *crq,
 	}
 
 	/* Done receiving requested capabilities, query IP offload support */
-	if (atomic_read(&adapter->running_cap_crqs) == 0) {
-		adapter->wait_capability = false;
+	if (atomic_read(&adapter->running_cap_crqs) == 0)
 		send_query_ip_offload(adapter);
-	}
 }
 
 static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
@@ -5177,10 +5175,8 @@  static void handle_query_cap_rsp(union ibmvnic_crq *crq,
 	}
 
 out:
-	if (atomic_read(&adapter->running_cap_crqs) == 0) {
-		adapter->wait_capability = false;
+	if (atomic_read(&adapter->running_cap_crqs) == 0)
 		send_request_cap(adapter, 0);
-	}
 }
 
 static int send_query_phys_parms(struct ibmvnic_adapter *adapter)
@@ -5476,27 +5472,21 @@  static void ibmvnic_tasklet(struct tasklet_struct *t)
 	struct ibmvnic_crq_queue *queue = &adapter->crq;
 	union ibmvnic_crq *crq;
 	unsigned long flags;
-	bool done = false;
 
 	spin_lock_irqsave(&queue->lock, flags);
-	while (!done) {
-		/* Pull all the valid messages off the CRQ */
-		while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
-			/* This barrier makes sure ibmvnic_next_crq()'s
-			 * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
-			 * before ibmvnic_handle_crq()'s
-			 * switch(gen_crq->first) and switch(gen_crq->cmd).
-			 */
-			dma_rmb();
-			ibmvnic_handle_crq(crq, adapter);
-			crq->generic.first = 0;
-		}
+
+	/* Pull all the valid messages off the CRQ */
+	while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
+		/* This barrier makes sure ibmvnic_next_crq()'s
+		 * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
+		 * before ibmvnic_handle_crq()'s
+		 * switch(gen_crq->first) and switch(gen_crq->cmd).
+		 */
+		dma_rmb();
+		ibmvnic_handle_crq(crq, adapter);
+		crq->generic.first = 0;
 	}
-	/* if capabilities CRQ's were sent in this tasklet, the following
-	 * tasklet must wait until all responses are received
-	 */
-	if (atomic_read(&adapter->running_cap_crqs) != 0)
-		adapter->wait_capability = true;
+
 	spin_unlock_irqrestore(&queue->lock, flags);
 }
 
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index b8e42f67d897..a80f94e161ad 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -921,7 +921,6 @@  struct ibmvnic_adapter {
 	int login_rsp_buf_sz;
 
 	atomic_t running_cap_crqs;
-	bool wait_capability;
 
 	struct ibmvnic_sub_crq_queue **tx_scrq ____cacheline_aligned;
 	struct ibmvnic_sub_crq_queue **rx_scrq ____cacheline_aligned;