Skip to content

Commit

Permalink
ibmvnic: remove unused ->wait_capability
Browse files Browse the repository at this point in the history
With previous bug fix, ->wait_capability flag is no longer needed and can
be removed.

Fixes: 249168a ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
sukadev authored and nickdesaulniers committed Jan 29, 2022
1 parent e1f563a commit ba7475d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
38 changes: 14 additions & 24 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -4884,10 +4884,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,
Expand Down Expand Up @@ -5185,10 +5183,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)
Expand Down Expand Up @@ -5484,27 +5480,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);
}

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/ibm/ibmvnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,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;
Expand Down

0 comments on commit ba7475d

Please sign in to comment.