- conn = ksocknal_find_conn_locked (0, peer);
- if (conn == NULL) {
- read_unlock (&ksocknal_data.ksnd_global_lock);
- ksocknal_free_tx(tx);
- CERROR("Can't find connection to send zcack.\n");
- return -ECONNRESET;
- }
- ksocknal_queue_tx_locked(tx, conn);
-
- read_unlock (&ksocknal_data.ksnd_global_lock);
-
- return 0;
-}
-
-/* (Sender) handle ZC_ACK from sink */
-static int
-ksocknal_handle_zc_ack(ksock_peer_t *peer, __u64 cookie)
-{
- ksock_tx_t *tx;
- struct list_head *ctmp;
-
- spin_lock(&peer->ksnp_lock);
-
- list_for_each(ctmp, &peer->ksnp_zc_req_list) {
- tx = list_entry (ctmp, ksock_tx_t, tx_zc_list);
- if (tx->tx_msg.ksm_zc_req_cookie != cookie)
- continue;
-
- tx->tx_msg.ksm_zc_req_cookie = 0;
- list_del(&tx->tx_zc_list);
-
- spin_unlock(&peer->ksnp_lock);
-
- ksocknal_tx_decref(tx);
- return 0;
- }
- spin_unlock(&peer->ksnp_lock);
-
- return -EPROTO;
-}
-
-int
-ksocknal_process_receive (ksock_conn_t *conn)
-{
- int rc;
-
- LASSERT (atomic_read(&conn->ksnc_conn_refcount) > 0);
-
- /* NB: sched lock NOT held */
- /* SOCKNAL_RX_LNET_HEADER is here for backward compatability */
- LASSERT (conn->ksnc_rx_state == SOCKNAL_RX_KSM_HEADER ||
- conn->ksnc_rx_state == SOCKNAL_RX_LNET_PAYLOAD ||
- conn->ksnc_rx_state == SOCKNAL_RX_LNET_HEADER ||
- conn->ksnc_rx_state == SOCKNAL_RX_SLOP);
- again:
- if (conn->ksnc_rx_nob_wanted != 0) {
- rc = ksocknal_receive(conn);
-
- if (rc <= 0) {
- LASSERT (rc != -EAGAIN);
-
- if (rc == 0)
- CDEBUG (D_NET, "[%p] EOF from %s"
- " ip %d.%d.%d.%d:%d\n", conn,
- libcfs_id2str(conn->ksnc_peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port);
- else if (!conn->ksnc_closing)
- CERROR ("[%p] Error %d on read from %s"
- " ip %d.%d.%d.%d:%d\n",
- conn, rc,
- libcfs_id2str(conn->ksnc_peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr),
- conn->ksnc_port);
-
- /* it's not an error if conn is being closed */
- ksocknal_close_conn_and_siblings (conn,
- (conn->ksnc_closing) ? 0 : rc);
- return (rc == 0 ? -ESHUTDOWN : rc);
- }
-