Lines Matching full:llc

5  *  Link Layer Control (LLC)
206 static void smc_llc_enqueue(struct smc_link *link, union smc_llc_msg *llc);
243 /* drop parallel or already-in-progress llc requests */ in smc_llc_flow_parallel()
246 "LLC msg: msg %d flow %d role %d\n", in smc_llc_flow_parallel()
254 /* try to start a new llc flow, initiated by an incoming llc msg */
286 /* start a new local llc flow, wait till current flow finished */
320 /* finish the current llc flow */
363 pr_warn_once("smc: SMC-R lg %*phN net %llu dropped unexpected LLC msg: " in smc_llc_wait()
380 /* handler for send/transmission completion of an LLC msg */
389 * smc_llc_add_pending_send() - add LLC control message to pending WQE transmits
390 * @link: Pointer to SMC link used for sending LLC control message.
447 /* high-level API to send LLC confirm link */
475 /* send llc message */ in smc_llc_send_confirm_link()
482 /* send LLC confirm rkey request */
524 /* send llc message */ in smc_llc_send_confirm_rkey()
531 /* send LLC delete rkey request */
551 /* send llc message */ in smc_llc_send_delete_rkey()
686 /* send llc message */ in smc_llc_send_add_link()
725 /* send llc message */ in smc_llc_send_delete_link()
732 /* send LLC test link request */
750 /* send llc message */ in smc_llc_send_test_link()
757 /* schedule an llc send on link, may wait for buffers */
776 /* schedule an llc send on link, may wait for buffers,
1025 struct smc_llc_msg_add_link *llc = &qentry->msg.add_link; in smc_llc_cli_add_link() local
1032 if (!llc->qp_mtu) in smc_llc_cli_add_link()
1045 ini->smcrv2.daddr = smc_ib_gid_to_ipv4(llc->sender_gid); in smc_llc_cli_add_link()
1048 if (!memcmp(llc->sender_gid, link->peer_gid, SMC_GID_SIZE) && in smc_llc_cli_add_link()
1050 !memcmp(llc->sender_mac, link->peer_mac, ETH_ALEN))) { in smc_llc_cli_add_link()
1071 smc_llc_save_add_link_info(lnk_new, llc); in smc_llc_cli_add_link()
1072 lnk_new->link_id = llc->link_num; /* SMC server assigns link id */ in smc_llc_cli_add_link()
1113 struct smc_llc_msg_req_add_link_v2 *llc; in smc_llc_send_request_add_link() local
1132 llc = (struct smc_llc_msg_req_add_link_v2 *)wr_buf; in smc_llc_send_request_add_link()
1133 memset(llc, 0, SMC_WR_TX_SIZE); in smc_llc_send_request_add_link()
1135 llc->hd.common.llc_type = SMC_LLC_REQ_ADD_LINK; in smc_llc_send_request_add_link()
1137 memcpy(llc->gid[i], gidlist.list[i], sizeof(gidlist.list[0])); in smc_llc_send_request_add_link()
1138 llc->gid_cnt = gidlist.len; in smc_llc_send_request_add_link()
1139 len = sizeof(*llc) + (gidlist.len * sizeof(gidlist.list[0])); in smc_llc_send_request_add_link()
1140 smc_llc_init_msg_hdr(&llc->hd, link->lgr, len); in smc_llc_send_request_add_link()
1181 static bool smc_llc_is_empty_llc_message(union smc_llc_msg *llc) in smc_llc_is_empty_llc_message() argument
1185 for (i = 0; i < ARRAY_SIZE(llc->raw.data); i++) in smc_llc_is_empty_llc_message()
1186 if (llc->raw.data[i]) in smc_llc_is_empty_llc_message()
1191 static bool smc_llc_is_local_add_link(union smc_llc_msg *llc) in smc_llc_is_local_add_link() argument
1193 if (llc->raw.hdr.common.llc_type == SMC_LLC_ADD_LINK && in smc_llc_is_local_add_link()
1194 smc_llc_is_empty_llc_message(llc)) in smc_llc_is_local_add_link()
1737 struct smc_llc_msg_confirm_rkey *llc; in smc_llc_rmt_conf_rkey() local
1745 llc = &qentry->msg.confirm_rkey; in smc_llc_rmt_conf_rkey()
1748 num_entries = llc->rtoken[0].num_rkeys; in smc_llc_rmt_conf_rkey()
1753 llc->rtoken[0].rmb_vaddr, in smc_llc_rmt_conf_rkey()
1754 llc->rtoken[0].rmb_key); in smc_llc_rmt_conf_rkey()
1759 smc_rtoken_set2(lgr, rk_idx, llc->rtoken[i].link_id, in smc_llc_rmt_conf_rkey()
1760 llc->rtoken[i].rmb_vaddr, in smc_llc_rmt_conf_rkey()
1761 llc->rtoken[i].rmb_key); in smc_llc_rmt_conf_rkey()
1765 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_conf_rkey()
1766 llc->hd.flags |= SMC_LLC_FLAG_RKEY_RETRY; in smc_llc_rmt_conf_rkey()
1768 llc->hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_rmt_conf_rkey()
1769 smc_llc_init_msg_hdr(&llc->hd, link->lgr, sizeof(*llc)); in smc_llc_rmt_conf_rkey()
1777 struct smc_llc_msg_delete_rkey *llc; in smc_llc_rmt_delete_rkey() local
1784 llc = &qentry->msg.delete_rkey; in smc_llc_rmt_delete_rkey()
1790 memcpy(lgr->wr_rx_buf_v2, llc, sizeof(*llc)); in smc_llc_rmt_delete_rkey()
1799 memset(&llc->rkey[0], 0, sizeof(llc->rkey)); in smc_llc_rmt_delete_rkey()
1800 memset(&llc->reserved2, 0, sizeof(llc->reserved2)); in smc_llc_rmt_delete_rkey()
1801 smc_llc_init_msg_hdr(&llc->hd, link->lgr, sizeof(*llc)); in smc_llc_rmt_delete_rkey()
1803 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_delete_rkey()
1804 llc->err_mask = llcv2->num_inval_rkeys; in smc_llc_rmt_delete_rkey()
1809 max = min_t(u8, llc->num_rkeys, SMC_LLC_DEL_RKEY_MAX); in smc_llc_rmt_delete_rkey()
1811 if (smc_rtoken_delete(link, llc->rkey[i])) in smc_llc_rmt_delete_rkey()
1815 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_delete_rkey()
1816 llc->err_mask = err_mask; in smc_llc_rmt_delete_rkey()
1819 llc->hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_rmt_delete_rkey()
1826 pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu LLC protocol violation: " in smc_llc_protocol_violation()
1833 /* flush the llc event queue */
1848 union smc_llc_msg *llc = &qentry->msg; in smc_llc_event_handler() local
1855 switch (llc->raw.hdr.common.llc_type) { in smc_llc_event_handler()
1857 llc->test_link.hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_event_handler()
1858 smc_llc_send_message(link, llc); in smc_llc_event_handler()
1864 if (smc_llc_is_local_add_link(llc)) { in smc_llc_event_handler()
1921 /* process here, does not wait for more llc msgs */ in smc_llc_event_handler()
1934 /* process here, does not wait for more llc msgs */ in smc_llc_event_handler()
1945 (llc->raw.hdr.flags & SMC_LLC_FLAG_RESP)) { in smc_llc_event_handler()
1957 smc_llc_protocol_violation(lgr, llc->raw.hdr.common.type); in smc_llc_event_handler()
1964 /* worker to process llc messages on the event queue */
1993 /* process llc responses in tasklet context */
2037 static void smc_llc_enqueue(struct smc_link *link, union smc_llc_msg *llc) in smc_llc_enqueue() argument
2048 memcpy(&qentry->msg, llc, sizeof(union smc_llc_msg)); in smc_llc_enqueue()
2051 if ((llc->raw.hdr.flags & SMC_LLC_FLAG_RESP) && in smc_llc_enqueue()
2052 llc->raw.hdr.common.llc_type != SMC_LLC_REQ_ADD_LINK) { in smc_llc_enqueue()
2068 union smc_llc_msg *llc = buf; in smc_llc_rx_handler() local
2070 if (wc->byte_len < sizeof(*llc)) in smc_llc_rx_handler()
2072 if (!llc->raw.hdr.common.llc_version) { in smc_llc_rx_handler()
2073 if (llc->raw.hdr.length != sizeof(*llc)) in smc_llc_rx_handler()
2076 if (llc->raw.hdr.length_v2 < sizeof(*llc)) in smc_llc_rx_handler()
2080 smc_llc_enqueue(link, llc); in smc_llc_rx_handler()