rq_self in struct ptlrpc_request can now store largs NIDs.
ptlrpc_connection_get() is also changed to received a
'struct lnet_nid'.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If2ea7770e967e2f044f2b2300950b612463e130c
Reviewed-on: https://review.whamcloud.com/44636
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
/** import where request is being sent */
struct obd_import *rq_import;
/** our LNet NID */
/** import where request is being sent */
struct obd_import *rq_import;
/** our LNet NID */
+ struct lnet_nid rq_self;
/** Peer description (the other side) */
struct lnet_process_id rq_peer;
/** Descriptor for the NID from which the peer sent the request. */
/** Peer description (the other side) */
struct lnet_process_id rq_peer;
/** Descriptor for the NID from which the peer sent the request. */
/* ptlrpc/events.c */
extern int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
/* ptlrpc/events.c */
extern int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
- struct lnet_process_id *peer, lnet_nid_t *self);
+ struct lnet_process_id *peer,
+ struct lnet_nid *self);
/**
* These callbacks are invoked by LNet when something happened to
* underlying buffer
/**
* These callbacks are invoked by LNet when something happened to
* underlying buffer
/* ptlrpc/connection.c */
struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_process_id peer,
/* ptlrpc/connection.c */
struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_process_id peer,
- lnet_nid_t self,
- struct obd_uuid *uuid);
+ struct lnet_nid *self,
+ struct obd_uuid *uuid);
static inline void ptlrpc_connection_put(struct ptlrpc_connection *conn)
{
static inline void ptlrpc_connection_put(struct ptlrpc_connection *conn)
{
*/
ptlrpc_request_change_export(req, export);
*/
ptlrpc_request_change_export(req, export);
- pcon = ptlrpc_connection_get(req->rq_peer, req->rq_self, &cluuid);
+ pcon = ptlrpc_connection_get(req->rq_peer,
+ &req->rq_self, &cluuid);
if (pcon == NULL)
GOTO(out, rc = -ENOTCONN);
if (pcon == NULL)
GOTO(out, rc = -ENOTCONN);
lnet_nid_t nid4refnet)
{
struct ptlrpc_connection *c;
lnet_nid_t nid4refnet)
{
struct ptlrpc_connection *c;
struct lnet_process_id peer;
int err;
struct lnet_process_id peer;
int err;
- c = ptlrpc_connection_get(peer, self, uuid);
+ c = ptlrpc_connection_get(peer, &self, uuid);
if (c) {
memcpy(c->c_remote_uuid.uuid,
uuid->uuid, sizeof(c->c_remote_uuid.uuid));
if (c) {
memcpy(c->c_remote_uuid.uuid,
uuid->uuid, sizeof(c->c_remote_uuid.uuid));
};
struct ptlrpc_connection *
};
struct ptlrpc_connection *
-ptlrpc_connection_get(struct lnet_process_id peer4, lnet_nid_t self,
+ptlrpc_connection_get(struct lnet_process_id peer4, struct lnet_nid *self,
struct obd_uuid *uuid)
{
struct ptlrpc_connection *conn, *conn2;
struct obd_uuid *uuid)
{
struct ptlrpc_connection *conn, *conn2;
RETURN(NULL);
conn->c_peer = peer;
RETURN(NULL);
conn->c_peer = peer;
- lnet_nid4_to_nid(self, &conn->c_self);
atomic_set(&conn->c_refcount, 1);
if (uuid)
obd_str2uuid(&conn->c_remote_uuid, uuid->uuid);
atomic_set(&conn->c_refcount, 1);
if (uuid)
obd_str2uuid(&conn->c_remote_uuid, uuid->uuid);
/* Multi-Rail: keep track of both initiator and source NID. */
req->rq_peer = lnet_pid_to_pid4(&ev->initiator);
req->rq_source = lnet_pid_to_pid4(&ev->source);
/* Multi-Rail: keep track of both initiator and source NID. */
req->rq_peer = lnet_pid_to_pid4(&ev->initiator);
req->rq_source = lnet_pid_to_pid4(&ev->source);
- req->rq_self = lnet_nid_to_nid4(&ev->target.nid);
+ req->rq_self = ev->target.nid;
req->rq_rqbd = rqbd;
req->rq_phase = RQ_PHASE_NEW;
if (ev->type == LNET_EVENT_PUT)
req->rq_rqbd = rqbd;
req->rq_phase = RQ_PHASE_NEW;
if (ev->type == LNET_EVENT_PUT)
}
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
}
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
- struct lnet_process_id *peer, lnet_nid_t *self)
+ struct lnet_process_id *peer,
+ struct lnet_nid *self)
{
int best_dist = 0;
__u32 best_order = 0;
{
int best_dist = 0;
__u32 best_order = 0;
- if (dist == 0) { /* local! use loopback LND */
- peer->nid = *self = LNET_NID_LO_0;
+ if (dist == 0) { /* local! use loopback LND */
+ peer->nid = LNET_NID_LO_0;
+ lnet_nid4_to_nid(peer->nid, self);
best_order = order;
peer->nid = lnet_nid_to_nid4(&dst_nid);
best_order = order;
peer->nid = lnet_nid_to_nid4(&dst_nid);
- *self = lnet_nid_to_nid4(&src_nid);
req->rq_history_seq,
req->rq_export && req->rq_export->exp_obd ?
req->rq_export->exp_obd->obd_name :
req->rq_history_seq,
req->rq_export && req->rq_export->exp_obd ?
req->rq_export->exp_obd->obd_name :
- libcfs_nid2str_r(req->rq_self, nidstr,
- sizeof(nidstr)),
+ libcfs_nidstr_r(&req->rq_self, nidstr,
+ sizeof(nidstr)),
libcfs_id2str(req->rq_peer), req->rq_xid,
req->rq_reqlen, ptlrpc_rqphase2str(req),
(s64)req->rq_arrival_time.tv_sec,
libcfs_id2str(req->rq_peer), req->rq_xid,
req->rq_reqlen, ptlrpc_rqphase2str(req),
(s64)req->rq_arrival_time.tv_sec,
* request, so they are based on the route taken by the
* message.
*/
* request, so they are based on the route taken by the
* message.
*/
- lnet_nid4_to_nid(desc->bd_req->rq_self, &self_nid);
+ self_nid = desc->bd_req->rq_self;
lnet_pid4_to_pid(desc->bd_req->rq_source, &peer_id);
/* NB total length may be 0 for a read past EOF, so we send 0
lnet_pid4_to_pid(desc->bd_req->rq_source, &peer_id);
/* NB total length may be 0 for a read past EOF, so we send 0
ptlrpc_at_set_reply(req, flags);
ptlrpc_at_set_reply(req, flags);
- if (req->rq_export == NULL || req->rq_export->exp_connection == NULL)
- conn = ptlrpc_connection_get(req->rq_peer, req->rq_self, NULL);
- else
- conn = ptlrpc_connection_addref(req->rq_export->exp_connection);
+ if (req->rq_export == NULL || req->rq_export->exp_connection == NULL)
+ conn = ptlrpc_connection_get(req->rq_peer, &req->rq_self, NULL);
+ else
+ conn = ptlrpc_connection_addref(req->rq_export->exp_connection);
if (unlikely(conn == NULL)) {
CERROR("not replying on NULL connection\n"); /* bug 9635 */
if (unlikely(conn == NULL)) {
CERROR("not replying on NULL connection\n"); /* bug 9635 */
rc = ptl_send_buf(&rs->rs_md_h, rs->rs_repbuf, rs->rs_repdata_len,
(rs->rs_difficult && !rs->rs_no_ack) ?
LNET_ACK_REQ : LNET_NOACK_REQ,
rc = ptl_send_buf(&rs->rs_md_h, rs->rs_repbuf, rs->rs_repdata_len,
(rs->rs_difficult && !rs->rs_no_ack) ?
LNET_ACK_REQ : LNET_NOACK_REQ,
- &rs->rs_cb_id, req->rq_self, req->rq_source,
+ &rs->rs_cb_id, lnet_nid_to_nid4(&req->rq_self),
+ req->rq_source,
ptlrpc_req2svc(req)->srv_rep_portal,
req->rq_rep_mbits ? req->rq_rep_mbits : req->rq_xid,
req->rq_reply_off, NULL);
ptlrpc_req2svc(req)->srv_rep_portal,
req->rq_rep_mbits ? req->rq_rep_mbits : req->rq_xid,
req->rq_reply_off, NULL);