stripe_count stripes; fixed.
- Match bulk and reply buffers by source NID, which doesn't hurt and may even
fix a bug.
}
cbd->cb = callback;
- atomic_set(&cbd->refcount, stripe_count);
+
+ /* This is the only race-free way I can think of to get the refcount
+ * correct. -phil */
+ atomic_set(&cbd->refcount, 0);
+ for (i = 0; i < stripe_count; i++)
+ if (stripeinfo[i].bufct)
+ atomic_inc(&cbd->refcount);
+
for (i = 0; i < stripe_count; i++) {
int shift = stripeinfo[i].index;
if (stripeinfo[i].bufct)
if (req->rq_xid != ev->match_bits) {
CERROR("Reply packet for wrong request\n");
- LBUG();
+ LBUG();
}
if (ev->type == PTL_EVENT_PUT) {
struct ptlrpc_service *service = ev->mem_desc.user_ptr;
LASSERT ((ev->mem_desc.options & PTL_MD_IOV) == 0); /* requests always contiguous */
-
+
if (ev->rlength != ev->mlength)
CERROR("Warning: Possibly truncated rpc (%d/%d)\n",
ev->mlength, ev->rlength);
/* 1 fragment for each page always */
LASSERT (ev->mem_desc.niov == desc->bd_page_count);
-
+
if (ev->type == PTL_EVENT_SENT) {
CDEBUG(D_NET, "got SENT event\n");
} else if (ev->type == PTL_EVENT_ACK) {
CDEBUG(D_NET, "got ACK event\n");
-
+
list_for_each_safe(tmp, next, &desc->bd_page_list) {
- bulk = list_entry(tmp, struct ptlrpc_bulk_page, bp_link);
-
+ bulk = list_entry(tmp, struct ptlrpc_bulk_page,
+ bp_link);
+
if (bulk->bp_cb != NULL)
bulk->bp_cb(bulk);
}
LASSERT (ev->mem_desc.niov == desc->bd_page_count);
list_for_each_safe (tmp, next, &desc->bd_page_list) {
- bulk = list_entry(tmp, struct ptlrpc_bulk_page, bp_link);
+ bulk = list_entry(tmp, struct ptlrpc_bulk_page,
+ bp_link);
total += bulk->bp_buflen;
-
+
if (bulk->bp_cb != NULL)
bulk->bp_cb(bulk);
}
LASSERT (ev->mem_desc.length == total);
-
+
desc->bd_flags |= PTL_BULK_FL_RCVD;
wake_up(&desc->bd_waitq);
if (desc->bd_cb != NULL)
int rc;
__u32 xid = 0;
struct iovec *iov;
+ ptl_process_id_t source_id;
ENTRY;
iov = ptlrpc_get_bulk_iov (desc);
LASSERT (desc->bd_md.niov == desc->bd_page_count);
LASSERT (desc->bd_md.niov != 0);
+ source_id.nid = desc->bd_connection->c_peer.peer_nid;
+ source_id.pid = PTL_PID_ANY;
+
rc = PtlMEAttach(desc->bd_connection->c_peer.peer_ni,
- desc->bd_portal, local_id, xid, 0,
+ desc->bd_portal, source_id, xid, 0,
PTL_UNLINK, PTL_INS_AFTER, &desc->bd_me_h);
ptlrpc_put_bulk_iov (desc, iov);
{
int rc;
char *repbuf;
+ ptl_process_id_t source_id;
ENTRY;
// down(&request->rq_client->cli_rpc_sem);
+ source_id.nid = request->rq_connection->c_peer.peer_nid;
+ source_id.pid = PTL_PID_ANY;
+
rc = PtlMEAttach(request->rq_connection->c_peer.peer_ni,
request->rq_import->imp_client->cli_reply_portal,
- local_id, request->rq_xid, 0, PTL_UNLINK,
+ source_id, request->rq_xid, 0, PTL_UNLINK,
PTL_INS_AFTER, &request->rq_reply_me_h);
if (rc != PTL_OK) {
CERROR("PtlMEAttach failed: %d\n", rc);