Skip to content

Commit

Permalink
net/smc: common functions for RMBs and send buffers
Browse files Browse the repository at this point in the history
Creation and deletion of SMC receive and send buffers shares a high
amount of common code . This patch introduces common functions to get
rid of duplicate code.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ursula Braun authored and David S. Miller committed Jul 29, 2017
1 parent 9d8fb61 commit 3e03472
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 219 deletions.
16 changes: 4 additions & 12 deletions net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,8 @@ static int smc_connect_rdma(struct smc_sock *smc)

smc_conn_save_peer_info(smc, &aclc);

rc = smc_sndbuf_create(smc);
if (rc) {
reason_code = SMC_CLC_DECL_MEM;
goto decline_rdma_unlock;
}
rc = smc_rmb_create(smc);
/* create send buffer and rmb */
rc = smc_buf_create(smc);
if (rc) {
reason_code = SMC_CLC_DECL_MEM;
goto decline_rdma_unlock;
Expand Down Expand Up @@ -813,12 +809,8 @@ static void smc_listen_work(struct work_struct *work)
}
link = &new_smc->conn.lgr->lnk[SMC_SINGLE_LINK];

rc = smc_sndbuf_create(new_smc);
if (rc) {
reason_code = SMC_CLC_DECL_MEM;
goto decline_rdma;
}
rc = smc_rmb_create(new_smc);
/* create send buffer and rmb */
rc = smc_buf_create(new_smc);
if (rc) {
reason_code = SMC_CLC_DECL_MEM;
goto decline_rdma;
Expand Down
Loading

0 comments on commit 3e03472

Please sign in to comment.