Commit 87523930 authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

net/smc: take link down instead of terminating the link group

Use the introduced link down processing in all places where the link
group is terminated and take down the affected link only.
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 541afa10
...@@ -884,11 +884,8 @@ void smc_smcr_terminate_all(struct smc_ib_device *smcibdev) ...@@ -884,11 +884,8 @@ void smc_smcr_terminate_all(struct smc_ib_device *smcibdev)
} else { } else {
list_for_each_entry_safe(lgr, lg, &smc_lgr_list.list, list) { list_for_each_entry_safe(lgr, lg, &smc_lgr_list.list, list) {
for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) { for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) {
if (lgr->lnk[i].smcibdev == smcibdev) { if (lgr->lnk[i].smcibdev == smcibdev)
list_move(&lgr->list, &lgr_free_list); smcr_link_down_cond_sched(&lgr->lnk[i]);
lgr->freeing = 1;
break;
}
} }
} }
} }
......
...@@ -556,7 +556,7 @@ static void smc_llc_rx_delete_link(struct smc_link *link, ...@@ -556,7 +556,7 @@ static void smc_llc_rx_delete_link(struct smc_link *link,
smc_llc_send_delete_link(link, 0, SMC_LLC_RESP, true, smc_llc_send_delete_link(link, 0, SMC_LLC_RESP, true,
SMC_LLC_DEL_PROG_INIT_TERM); SMC_LLC_DEL_PROG_INIT_TERM);
} }
smc_lgr_terminate_sched(lgr); smcr_link_down_cond(link);
} }
/* process a confirm_rkey request from peer, remote flow */ /* process a confirm_rkey request from peer, remote flow */
...@@ -831,7 +831,7 @@ static void smc_llc_testlink_work(struct work_struct *work) ...@@ -831,7 +831,7 @@ static void smc_llc_testlink_work(struct work_struct *work)
if (link->state != SMC_LNK_ACTIVE) if (link->state != SMC_LNK_ACTIVE)
return; /* link state changed */ return; /* link state changed */
if (rc <= 0) { if (rc <= 0) {
smc_lgr_terminate_sched(smc_get_lgr(link)); smcr_link_down_cond_sched(link);
return; return;
} }
next_interval = link->llc_testlink_time; next_interval = link->llc_testlink_time;
......
...@@ -283,7 +283,7 @@ static int smc_tx_rdma_write(struct smc_connection *conn, int peer_rmbe_offset, ...@@ -283,7 +283,7 @@ static int smc_tx_rdma_write(struct smc_connection *conn, int peer_rmbe_offset,
rdma_wr->rkey = lgr->rtokens[conn->rtoken_idx][link->link_idx].rkey; rdma_wr->rkey = lgr->rtokens[conn->rtoken_idx][link->link_idx].rkey;
rc = ib_post_send(link->roce_qp, &rdma_wr->wr, NULL); rc = ib_post_send(link->roce_qp, &rdma_wr->wr, NULL);
if (rc) if (rc)
smc_lgr_terminate_sched(lgr); smcr_link_down_cond_sched(link);
return rc; return rc;
} }
......
...@@ -120,8 +120,8 @@ static inline void smc_wr_tx_process_cqe(struct ib_wc *wc) ...@@ -120,8 +120,8 @@ static inline void smc_wr_tx_process_cqe(struct ib_wc *wc)
sizeof(link->wr_tx_bufs[i])); sizeof(link->wr_tx_bufs[i]));
clear_bit(i, link->wr_tx_mask); clear_bit(i, link->wr_tx_mask);
} }
/* terminate connections of this link group abnormally */ /* terminate link */
smc_lgr_terminate_sched(smc_get_lgr(link)); smcr_link_down_cond_sched(link);
} }
if (pnd_snd.handler) if (pnd_snd.handler)
pnd_snd.handler(&pnd_snd.priv, link, wc->status); pnd_snd.handler(&pnd_snd.priv, link, wc->status);
...@@ -212,8 +212,8 @@ int smc_wr_tx_get_free_slot(struct smc_link *link, ...@@ -212,8 +212,8 @@ int smc_wr_tx_get_free_slot(struct smc_link *link,
(smc_wr_tx_get_free_slot_index(link, &idx) != -EBUSY), (smc_wr_tx_get_free_slot_index(link, &idx) != -EBUSY),
SMC_WR_TX_WAIT_FREE_SLOT_TIME); SMC_WR_TX_WAIT_FREE_SLOT_TIME);
if (!rc) { if (!rc) {
/* timeout - terminate connections */ /* timeout - terminate link */
smc_lgr_terminate_sched(lgr); smcr_link_down_cond_sched(link);
return -EPIPE; return -EPIPE;
} }
if (idx == link->wr_tx_cnt) if (idx == link->wr_tx_cnt)
...@@ -270,7 +270,7 @@ int smc_wr_tx_send(struct smc_link *link, struct smc_wr_tx_pend_priv *priv) ...@@ -270,7 +270,7 @@ int smc_wr_tx_send(struct smc_link *link, struct smc_wr_tx_pend_priv *priv)
rc = ib_post_send(link->roce_qp, &link->wr_tx_ibs[pend->idx], NULL); rc = ib_post_send(link->roce_qp, &link->wr_tx_ibs[pend->idx], NULL);
if (rc) { if (rc) {
smc_wr_tx_put_slot(link, priv); smc_wr_tx_put_slot(link, priv);
smc_lgr_terminate_sched(smc_get_lgr(link)); smcr_link_down_cond_sched(link);
} }
return rc; return rc;
} }
...@@ -294,8 +294,8 @@ int smc_wr_reg_send(struct smc_link *link, struct ib_mr *mr) ...@@ -294,8 +294,8 @@ int smc_wr_reg_send(struct smc_link *link, struct ib_mr *mr)
(link->wr_reg_state != POSTED), (link->wr_reg_state != POSTED),
SMC_WR_REG_MR_WAIT_TIME); SMC_WR_REG_MR_WAIT_TIME);
if (!rc) { if (!rc) {
/* timeout - terminate connections */ /* timeout - terminate link */
smc_lgr_terminate_sched(smc_get_lgr(link)); smcr_link_down_cond_sched(link);
return -EPIPE; return -EPIPE;
} }
if (rc == -ERESTARTSYS) if (rc == -ERESTARTSYS)
...@@ -393,10 +393,7 @@ static inline void smc_wr_rx_process_cqes(struct ib_wc wc[], int num) ...@@ -393,10 +393,7 @@ static inline void smc_wr_rx_process_cqes(struct ib_wc wc[], int num)
case IB_WC_RETRY_EXC_ERR: case IB_WC_RETRY_EXC_ERR:
case IB_WC_RNR_RETRY_EXC_ERR: case IB_WC_RNR_RETRY_EXC_ERR:
case IB_WC_WR_FLUSH_ERR: case IB_WC_WR_FLUSH_ERR:
/* terminate connections of this link group smcr_link_down_cond_sched(link);
* abnormally
*/
smc_lgr_terminate_sched(smc_get_lgr(link));
break; break;
default: default:
smc_wr_rx_post(link); /* refill WR RX */ smc_wr_rx_post(link); /* refill WR RX */
......
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