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,
1032 struct smc_llc_msg_add_link *llc = &qentry->msg.add_link; in smc_llc_cli_add_link() local
1039 if (!llc->qp_mtu) in smc_llc_cli_add_link()
1057 ini->smcrv2.daddr = smc_ib_gid_to_ipv4(llc->sender_gid); in smc_llc_cli_add_link()
1060 if (!memcmp(llc->sender_gid, link->peer_gid, SMC_GID_SIZE) && in smc_llc_cli_add_link()
1062 !memcmp(llc->sender_mac, link->peer_mac, ETH_ALEN))) { in smc_llc_cli_add_link()
1083 smc_llc_save_add_link_info(lnk_new, llc); in smc_llc_cli_add_link()
1084 lnk_new->link_id = llc->link_num; /* SMC server assigns link id */ in smc_llc_cli_add_link()
1125 struct smc_llc_msg_req_add_link_v2 *llc; in smc_llc_send_request_add_link() local
1144 llc = (struct smc_llc_msg_req_add_link_v2 *)wr_buf; in smc_llc_send_request_add_link()
1145 memset(llc, 0, SMC_WR_TX_SIZE); in smc_llc_send_request_add_link()
1147 llc->hd.common.llc_type = SMC_LLC_REQ_ADD_LINK; in smc_llc_send_request_add_link()
1149 memcpy(llc->gid[i], gidlist.list[i], sizeof(gidlist.list[0])); in smc_llc_send_request_add_link()
1150 llc->gid_cnt = gidlist.len; in smc_llc_send_request_add_link()
1151 len = sizeof(*llc) + (gidlist.len * sizeof(gidlist.list[0])); in smc_llc_send_request_add_link()
1152 smc_llc_init_msg_hdr(&llc->hd, link->lgr, len); in smc_llc_send_request_add_link()
1196 static bool smc_llc_is_empty_llc_message(union smc_llc_msg *llc) in smc_llc_is_empty_llc_message() argument
1200 for (i = 0; i < ARRAY_SIZE(llc->raw.data); i++) in smc_llc_is_empty_llc_message()
1201 if (llc->raw.data[i]) in smc_llc_is_empty_llc_message()
1206 static bool smc_llc_is_local_add_link(union smc_llc_msg *llc) in smc_llc_is_local_add_link() argument
1208 if (llc->raw.hdr.common.llc_type == SMC_LLC_ADD_LINK && in smc_llc_is_local_add_link()
1209 smc_llc_is_empty_llc_message(llc)) in smc_llc_is_local_add_link()
1757 struct smc_llc_msg_confirm_rkey *llc; in smc_llc_rmt_conf_rkey() local
1765 llc = &qentry->msg.confirm_rkey; in smc_llc_rmt_conf_rkey()
1768 num_entries = llc->rtoken[0].num_rkeys; in smc_llc_rmt_conf_rkey()
1773 llc->rtoken[0].rmb_vaddr, in smc_llc_rmt_conf_rkey()
1774 llc->rtoken[0].rmb_key); in smc_llc_rmt_conf_rkey()
1779 smc_rtoken_set2(lgr, rk_idx, llc->rtoken[i].link_id, in smc_llc_rmt_conf_rkey()
1780 llc->rtoken[i].rmb_vaddr, in smc_llc_rmt_conf_rkey()
1781 llc->rtoken[i].rmb_key); in smc_llc_rmt_conf_rkey()
1785 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_conf_rkey()
1786 llc->hd.flags |= SMC_LLC_FLAG_RKEY_RETRY; in smc_llc_rmt_conf_rkey()
1788 llc->hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_rmt_conf_rkey()
1789 smc_llc_init_msg_hdr(&llc->hd, link->lgr, sizeof(*llc)); in smc_llc_rmt_conf_rkey()
1797 struct smc_llc_msg_delete_rkey *llc; in smc_llc_rmt_delete_rkey() local
1804 llc = &qentry->msg.delete_rkey; in smc_llc_rmt_delete_rkey()
1810 memcpy(lgr->wr_rx_buf_v2, llc, sizeof(*llc)); in smc_llc_rmt_delete_rkey()
1819 memset(&llc->rkey[0], 0, sizeof(llc->rkey)); in smc_llc_rmt_delete_rkey()
1820 memset(&llc->reserved2, 0, sizeof(llc->reserved2)); in smc_llc_rmt_delete_rkey()
1821 smc_llc_init_msg_hdr(&llc->hd, link->lgr, sizeof(*llc)); in smc_llc_rmt_delete_rkey()
1823 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_delete_rkey()
1824 llc->err_mask = llcv2->num_inval_rkeys; in smc_llc_rmt_delete_rkey()
1829 max = min_t(u8, llc->num_rkeys, SMC_LLC_DEL_RKEY_MAX); in smc_llc_rmt_delete_rkey()
1831 if (smc_rtoken_delete(link, llc->rkey[i])) in smc_llc_rmt_delete_rkey()
1835 llc->hd.flags |= SMC_LLC_FLAG_RKEY_NEG; in smc_llc_rmt_delete_rkey()
1836 llc->err_mask = err_mask; in smc_llc_rmt_delete_rkey()
1839 llc->hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_rmt_delete_rkey()
1846 pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu LLC protocol violation: " in smc_llc_protocol_violation()
1853 /* flush the llc event queue */
1868 union smc_llc_msg *llc = &qentry->msg; in smc_llc_event_handler() local
1875 switch (llc->raw.hdr.common.llc_type) { in smc_llc_event_handler()
1877 llc->test_link.hd.flags |= SMC_LLC_FLAG_RESP; in smc_llc_event_handler()
1878 smc_llc_send_message(link, llc); in smc_llc_event_handler()
1884 if (smc_llc_is_local_add_link(llc)) { in smc_llc_event_handler()
1941 /* process here, does not wait for more llc msgs */ in smc_llc_event_handler()
1954 /* process here, does not wait for more llc msgs */ in smc_llc_event_handler()
1965 (llc->raw.hdr.flags & SMC_LLC_FLAG_RESP)) { in smc_llc_event_handler()
1977 smc_llc_protocol_violation(lgr, llc->raw.hdr.common.type); in smc_llc_event_handler()
1984 /* worker to process llc messages on the event queue */
2013 /* process llc responses in tasklet context */
2057 static void smc_llc_enqueue(struct smc_link *link, union smc_llc_msg *llc) in smc_llc_enqueue() argument
2068 memcpy(&qentry->msg, llc, sizeof(union smc_llc_msg)); in smc_llc_enqueue()
2071 if ((llc->raw.hdr.flags & SMC_LLC_FLAG_RESP) && in smc_llc_enqueue()
2072 llc->raw.hdr.common.llc_type != SMC_LLC_REQ_ADD_LINK) { in smc_llc_enqueue()
2088 union smc_llc_msg *llc = buf; in smc_llc_rx_handler() local
2090 if (wc->byte_len < sizeof(*llc)) in smc_llc_rx_handler()
2092 if (!llc->raw.hdr.common.llc_version) { in smc_llc_rx_handler()
2093 if (llc->raw.hdr.length != sizeof(*llc)) in smc_llc_rx_handler()
2096 if (llc->raw.hdr.length_v2 < sizeof(*llc)) in smc_llc_rx_handler()
2100 smc_llc_enqueue(link, llc); in smc_llc_rx_handler()