• Home
  • Raw
  • Download

Lines Matching full:ini

596 static int smc_find_rdma_device(struct smc_sock *smc, struct smc_init_info *ini)  in smc_find_rdma_device()  argument
602 smc_pnet_find_roce_resource(smc->clcsock->sk, ini); in smc_find_rdma_device()
603 if (!ini->ib_dev) in smc_find_rdma_device()
610 static int smc_find_ism_device(struct smc_sock *smc, struct smc_init_info *ini) in smc_find_ism_device() argument
613 smc_pnet_find_ism_resource(smc->clcsock->sk, ini); in smc_find_ism_device()
614 if (!ini->ism_dev[0]) in smc_find_ism_device()
617 ini->ism_chid[0] = smc_ism_get_chid(ini->ism_dev[0]); in smc_find_ism_device()
622 static bool smc_find_ism_v2_is_unique_chid(u16 chid, struct smc_init_info *ini, in smc_find_ism_v2_is_unique_chid() argument
625 int i = (!ini->ism_dev[0]) ? 1 : 0; in smc_find_ism_v2_is_unique_chid()
628 if (ini->ism_chid[i] == chid) in smc_find_ism_v2_is_unique_chid()
637 struct smc_init_info *ini) in smc_find_ism_v2_device_clnt() argument
644 if (smcd_indicated(ini->smc_type_v1)) in smc_find_ism_v2_device_clnt()
648 if (smcd->going_away || smcd == ini->ism_dev[0]) in smc_find_ism_v2_device_clnt()
651 if (!smc_find_ism_v2_is_unique_chid(chid, ini, i)) in smc_find_ism_v2_device_clnt()
655 ini->ism_dev[i] = smcd; in smc_find_ism_v2_device_clnt()
656 ini->ism_chid[i] = chid; in smc_find_ism_v2_device_clnt()
657 ini->is_smcd = true; in smc_find_ism_v2_device_clnt()
665 ini->ism_offered_cnt = i - 1; in smc_find_ism_v2_device_clnt()
666 if (!ini->ism_dev[0] && !ini->ism_dev[1]) in smc_find_ism_v2_device_clnt()
667 ini->smcd_version = 0; in smc_find_ism_v2_device_clnt()
674 struct smc_init_info *ini) in smc_connect_ism_vlan_setup() argument
676 if (ini->vlan_id && smc_ism_get_vlan(ini->ism_dev[0], ini->vlan_id)) in smc_connect_ism_vlan_setup()
682 struct smc_init_info *ini) in smc_find_proposal_devices() argument
687 if (ini->smcd_version & SMC_V1) { in smc_find_proposal_devices()
688 if (smc_find_ism_device(smc, ini) || in smc_find_proposal_devices()
689 smc_connect_ism_vlan_setup(smc, ini)) { in smc_find_proposal_devices()
690 if (ini->smc_type_v1 == SMC_TYPE_B) in smc_find_proposal_devices()
691 ini->smc_type_v1 = SMC_TYPE_R; in smc_find_proposal_devices()
693 ini->smc_type_v1 = SMC_TYPE_N; in smc_find_proposal_devices()
695 if (smc_find_rdma_device(smc, ini)) { in smc_find_proposal_devices()
696 if (ini->smc_type_v1 == SMC_TYPE_B) in smc_find_proposal_devices()
697 ini->smc_type_v1 = SMC_TYPE_D; in smc_find_proposal_devices()
699 ini->smc_type_v1 = SMC_TYPE_N; in smc_find_proposal_devices()
702 if (smc_ism_v2_capable && smc_find_ism_v2_device_clnt(smc, ini)) in smc_find_proposal_devices()
703 ini->smc_type_v2 = SMC_TYPE_N; in smc_find_proposal_devices()
706 if (!smcr_indicated(ini->smc_type_v1) && in smc_find_proposal_devices()
707 ini->smc_type_v1 == SMC_TYPE_N && ini->smc_type_v2 == SMC_TYPE_N) in smc_find_proposal_devices()
717 struct smc_init_info *ini) in smc_connect_ism_vlan_cleanup() argument
719 if (!smcd_indicated(ini->smc_type_v1)) in smc_connect_ism_vlan_cleanup()
721 if (ini->vlan_id && smc_ism_put_vlan(ini->ism_dev[0], ini->vlan_id)) in smc_connect_ism_vlan_cleanup()
734 struct smc_init_info *ini) in smc_connect_clc() argument
739 rc = smc_clc_send_proposal(smc, ini); in smc_connect_clc()
750 struct smc_init_info *ini) in smc_connect_rdma() argument
755 ini->is_smcd = false; in smc_connect_rdma()
756 ini->ib_lcl = &aclc->r0.lcl; in smc_connect_rdma()
757 ini->ib_clcqpn = ntoh24(aclc->r0.qpn); in smc_connect_rdma()
758 ini->first_contact_peer = aclc->hdr.typev2 & SMC_FIRST_CONTACT_MASK; in smc_connect_rdma()
761 reason_code = smc_conn_create(smc, ini); in smc_connect_rdma()
769 if (ini->first_contact_local) { in smc_connect_rdma()
799 if (ini->first_contact_local) in smc_connect_rdma()
810 if (ini->first_contact_local) { in smc_connect_rdma()
823 reason_code = smc_clc_send_confirm(smc, ini->first_contact_local, in smc_connect_rdma()
830 if (ini->first_contact_local) { in smc_connect_rdma()
847 smc_connect_abort(smc, ini->first_contact_local); in smc_connect_rdma()
859 struct smc_init_info *ini) in smc_v2_determine_accepted_chid() argument
863 for (i = 0; i < ini->ism_offered_cnt + 1; i++) { in smc_v2_determine_accepted_chid()
864 if (ini->ism_chid[i] == ntohs(aclc->chid)) { in smc_v2_determine_accepted_chid()
865 ini->ism_selected = i; in smc_v2_determine_accepted_chid()
876 struct smc_init_info *ini) in smc_connect_ism() argument
880 ini->is_smcd = true; in smc_connect_ism()
881 ini->first_contact_peer = aclc->hdr.typev2 & SMC_FIRST_CONTACT_MASK; in smc_connect_ism()
887 rc = smc_v2_determine_accepted_chid(aclc_v2, ini); in smc_connect_ism()
891 ini->ism_peer_gid[ini->ism_selected] = aclc->d0.gid; in smc_connect_ism()
895 rc = smc_conn_create(smc, ini); in smc_connect_ism()
913 rc = smc_clc_send_confirm(smc, ini->first_contact_local, in smc_connect_ism()
926 smc_connect_abort(smc, ini->first_contact_local); in smc_connect_ism()
934 static int smc_connect_check_aclc(struct smc_init_info *ini, in smc_connect_check_aclc() argument
938 !smcr_indicated(ini->smc_type_v1)) || in smc_connect_check_aclc()
940 ((!smcd_indicated(ini->smc_type_v1) && in smc_connect_check_aclc()
941 !smcd_indicated(ini->smc_type_v2)) || in smc_connect_check_aclc()
943 !smcd_indicated(ini->smc_type_v1)) || in smc_connect_check_aclc()
945 !smcd_indicated(ini->smc_type_v2))))) in smc_connect_check_aclc()
957 struct smc_init_info *ini = NULL; in __smc_connect() local
973 ini = kzalloc(sizeof(*ini), GFP_KERNEL); in __smc_connect()
974 if (!ini) in __smc_connect()
978 ini->smcd_version = SMC_V1; in __smc_connect()
979 ini->smcd_version |= smc_ism_v2_capable ? SMC_V2 : 0; in __smc_connect()
980 ini->smc_type_v1 = SMC_TYPE_B; in __smc_connect()
981 ini->smc_type_v2 = smc_ism_v2_capable ? SMC_TYPE_D : SMC_TYPE_N; in __smc_connect()
984 if (smc_vlan_by_tcpsk(smc->clcsock, ini)) { in __smc_connect()
985 ini->smcd_version &= ~SMC_V1; in __smc_connect()
986 ini->smc_type_v1 = SMC_TYPE_N; in __smc_connect()
987 if (!ini->smcd_version) { in __smc_connect()
993 rc = smc_find_proposal_devices(smc, ini); in __smc_connect()
1006 rc = smc_connect_clc(smc, aclc2, ini); in __smc_connect()
1011 rc = smc_connect_check_aclc(ini, aclc); in __smc_connect()
1013 ini->smcd_version = version; in __smc_connect()
1019 rc = smc_connect_rdma(smc, aclc, ini); in __smc_connect()
1021 rc = smc_connect_ism(smc, aclc, ini); in __smc_connect()
1025 smc_connect_ism_vlan_cleanup(smc, ini); in __smc_connect()
1027 kfree(ini); in __smc_connect()
1031 smc_connect_ism_vlan_cleanup(smc, ini); in __smc_connect()
1034 kfree(ini); in __smc_connect()
1377 struct smc_init_info *ini) in smc_listen_v2_check() argument
1382 ini->smc_type_v1 = pclc->hdr.typev1; in smc_listen_v2_check()
1383 ini->smc_type_v2 = pclc->hdr.typev2; in smc_listen_v2_check()
1384 ini->smcd_version = ini->smc_type_v1 != SMC_TYPE_N ? SMC_V1 : 0; in smc_listen_v2_check()
1386 ini->smcd_version |= in smc_listen_v2_check()
1387 ini->smc_type_v2 != SMC_TYPE_N ? SMC_V2 : 0; in smc_listen_v2_check()
1389 ini->smcd_version &= ~SMC_V2; in smc_listen_v2_check()
1394 ini->smcd_version &= ~SMC_V2; in smc_listen_v2_check()
1399 ini->smcd_version &= ~SMC_V2; in smc_listen_v2_check()
1402 if (!ini->smcd_version) { in smc_listen_v2_check()
1433 struct smc_init_info *ini) in smc_listen_rdma_init() argument
1438 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
1451 struct smc_init_info *ini) in smc_listen_ism_init() argument
1455 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
1462 if (ini->first_contact_local) in smc_listen_ism_init()
1474 struct smc_init_info *ini, in smc_is_already_selected() argument
1480 if (smcd == ini->ism_dev[i]) in smc_is_already_selected()
1487 static void smc_check_ism_v2_match(struct smc_init_info *ini, in smc_check_ism_v2_match() argument
1496 if (smc_is_already_selected(smcd, ini, *matches)) in smc_check_ism_v2_match()
1500 ini->ism_peer_gid[*matches] = proposed_gid; in smc_check_ism_v2_match()
1501 ini->ism_dev[*matches] = smcd; in smc_check_ism_v2_match()
1510 struct smc_init_info *ini) in smc_find_ism_v2_device_serv() argument
1520 if (!(ini->smcd_version & SMC_V2) || !smcd_indicated(ini->smc_type_v2)) in smc_find_ism_v2_device_serv()
1533 smc_check_ism_v2_match(ini, ntohs(pclc_smcd->ism.chid), in smc_find_ism_v2_device_serv()
1539 smc_check_ism_v2_match(ini, in smc_find_ism_v2_device_serv()
1546 if (ini->ism_dev[0]) { in smc_find_ism_v2_device_serv()
1547 smc_ism_get_system_eid(ini->ism_dev[0], &eid); in smc_find_ism_v2_device_serv()
1555 smcd_version = ini->smcd_version; in smc_find_ism_v2_device_serv()
1557 ini->smcd_version = SMC_V2; in smc_find_ism_v2_device_serv()
1558 ini->is_smcd = true; in smc_find_ism_v2_device_serv()
1559 ini->ism_selected = i; in smc_find_ism_v2_device_serv()
1560 if (smc_listen_ism_init(new_smc, ini)) in smc_find_ism_v2_device_serv()
1566 ini->smcd_version = smcd_version; /* restore original value */ in smc_find_ism_v2_device_serv()
1569 ini->smcd_version &= ~SMC_V2; in smc_find_ism_v2_device_serv()
1570 ini->ism_dev[0] = NULL; in smc_find_ism_v2_device_serv()
1571 ini->is_smcd = false; in smc_find_ism_v2_device_serv()
1576 struct smc_init_info *ini) in smc_find_ism_v1_device_serv() argument
1581 if (!(ini->smcd_version & SMC_V1) || !smcd_indicated(ini->smc_type_v1)) in smc_find_ism_v1_device_serv()
1583 ini->is_smcd = true; /* prepare ISM check */ in smc_find_ism_v1_device_serv()
1584 ini->ism_peer_gid[0] = ntohll(pclc_smcd->ism.gid); in smc_find_ism_v1_device_serv()
1585 if (smc_find_ism_device(new_smc, ini)) in smc_find_ism_v1_device_serv()
1587 ini->ism_selected = 0; in smc_find_ism_v1_device_serv()
1588 if (!smc_listen_ism_init(new_smc, ini)) in smc_find_ism_v1_device_serv()
1592 ini->ism_dev[0] = NULL; in smc_find_ism_v1_device_serv()
1593 ini->is_smcd = false; in smc_find_ism_v1_device_serv()
1612 struct smc_init_info *ini) in smc_find_rdma_v1_device_serv() argument
1616 if (!smcr_indicated(ini->smc_type_v1)) in smc_find_rdma_v1_device_serv()
1620 ini->ib_lcl = &pclc->lcl; in smc_find_rdma_v1_device_serv()
1621 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
1624 if (ini->smc_type_v1 == SMC_TYPE_B) in smc_find_rdma_v1_device_serv()
1629 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
1632 return smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v1_device_serv()
1638 struct smc_init_info *ini) in smc_listen_find_device() argument
1643 smc_find_ism_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1644 if (ini->ism_dev[0]) in smc_listen_find_device()
1647 if (!(ini->smcd_version & SMC_V1)) in smc_listen_find_device()
1656 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini)) in smc_listen_find_device()
1660 smc_find_ism_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1661 if (ini->ism_dev[0]) in smc_listen_find_device()
1668 return smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1706 struct smc_init_info *ini = NULL; in smc_listen_work() local
1746 ini = kzalloc(sizeof(*ini), GFP_KERNEL); in smc_listen_work()
1747 if (!ini) { in smc_listen_work()
1753 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
1763 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
1768 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
1769 ini->smcd_version == SMC_V2 ? SMC_V2 : SMC_V1); in smc_listen_work()
1774 if (ini->is_smcd) in smc_listen_work()
1783 if (!ini->is_smcd) in smc_listen_work()
1789 if (!ini->is_smcd) { in smc_listen_work()
1791 ini->first_contact_local); in smc_listen_work()
1803 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
1806 kfree(ini); in smc_listen_work()