@@ -523,11 +523,11 @@ static int smc_connect_decline_fallback(struct smc_sock *smc, int reason_code)
523523
524524/* abort connecting */
525525static int smc_connect_abort (struct smc_sock * smc , int reason_code ,
526- int local_contact )
526+ int local_first )
527527{
528528 bool is_smcd = smc -> conn .lgr -> is_smcd ;
529529
530- if (local_contact == SMC_FIRST_CONTACT )
530+ if (local_first )
531531 smc_lgr_cleanup_early (& smc -> conn );
532532 else
533533 smc_conn_free (& smc -> conn );
@@ -615,7 +615,7 @@ static int smc_connect_rdma(struct smc_sock *smc,
615615 ini -> is_smcd = false;
616616 ini -> ib_lcl = & aclc -> lcl ;
617617 ini -> ib_clcqpn = ntoh24 (aclc -> qpn );
618- ini -> srv_first_contact = aclc -> hdr .flag ;
618+ ini -> first_contact_peer = aclc -> hdr .flag ;
619619
620620 mutex_lock (& smc_client_lgr_pending );
621621 reason_code = smc_conn_create (smc , ini );
@@ -626,7 +626,7 @@ static int smc_connect_rdma(struct smc_sock *smc,
626626
627627 smc_conn_save_peer_info (smc , aclc );
628628
629- if (ini -> cln_first_contact == SMC_FIRST_CONTACT ) {
629+ if (ini -> first_contact_local ) {
630630 link = smc -> conn .lnk ;
631631 } else {
632632 /* set link that was assigned by server */
@@ -643,51 +643,51 @@ static int smc_connect_rdma(struct smc_sock *smc,
643643 }
644644 if (!link )
645645 return smc_connect_abort (smc , SMC_CLC_DECL_NOSRVLINK ,
646- ini -> cln_first_contact );
646+ ini -> first_contact_local );
647647 smc -> conn .lnk = link ;
648648 }
649649
650650 /* create send buffer and rmb */
651651 if (smc_buf_create (smc , false))
652652 return smc_connect_abort (smc , SMC_CLC_DECL_MEM ,
653- ini -> cln_first_contact );
653+ ini -> first_contact_local );
654654
655- if (ini -> cln_first_contact == SMC_FIRST_CONTACT )
655+ if (ini -> first_contact_local )
656656 smc_link_save_peer_info (link , aclc );
657657
658658 if (smc_rmb_rtoken_handling (& smc -> conn , link , aclc ))
659659 return smc_connect_abort (smc , SMC_CLC_DECL_ERR_RTOK ,
660- ini -> cln_first_contact );
660+ ini -> first_contact_local );
661661
662662 smc_close_init (smc );
663663 smc_rx_init (smc );
664664
665- if (ini -> cln_first_contact == SMC_FIRST_CONTACT ) {
665+ if (ini -> first_contact_local ) {
666666 if (smc_ib_ready_link (link ))
667667 return smc_connect_abort (smc , SMC_CLC_DECL_ERR_RDYLNK ,
668- ini -> cln_first_contact );
668+ ini -> first_contact_local );
669669 } else {
670670 if (smcr_lgr_reg_rmbs (link , smc -> conn .rmb_desc ))
671671 return smc_connect_abort (smc , SMC_CLC_DECL_ERR_REGRMB ,
672- ini -> cln_first_contact );
672+ ini -> first_contact_local );
673673 }
674674 smc_rmb_sync_sg_for_device (& smc -> conn );
675675
676676 reason_code = smc_clc_send_confirm (smc );
677677 if (reason_code )
678678 return smc_connect_abort (smc , reason_code ,
679- ini -> cln_first_contact );
679+ ini -> first_contact_local );
680680
681681 smc_tx_init (smc );
682682
683- if (ini -> cln_first_contact == SMC_FIRST_CONTACT ) {
683+ if (ini -> first_contact_local ) {
684684 /* QP confirmation over RoCE fabric */
685685 smc_llc_flow_initiate (link -> lgr , SMC_LLC_FLOW_ADD_LINK );
686686 reason_code = smcr_clnt_conf_first_link (smc );
687687 smc_llc_flow_stop (link -> lgr , & link -> lgr -> llc_flow_lcl );
688688 if (reason_code )
689689 return smc_connect_abort (smc , reason_code ,
690- ini -> cln_first_contact );
690+ ini -> first_contact_local );
691691 }
692692 mutex_unlock (& smc_client_lgr_pending );
693693
@@ -707,8 +707,8 @@ static int smc_connect_ism(struct smc_sock *smc,
707707 int rc = 0 ;
708708
709709 ini -> is_smcd = true;
710- ini -> ism_gid = aclc -> gid ;
711- ini -> srv_first_contact = aclc -> hdr .flag ;
710+ ini -> ism_peer_gid = aclc -> gid ;
711+ ini -> first_contact_peer = aclc -> hdr .flag ;
712712
713713 /* there is only one lgr role for SMC-D; use server lock */
714714 mutex_lock (& smc_server_lgr_pending );
@@ -724,7 +724,7 @@ static int smc_connect_ism(struct smc_sock *smc,
724724 return smc_connect_abort (smc , (rc == - ENOSPC ) ?
725725 SMC_CLC_DECL_MAX_DMB :
726726 SMC_CLC_DECL_MEM ,
727- ini -> cln_first_contact );
727+ ini -> first_contact_local );
728728
729729 smc_conn_save_peer_info (smc , aclc );
730730 smc_close_init (smc );
@@ -733,7 +733,7 @@ static int smc_connect_ism(struct smc_sock *smc,
733733
734734 rc = smc_clc_send_confirm (smc );
735735 if (rc )
736- return smc_connect_abort (smc , rc , ini -> cln_first_contact );
736+ return smc_connect_abort (smc , rc , ini -> first_contact_local );
737737 mutex_unlock (& smc_server_lgr_pending );
738738
739739 smc_copy_sock_settings_to_clc (smc );
@@ -1127,10 +1127,10 @@ static void smc_listen_out_err(struct smc_sock *new_smc)
11271127
11281128/* listen worker: decline and fall back if possible */
11291129static void smc_listen_decline (struct smc_sock * new_smc , int reason_code ,
1130- int local_contact )
1130+ bool local_first )
11311131{
11321132 /* RDMA setup failed, switch back to TCP */
1133- if (local_contact == SMC_FIRST_CONTACT )
1133+ if (local_first )
11341134 smc_lgr_cleanup_early (& new_smc -> conn );
11351135 else
11361136 smc_conn_free (& new_smc -> conn );
@@ -1190,7 +1190,7 @@ static int smc_listen_ism_init(struct smc_sock *new_smc,
11901190 int rc ;
11911191
11921192 pclc_smcd = smc_get_clc_msg_smcd (pclc );
1193- ini -> ism_gid = pclc_smcd -> gid ;
1193+ ini -> ism_peer_gid = pclc_smcd -> gid ;
11941194 rc = smc_conn_create (new_smc , ini );
11951195 if (rc )
11961196 return rc ;
@@ -1199,7 +1199,7 @@ static int smc_listen_ism_init(struct smc_sock *new_smc,
11991199 if (smc_ism_cantalk (new_smc -> conn .lgr -> peer_gid ,
12001200 new_smc -> conn .lgr -> vlan_id ,
12011201 new_smc -> conn .lgr -> smcd )) {
1202- if (ini -> cln_first_contact == SMC_FIRST_CONTACT )
1202+ if (ini -> first_contact_local )
12031203 smc_lgr_cleanup_early (& new_smc -> conn );
12041204 else
12051205 smc_conn_free (& new_smc -> conn );
@@ -1209,7 +1209,7 @@ static int smc_listen_ism_init(struct smc_sock *new_smc,
12091209 /* Create send and receive buffers */
12101210 rc = smc_buf_create (new_smc , true);
12111211 if (rc ) {
1212- if (ini -> cln_first_contact == SMC_FIRST_CONTACT )
1212+ if (ini -> first_contact_local )
12131213 smc_lgr_cleanup_early (& new_smc -> conn );
12141214 else
12151215 smc_conn_free (& new_smc -> conn );
@@ -1221,11 +1221,11 @@ static int smc_listen_ism_init(struct smc_sock *new_smc,
12211221}
12221222
12231223/* listen worker: register buffers */
1224- static int smc_listen_rdma_reg (struct smc_sock * new_smc , int local_contact )
1224+ static int smc_listen_rdma_reg (struct smc_sock * new_smc , bool local_first )
12251225{
12261226 struct smc_connection * conn = & new_smc -> conn ;
12271227
1228- if (local_contact != SMC_FIRST_CONTACT ) {
1228+ if (! local_first ) {
12291229 if (smcr_lgr_reg_rmbs (conn -> lnk , conn -> rmb_desc ))
12301230 return SMC_CLC_DECL_ERR_REGRMB ;
12311231 }
@@ -1237,20 +1237,20 @@ static int smc_listen_rdma_reg(struct smc_sock *new_smc, int local_contact)
12371237/* listen worker: finish RDMA setup */
12381238static int smc_listen_rdma_finish (struct smc_sock * new_smc ,
12391239 struct smc_clc_msg_accept_confirm * cclc ,
1240- int local_contact )
1240+ bool local_first )
12411241{
12421242 struct smc_link * link = new_smc -> conn .lnk ;
12431243 int reason_code = 0 ;
12441244
1245- if (local_contact == SMC_FIRST_CONTACT )
1245+ if (local_first )
12461246 smc_link_save_peer_info (link , cclc );
12471247
12481248 if (smc_rmb_rtoken_handling (& new_smc -> conn , link , cclc )) {
12491249 reason_code = SMC_CLC_DECL_ERR_RTOK ;
12501250 goto decline ;
12511251 }
12521252
1253- if (local_contact == SMC_FIRST_CONTACT ) {
1253+ if (local_first ) {
12541254 if (smc_ib_ready_link (link )) {
12551255 reason_code = SMC_CLC_DECL_ERR_RDYLNK ;
12561256 goto decline ;
@@ -1265,7 +1265,7 @@ static int smc_listen_rdma_finish(struct smc_sock *new_smc,
12651265 return 0 ;
12661266
12671267decline :
1268- smc_listen_decline (new_smc , reason_code , local_contact );
1268+ smc_listen_decline (new_smc , reason_code , local_first );
12691269 return reason_code ;
12701270}
12711271
@@ -1358,13 +1358,13 @@ static void smc_listen_work(struct work_struct *work)
13581358 rc = smc_listen_rdma_init (new_smc , & ini );
13591359 if (rc )
13601360 goto out_unlock ;
1361- rc = smc_listen_rdma_reg (new_smc , ini .cln_first_contact );
1361+ rc = smc_listen_rdma_reg (new_smc , ini .first_contact_local );
13621362 if (rc )
13631363 goto out_unlock ;
13641364 }
13651365
13661366 /* send SMC Accept CLC message */
1367- rc = smc_clc_send_accept (new_smc , ini .cln_first_contact );
1367+ rc = smc_clc_send_accept (new_smc , ini .first_contact_local );
13681368 if (rc )
13691369 goto out_unlock ;
13701370
@@ -1384,7 +1384,7 @@ static void smc_listen_work(struct work_struct *work)
13841384 /* finish worker */
13851385 if (!ism_supported ) {
13861386 rc = smc_listen_rdma_finish (new_smc , & cclc ,
1387- ini .cln_first_contact );
1387+ ini .first_contact_local );
13881388 mutex_unlock (& smc_server_lgr_pending );
13891389 if (rc )
13901390 return ;
@@ -1396,7 +1396,7 @@ static void smc_listen_work(struct work_struct *work)
13961396out_unlock :
13971397 mutex_unlock (& smc_server_lgr_pending );
13981398out_decl :
1399- smc_listen_decline (new_smc , rc , ini .cln_first_contact );
1399+ smc_listen_decline (new_smc , rc , ini .first_contact_local );
14001400}
14011401
14021402static void smc_tcp_listen_work (struct work_struct * work )
0 commit comments