* 1. Free the request buffer after it has gone out on the wire
* 2. Wake up the thread waiting for the reply once it comes in.
*/
-static int request_callback(ptl_event_t *ev, void *data)
+static int client_packet_callback(ptl_event_t *ev, void *data)
{
struct ptlrpc_request *rpc = ev->mem_desc.user_ptr;
ENTRY;
+ // XXX make sure we understand all events, including ACK's
if (ev->type == PTL_EVENT_SENT) {
OBD_FREE(ev->mem_desc.start, ev->mem_desc.length);
return 1;
}
-static int incoming_callback(ptl_event_t *ev, void *data)
+static int server_request_callback(ptl_event_t *ev, void *data)
{
struct ptlrpc_service *service = data;
int rc;
service->srv_ref_count[service->srv_md_active]++;
if (ev->offset >= (service->srv_buf_size - 1024)) {
- CERROR("Unlinking ME %d\n", service->srv_me_active);
+ CDEBUG(D_INODE, "Unlinking ME %d\n", service->srv_me_active);
rc = PtlMEUnlink(service->srv_me_h[service->srv_me_active]);
service->srv_me_h[service->srv_me_active] = 0;
if (rc != PTL_OK) {
- CERROR("PtlMEUnlink failed: %d\n", rc);
+ CERROR("PtlMEUnlink failed - DROPPING soon: %d\n", rc);
return rc;
}
if ((service->srv_ref_count[index] <= 0) &&
(service->srv_me_h[index] == 0)) {
- rc = PtlMDUnlink(service->srv_md_h[index]);
- CDEBUG(D_INFO, "Removing MD at index %d, rc %d\n", index, rc);
-
- if (rc)
- CERROR(": PtlMDUnlink failed: index %d rc %d\n",
- index, rc);
-
/* Replace the unlinked ME and MD */
-
rc = PtlMEInsert(service->srv_me_h[service->srv_me_tail],
service->srv_id, 0, ~0, PTL_RETAIN,
PTL_INS_AFTER, &(service->srv_me_h[index]));
service->srv_id.gid = PTL_ID_ANY;
service->srv_id.rid = PTL_ID_ANY;
- rc = PtlEQAlloc(peer.peer_ni, 128, incoming_callback,
+ rc = PtlEQAlloc(peer.peer_ni, 128, server_request_callback,
service, &(service->srv_eq_h));
if (rc != PTL_OK) {
}
ni = *nip;
- rc = PtlEQAlloc(ni, 128, request_callback, NULL, &req_eq);
+ rc = PtlEQAlloc(ni, 128, client_packet_callback, NULL, &req_eq);
if (rc != PTL_OK)
CERROR("PtlEQAlloc failed: %d\n", rc);