Lines Matching full:crq

114  * ibmvmc_handle_event: - Interrupt handler for crq events
134 * ibmvmc_release_crq_queue - Release CRQ Queue
161 * ibmvmc_reset_crq_queue - Reset CRQ Queue
178 /* Close the CRQ */ in ibmvmc_reset_crq_queue()
193 dev_err(adapter->dev, "couldn't register crq--rc 0x%x\n", rc); in ibmvmc_reset_crq_queue()
203 * entried in the CRQ.
207 struct ibmvmc_crq_msg *crq; in crq_queue_next_crq() local
211 crq = &queue->msgs[queue->cur]; in crq_queue_next_crq()
212 if (crq->valid & 0x80) { in crq_queue_next_crq()
217 * other bits of the CRQ entry in crq_queue_next_crq()
221 crq = NULL; in crq_queue_next_crq()
226 return crq; in crq_queue_next_crq()
230 * ibmvmc_send_crq - Send CRQ
617 dev_info(adapter->dev, "CRQ send: close\n"); in ibmvmc_send_close()
640 * The capabilities message is an administrative message sent after the CRQ
656 dev_dbg(adapter->dev, "ibmvmc: CRQ send: capabilities\n"); in ibmvmc_send_capabilities()
699 dev_dbg(adapter->dev, "CRQ send: add_buffer_resp\n"); in ibmvmc_send_add_buffer_resp()
740 dev_dbg(adapter->dev, "CRQ send: rem_buffer_resp\n"); in ibmvmc_send_rem_buffer_resp()
785 dev_dbg(adapter->dev, "CRQ send: rdma to HV\n"); in ibmvmc_send_msg()
805 dev_dbg(adapter->dev, "CRQ send: msg to HV 0x%llx 0x%llx\n", in ibmvmc_send_msg()
1402 * @crq: ibmvmc_crq_msg struct
1426 struct ibmvmc_crq_msg *crq) in ibmvmc_add_buffer() argument
1435 if (!crq) in ibmvmc_add_buffer()
1438 hmc_session = crq->hmc_session; in ibmvmc_add_buffer()
1439 hmc_index = crq->hmc_index; in ibmvmc_add_buffer()
1440 buffer_id = be16_to_cpu(crq->var2.buffer_id); in ibmvmc_add_buffer()
1482 buffer->dma_addr_remote = be32_to_cpu(crq->var3.lioba); in ibmvmc_add_buffer()
1484 buffer->owner = crq->var1.owner; in ibmvmc_add_buffer()
1509 * @crq: ibmvmc_crq_msg struct
1543 struct ibmvmc_crq_msg *crq) in ibmvmc_rem_buffer() argument
1552 if (!crq) in ibmvmc_rem_buffer()
1555 hmc_session = crq->hmc_session; in ibmvmc_rem_buffer()
1556 hmc_index = crq->hmc_index; in ibmvmc_rem_buffer()
1596 struct ibmvmc_crq_msg *crq) in ibmvmc_recv_msg() argument
1607 if (!crq) in ibmvmc_recv_msg()
1612 be64_to_cpu(*((unsigned long *)crq)), in ibmvmc_recv_msg()
1613 be64_to_cpu(*(((unsigned long *)crq) + 1))); in ibmvmc_recv_msg()
1615 hmc_session = crq->hmc_session; in ibmvmc_recv_msg()
1616 hmc_index = crq->hmc_index; in ibmvmc_recv_msg()
1617 buffer_id = be16_to_cpu(crq->var2.buffer_id); in ibmvmc_recv_msg()
1618 msg_len = be32_to_cpu(crq->var3.msg_len); in ibmvmc_recv_msg()
1703 struct ibmvmc_admin_crq_msg *crq = (struct ibmvmc_admin_crq_msg *)crqp; in ibmvmc_process_capabilities() local
1705 if ((be16_to_cpu(crq->version) >> 8) != in ibmvmc_process_capabilities()
1708 be16_to_cpu(crq->version), in ibmvmc_process_capabilities()
1714 ibmvmc.max_mtu = min_t(u32, ibmvmc_max_mtu, be32_to_cpu(crq->max_mtu)); in ibmvmc_process_capabilities()
1716 be16_to_cpu(crq->pool_size)); in ibmvmc_process_capabilities()
1717 ibmvmc.max_hmc_index = min_t(u8, ibmvmc_max_hmcs, crq->max_hmc) - 1; in ibmvmc_process_capabilities()
1729 * @crq: ibmvmc_crq_msg struct
1736 struct ibmvmc_crq_msg *crq) in ibmvmc_validate_hmc_session() argument
1740 hmc_index = crq->hmc_index; in ibmvmc_validate_hmc_session()
1742 if (crq->hmc_session == 0) in ibmvmc_validate_hmc_session()
1748 if (hmcs[hmc_index].session != crq->hmc_session) { in ibmvmc_validate_hmc_session()
1750 hmcs[hmc_index].session, crq->hmc_session); in ibmvmc_validate_hmc_session()
1763 * Closes all HMC sessions and conditionally schedules a CRQ reset.
1764 * @xport_event: If true, the partner closed their CRQ; we don't need to reset.
1765 * If false, we need to schedule a CRQ reset.
1777 /* CRQ was closed by the partner. We don't need to do in ibmvmc_reset()
1783 /* The partner did not close their CRQ - instead, we're in ibmvmc_reset()
1784 * closing the CRQ on our end. Need to schedule this in ibmvmc_reset()
1785 * for process context, because CRQ reset may require a in ibmvmc_reset()
1804 * Performs a CRQ reset of the VMC device in process context.
1822 dev_dbg(adapter->dev, "CRQ resetting in process context"); in ibmvmc_reset_task()
1828 dev_err(adapter->dev, "Error initializing CRQ. rc = 0x%x\n", in ibmvmc_reset_task()
1836 dev_warn(adapter->dev, "Failed to send initialize CRQ message\n"); in ibmvmc_reset_task()
1849 * @crq: ibmvmc_crq_msg struct
1856 static void ibmvmc_process_open_resp(struct ibmvmc_crq_msg *crq, in ibmvmc_process_open_resp() argument
1862 hmc_index = crq->hmc_index; in ibmvmc_process_open_resp()
1869 if (crq->status) { in ibmvmc_process_open_resp()
1871 crq->status); in ibmvmc_process_open_resp()
1877 buffer_id = be16_to_cpu(crq->var2.buffer_id); in ibmvmc_process_open_resp()
1897 * @crq: ibmvmc_crq_msg struct
1906 static void ibmvmc_process_close_resp(struct ibmvmc_crq_msg *crq, in ibmvmc_process_close_resp() argument
1911 hmc_index = crq->hmc_index; in ibmvmc_process_close_resp()
1917 if (crq->status) { in ibmvmc_process_close_resp()
1919 crq->status); in ibmvmc_process_close_resp()
1928 * ibmvmc_crq_process - Process CRQ
1931 * @crq: ibmvmc_crq_msg struct
1933 * Process the CRQ message based upon the type of message received.
1937 struct ibmvmc_crq_msg *crq) in ibmvmc_crq_process() argument
1939 switch (crq->type) { in ibmvmc_crq_process()
1941 dev_dbg(adapter->dev, "CRQ recv: capabilities resp (0x%x)\n", in ibmvmc_crq_process()
1942 crq->type); in ibmvmc_crq_process()
1944 ibmvmc_process_capabilities(adapter, crq); in ibmvmc_crq_process()
1950 dev_dbg(adapter->dev, "CRQ recv: open resp (0x%x)\n", in ibmvmc_crq_process()
1951 crq->type); in ibmvmc_crq_process()
1952 if (ibmvmc_validate_hmc_session(adapter, crq) == 0) in ibmvmc_crq_process()
1953 ibmvmc_process_open_resp(crq, adapter); in ibmvmc_crq_process()
1956 dev_dbg(adapter->dev, "CRQ recv: add buf (0x%x)\n", in ibmvmc_crq_process()
1957 crq->type); in ibmvmc_crq_process()
1958 if (ibmvmc_validate_hmc_session(adapter, crq) == 0) in ibmvmc_crq_process()
1959 ibmvmc_add_buffer(adapter, crq); in ibmvmc_crq_process()
1962 dev_dbg(adapter->dev, "CRQ recv: rem buf (0x%x)\n", in ibmvmc_crq_process()
1963 crq->type); in ibmvmc_crq_process()
1964 if (ibmvmc_validate_hmc_session(adapter, crq) == 0) in ibmvmc_crq_process()
1965 ibmvmc_rem_buffer(adapter, crq); in ibmvmc_crq_process()
1968 dev_dbg(adapter->dev, "CRQ recv: signal msg (0x%x)\n", in ibmvmc_crq_process()
1969 crq->type); in ibmvmc_crq_process()
1970 if (ibmvmc_validate_hmc_session(adapter, crq) == 0) in ibmvmc_crq_process()
1971 ibmvmc_recv_msg(adapter, crq); in ibmvmc_crq_process()
1974 dev_dbg(adapter->dev, "CRQ recv: close resp (0x%x)\n", in ibmvmc_crq_process()
1975 crq->type); in ibmvmc_crq_process()
1976 if (ibmvmc_validate_hmc_session(adapter, crq) == 0) in ibmvmc_crq_process()
1977 ibmvmc_process_close_resp(crq, adapter); in ibmvmc_crq_process()
1984 dev_warn(adapter->dev, "CRQ recv: unexpected msg (0x%x)\n", in ibmvmc_crq_process()
1985 crq->type); in ibmvmc_crq_process()
1988 dev_warn(adapter->dev, "CRQ recv: unknown msg (0x%x)\n", in ibmvmc_crq_process()
1989 crq->type); in ibmvmc_crq_process()
1995 * ibmvmc_handle_crq_init - Handle CRQ Init
1997 * @crq: ibmvmc_crq_msg struct
2000 * Handle the type of crq initialization based on whether
2004 static void ibmvmc_handle_crq_init(struct ibmvmc_crq_msg *crq, in ibmvmc_handle_crq_init() argument
2007 switch (crq->type) { in ibmvmc_handle_crq_init()
2009 dev_dbg(adapter->dev, "CRQ recv: CRQ init msg - state 0x%x\n", in ibmvmc_handle_crq_init()
2025 dev_dbg(adapter->dev, "CRQ recv: initialization resp msg - state 0x%x\n", in ibmvmc_handle_crq_init()
2031 dev_warn(adapter->dev, "Unknown crq message type 0x%lx\n", in ibmvmc_handle_crq_init()
2032 (unsigned long)crq->type); in ibmvmc_handle_crq_init()
2037 * ibmvmc_handle_crq - Handle CRQ
2039 * @crq: ibmvmc_crq_msg struct
2043 * requests based upon the type of crq message.
2046 static void ibmvmc_handle_crq(struct ibmvmc_crq_msg *crq, in ibmvmc_handle_crq() argument
2049 switch (crq->valid) { in ibmvmc_handle_crq()
2051 ibmvmc_handle_crq_init(crq, adapter); in ibmvmc_handle_crq()
2054 dev_warn(adapter->dev, "CRQ recv: virtual adapter failed - resetting.\n"); in ibmvmc_handle_crq()
2058 ibmvmc_crq_process(adapter, crq); in ibmvmc_handle_crq()
2061 dev_warn(adapter->dev, "CRQ recv: unknown msg 0x%02x.\n", in ibmvmc_handle_crq()
2062 crq->valid); in ibmvmc_handle_crq()
2072 struct ibmvmc_crq_msg *crq; in ibmvmc_task() local
2076 /* Pull all the valid messages off the CRQ */ in ibmvmc_task()
2077 while ((crq = crq_queue_next_crq(&adapter->queue)) != NULL) { in ibmvmc_task()
2078 ibmvmc_handle_crq(crq, adapter); in ibmvmc_task()
2079 crq->valid = 0x00; in ibmvmc_task()
2080 /* CRQ reset was requested, stop processing CRQs. in ibmvmc_task()
2088 crq = crq_queue_next_crq(&adapter->queue); in ibmvmc_task()
2089 if (crq) { in ibmvmc_task()
2091 ibmvmc_handle_crq(crq, adapter); in ibmvmc_task()
2092 crq->valid = 0x00; in ibmvmc_task()
2093 /* CRQ reset was requested, stop processing CRQs. in ibmvmc_task()
2105 * ibmvmc_init_crq_queue - Init CRQ Queue
2265 dev_err(adapter->dev, "Error initializing CRQ. rc = 0x%x\n", in ibmvmc_probe()
2279 dev_warn(adapter->dev, "Failed to send initialize CRQ message\n"); in ibmvmc_probe()