Lines Matching full:llc

5  *  Link Layer Control (LLC)
205 static void smc_llc_enqueue(struct smc_link *link, union smc_llc_msg *llc);
242 /* drop parallel or already-in-progress llc requests */ in smc_llc_flow_parallel()
245 "LLC msg: msg %d flow %d role %d\n", in smc_llc_flow_parallel()
253 /* try to start a new llc flow, initiated by an incoming llc msg */
285 /* start a new local llc flow, wait till current flow finished */
319 /* finish the current llc flow */
362 pr_warn_once("smc: SMC-R lg %*phN net %llu dropped unexpected LLC msg: " in smc_llc_wait()
379 /* handler for send/transmission completion of an LLC msg */
388 * smc_llc_add_pending_send() - add LLC control message to pending WQE transmits
389 * @link: Pointer to SMC link used for sending LLC control message.
446 /* high-level API to send LLC confirm link */
479 /* send llc message */ in smc_llc_send_confirm_link()
486 /* send LLC confirm rkey request */
528 /* send llc message */ in smc_llc_send_confirm_rkey()
535 /* send LLC delete rkey request */
555 /* send llc message */ in smc_llc_send_delete_rkey()
693 /* send llc message */ in smc_llc_send_add_link()
732 /* send llc message */ in smc_llc_send_delete_link()
739 /* send LLC test link request */
757 /* send llc message */ in smc_llc_send_test_link()
764 /* schedule an llc send on link, may wait for buffers */
783 /* schedule an llc send on link, may wait for buffers,
1033 struct smc_llc_msg_add_link *llc = &qentry->msg.add_link; in smc_llc_cli_add_link() local
1040 if (!llc->qp_mtu) in smc_llc_cli_add_link()
1058 ini->smcrv2.daddr = smc_ib_gid_to_ipv4(llc->sender_gid); in smc_llc_cli_add_link()
1061 if (!memcmp(llc->sender_gid, link->peer_gid, SMC_GID_SIZE) && in smc_llc_cli_add_link()
1063 !memcmp(llc->sender_mac, link->peer_mac, ETH_ALEN))) { in smc_llc_cli_add_link()
1084 smc_llc_save_add_link_info(lnk_new, llc); in smc_llc_cli_add_link()
1085 lnk_new->link_id = llc->link_num; /* SMC server assigns link id */ in smc_llc_cli_add_link()
1103 (u8 *)lgr->wr_rx_buf_v2 : (u8 *)llc; in smc_llc_cli_add_link()
1128 struct smc_llc_msg_req_add_link_v2 *llc; in smc_llc_send_request_add_link() local
1147 llc = (struct smc_llc_msg_req_add_link_v2 *)wr_buf; in smc_llc_send_request_add_link()
1148 memset(llc, 0, SMC_WR_TX_SIZE); in smc_llc_send_request_add_link()
1150 llc->hd.common.llc_type = SMC_LLC_REQ_ADD_LINK; in smc_llc_send_request_add_link()
1152 memcpy(llc->gid[i], gidlist.list[i], sizeof(gidlist.list[0])); in smc_llc_send_request_add_link()
1153 llc->gid_cnt = gidlist.len; in smc_llc_send_request_add_link()
1154 len = sizeof(*llc) + (gidlist.len * sizeof(gidlist.list[0])); in smc_llc_send_request_add_link()
1155 smc_llc_init_msg_hdr(&llc->hd, link->lgr, len); in smc_llc_send_request_add_link()
1199 static bool smc_llc_is_empty_llc_message(union smc_llc_msg *llc) in smc_llc_is_empty_llc_message() argument
1203 for (i = 0; i < ARRAY_SIZE(llc->raw.data); i++) in smc_llc_is_empty_llc_message()
1204 if (llc->raw.data[i]) in smc_llc_is_empty_llc_message()
1209 static bool smc_llc_is_local_add_link(union smc_llc_msg *llc) in smc_llc_is_local_add_link() argument
1211 if (llc->raw.hdr.common.llc_type == SMC_LLC_ADD_LINK && in smc_llc_is_local_add_link()
1212 smc_llc_is_empty_llc_message(llc)) in smc_llc_is_local_add_link()
1762 struct smc_llc_msg_confirm_rkey *llc; in smc_llc_rmt_conf_rkey() local
1770 llc = &qentry->msg.confirm_rkey; in smc_llc_rmt_conf_rkey()
1773 num_entries = llc->rtoken[0].num_rkeys; in smc_llc_rmt_conf_rkey()
1778 llc->rtoken[0].rmb_vaddr, in smc_llc_rmt_conf_rkey()
1779 llc->rtoken[0].rmb_key); in smc_llc_rmt_conf_rkey()
1784 smc_rtoken_set2(lgr, rk_idx, llc->rtoken[i].link_id, in smc_llc_rmt_conf_rkey()
1785 llc->rtoken[i].rmb_vaddr, in smc_llc_rmt_conf_rkey()
1786 llc->rtoken[i].rmb_key); in smc_llc_rmt_conf_rkey()
1790 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_conf_rkey()
1791 llc->hd.flags |= SMC_LLC_FLAG_RKEY_RETRY; in smc_llc_rmt_conf_rkey()
1793 llc->hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_rmt_conf_rkey()
1794 smc_llc_init_msg_hdr(&llc->hd, link->lgr, sizeof(*llc)); in smc_llc_rmt_conf_rkey()
1802 struct smc_llc_msg_delete_rkey *llc; in smc_llc_rmt_delete_rkey() local
1809 llc = &qentry->msg.delete_rkey; in smc_llc_rmt_delete_rkey()
1816 memcpy(lgr->wr_rx_buf_v2, llc, sizeof(*llc)); in smc_llc_rmt_delete_rkey()
1819 llcv2 = (struct smc_llc_msg_delete_rkey_v2 *)llc; in smc_llc_rmt_delete_rkey()
1828 memset(&llc->rkey[0], 0, sizeof(llc->rkey)); in smc_llc_rmt_delete_rkey()
1829 memset(&llc->reserved2, 0, sizeof(llc->reserved2)); in smc_llc_rmt_delete_rkey()
1830 smc_llc_init_msg_hdr(&llc->hd, link->lgr, sizeof(*llc)); in smc_llc_rmt_delete_rkey()
1832 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_delete_rkey()
1833 llc->err_mask = llcv2->num_inval_rkeys; in smc_llc_rmt_delete_rkey()
1838 max = min_t(u8, llc->num_rkeys, SMC_LLC_DEL_RKEY_MAX); in smc_llc_rmt_delete_rkey()
1840 if (smc_rtoken_delete(link, llc->rkey[i])) in smc_llc_rmt_delete_rkey()
1844 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_delete_rkey()
1845 llc->err_mask = err_mask; in smc_llc_rmt_delete_rkey()
1848 llc->hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_rmt_delete_rkey()
1855 pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu LLC protocol violation: " in smc_llc_protocol_violation()
1862 /* flush the llc event queue */
1877 union smc_llc_msg *llc = &qentry->msg; in smc_llc_event_handler() local
1884 switch (llc->raw.hdr.common.llc_type) { in smc_llc_event_handler()
1886 llc->test_link.hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_event_handler()
1887 smc_llc_send_message(link, llc); in smc_llc_event_handler()
1893 if (smc_llc_is_local_add_link(llc)) { in smc_llc_event_handler()
1950 /* process here, does not wait for more llc msgs */ in smc_llc_event_handler()
1963 /* process here, does not wait for more llc msgs */ in smc_llc_event_handler()
1974 (llc->raw.hdr.flags & SMC_LLC_FLAG_RESP)) { in smc_llc_event_handler()
1986 smc_llc_protocol_violation(lgr, llc->raw.hdr.common.type); in smc_llc_event_handler()
1993 /* worker to process llc messages on the event queue */
2022 /* process llc responses in tasklet context */
2066 static void smc_llc_enqueue(struct smc_link *link, union smc_llc_msg *llc) in smc_llc_enqueue() argument
2077 memcpy(&qentry->msg, llc, sizeof(union smc_llc_msg)); in smc_llc_enqueue()
2080 if ((llc->raw.hdr.flags & SMC_LLC_FLAG_RESP) && in smc_llc_enqueue()
2081 llc->raw.hdr.common.llc_type != SMC_LLC_REQ_ADD_LINK) { in smc_llc_enqueue()
2097 union smc_llc_msg *llc = buf; in smc_llc_rx_handler() local
2099 if (wc->byte_len < sizeof(*llc)) in smc_llc_rx_handler()
2101 if (!llc->raw.hdr.common.llc_version) { in smc_llc_rx_handler()
2102 if (llc->raw.hdr.length != sizeof(*llc)) in smc_llc_rx_handler()
2105 if (llc->raw.hdr.length_v2 < sizeof(*llc)) in smc_llc_rx_handler()
2109 smc_llc_enqueue(link, llc); in smc_llc_rx_handler()