rq_peer in struct ptlrpc_request can now store large NIDs.
ptlrpc_connection_get() and others now take a
struct lnet_processid
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I3bb419720434714301946d278413ce6090aa2cdd
Reviewed-on: https://review.whamcloud.com/44638
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>
/** our LNet NID */
struct lnet_nid rq_self;
/** Peer description (the other side) */
- struct lnet_process_id rq_peer;
+ struct lnet_processid rq_peer;
/** Descriptor for the NID from which the peer sent the request. */
struct lnet_process_id rq_source;
/**
/* ptlrpc/events.c */
extern int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
- struct lnet_process_id *peer,
+ struct lnet_processid *peer,
struct lnet_nid *self,
u32 refnet);
/**
/** @} */
/* ptlrpc/connection.c */
-struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_process_id peer,
+struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_processid *peer,
struct lnet_nid *self,
struct obd_uuid *uuid);
if (rc) {
CERROR("%s: cannot get reverse import %s security: rc = %d\n",
revimp->imp_client->cli_name,
- libcfs_id2str(req->rq_peer), rc);
+ libcfs_idstr(&req->rq_peer), rc);
return rc;
}
bool new_mds_mds_conn = false;
struct obd_connect_data *data, *tmpdata;
int size, tmpsize;
- lnet_nid_t *client_nid = NULL;
+ lnet_nid_t client_nid;
struct ptlrpc_connection *pcon = NULL;
ENTRY;
deuuidify(str, NULL, &target_start, &target_len);
LCONSOLE_ERROR_MSG(0x137,
"%s: not available for connect from %s (no target). If you are running an HA pair check that the target is mounted on the other server.\n",
- str, libcfs_nid2str(req->rq_peer.nid));
+ str, libcfs_nidstr(&req->rq_peer.nid));
GOTO(out, rc = -ENODEV);
}
deuuidify(str, NULL, &target_start, &target_len);
LCONSOLE_INFO("%.*s: Not available for connect from %s (%s)\n",
target_len, target_start,
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
(target->obd_stopping ?
"stopping" : "not set up"));
GOTO(out, rc = -ENODEV);
CDEBUG(D_INFO,
"%s: Temporarily refusing client connection from %s\n",
- target->obd_name, libcfs_nid2str(req->rq_peer.nid));
+ target->obd_name, libcfs_nidstr(&req->rq_peer.nid));
GOTO(out, rc = -EAGAIN);
}
LUSTRE_MINOR, LUSTRE_PATCH,
LUSTRE_FIX, major, minor, patch,
OBD_OCD_VERSION_FIX(data->ocd_version),
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
str);
GOTO(out, rc = -EPROTO);
}
spin_unlock(&export->exp_lock);
LCONSOLE_WARN("%s: Export %p already connecting from %s\n",
export->exp_obd->obd_name, export,
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
class_export_put(export);
export = NULL;
rc = -EALREADY;
} else if ((mds_conn || (lw_client && initial_conn) ||
OCD_HAS_FLAG(data, MDS_MDS)) && export->exp_connection) {
spin_unlock(&export->exp_lock);
- if (req->rq_peer.nid !=
- lnet_nid_to_nid4(&export->exp_connection->c_peer.nid)) {
+ if (!nid_same(&req->rq_peer.nid,
+ &export->exp_connection->c_peer.nid)) {
/* MDS or LWP reconnected after failover. */
LCONSOLE_WARN("%s: Received %s connection from %s, removing former export from %s\n",
target->obd_name,
lw_client ? "LWP" : "MDS",
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
libcfs_nidstr(&export->exp_connection->c_peer.nid));
} else {
/* New connection from the same NID. */
LCONSOLE_WARN("%s: Received new %s connection from %s, %s former export from same NID\n",
target->obd_name,
lw_client ? "LWP" : "MDS",
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
OCD_HAS_FLAG(data, MDS_MDS) ?
"keep" : "remove");
}
- if (req->rq_peer.nid ==
- lnet_nid_to_nid4(&export->exp_connection->c_peer.nid) &&
+ if (nid_same(&req->rq_peer.nid,
+ &export->exp_connection->c_peer.nid) &&
OCD_HAS_FLAG(data, MDS_MDS)) {
/*
* Because exports between MDTs will always be
rc = 0;
}
} else if (export->exp_connection != NULL && initial_conn &&
- req->rq_peer.nid != lnet_nid_to_nid4(&export->exp_connection->c_peer.nid)) {
+ !nid_same(&req->rq_peer.nid,
+ &export->exp_connection->c_peer.nid)) {
spin_unlock(&export->exp_lock);
/* In MDS failover we have static UUID but NID can change. */
LCONSOLE_WARN("%s: Client %s seen on new nid %s when existing nid %s is already connected\n",
target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
libcfs_nidstr(
&export->exp_connection->c_peer.nid));
rc = -EALREADY;
atomic_read(&export->exp_rpc_count) > 0) {
LCONSOLE_WARN("%s: Client %s (at %s) refused connection, still busy with %d references\n",
target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
refcount_read(&export->exp_handle.h_ref));
GOTO(out, rc = -EBUSY);
} else if (lustre_msg_get_conn_cnt(req->rq_reqmsg) == 1 &&
if (!strstr(cluuid.uuid, "mdt"))
LCONSOLE_WARN("%s: Rejecting reconnect from the known client %s (at %s) because it is indicating it is a new client\n",
target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
GOTO(out, rc = -EALREADY);
} else {
OBD_FAIL_TIMEOUT(OBD_FAIL_TGT_DELAY_RECONNECT, 2 * obd_timeout);
GOTO(out, rc);
CDEBUG(D_HA, "%s: connection from %s@%s %st%llu exp %p cur %lld last %lld\n",
- target->obd_name, cluuid.uuid, libcfs_nid2str(req->rq_peer.nid),
+ target->obd_name, cluuid.uuid, libcfs_nidstr(&req->rq_peer.nid),
target->obd_recovering ? "recovering/" : "", data->ocd_transno,
export, ktime_get_seconds(),
export ? export->exp_last_request_time : 0);
/* Tell the client if we support replayable requests. */
if (target->obd_replayable)
lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_REPLAYABLE);
- client_nid = &req->rq_peer.nid;
+ client_nid = lnet_nid_to_nid4(&req->rq_peer.nid);
if (export == NULL) {
/* allow lightweight connections during recovery */
LCONSOLE_WARN("%s: Denying connection for new client %s (at %s), waiting for %d known clients (%d recovered, %d in progress, and %d evicted) %s %lld:%.02lld\n",
target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid), known,
+ libcfs_nidstr(&req->rq_peer.nid), known,
connected - in_progress, in_progress,
stale, msg, timeout / 60, timeout % 60);
rc = -EBUSY;
dont_check_exports:
rc = obd_connect(req->rq_svc_thread->t_env,
&export, target, &cluuid, data,
- client_nid);
+ &client_nid);
if (mds_conn && OBD_FAIL_CHECK(OBD_FAIL_TGT_RCVG_FLAG))
lustre_msg_add_op_flags(req->rq_repmsg,
MSG_CONNECT_RECOVERING);
}
} else {
rc = obd_reconnect(req->rq_svc_thread->t_env,
- export, target, &cluuid, data, client_nid);
+ export, target, &cluuid, data, &client_nid);
}
if (rc)
GOTO(out, rc);
*/
ptlrpc_request_change_export(req, export);
- pcon = ptlrpc_connection_get(req->rq_peer,
+ pcon = ptlrpc_connection_get(&req->rq_peer,
&req->rq_self, &cluuid);
if (pcon == NULL)
GOTO(out, rc = -ENOTCONN);
spin_unlock(&export->exp_lock);
CDEBUG(D_RPCTRACE,
"%s: %s already connected at greater or equal conn_cnt: %d >= %d\n",
- cluuid.uuid, libcfs_nid2str(req->rq_peer.nid),
+ cluuid.uuid, libcfs_nidstr(&req->rq_peer.nid),
export->exp_conn_cnt,
lustre_msg_get_conn_cnt(req->rq_reqmsg));
/* Check to see if connection came from another NID. */
if (export->exp_connection != NULL &&
- lnet_nid_to_nid4(&export->exp_connection->c_peer.nid) !=
- req->rq_peer.nid) {
+ !nid_same(&export->exp_connection->c_peer.nid,
+ &req->rq_peer.nid)) {
obd_nid_del(export->exp_obd, export);
ptlrpc_connection_put(export->exp_connection);
export->exp_connection = NULL;
DEBUG_REQ(D_HA, req,
"remove t%lld from %s because duplicate update records found",
lustre_msg_get_transno(req->rq_reqmsg),
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
/*
* Right now, only for MDS reint operation update replay and
target_send_reply(req, req->rq_status, 0);
} else {
DEBUG_REQ(D_ERROR, req, "wrong opc from %s",
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
}
target_exp_dequeue_req_replay(req);
target_request_copy_put(req);
DEBUG_REQ(D_HA, req, "processing x%llu t%lld from %s",
req->rq_xid,
lustre_msg_get_transno(req->rq_reqmsg),
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
ptlrpc_watchdog_init(&thread->t_watchdog,
WATCHDOG_TIMEOUT);
while ((req = target_next_replay_lock(lut))) {
LASSERT(trd->trd_processing_task == current->pid);
DEBUG_REQ(D_HA, req, "processing lock from %s:",
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_LOCK_REPLAY)) {
req->rq_status = -ENODEV;
target_request_copy_put(req);
while ((req = target_next_final_ping(obd))) {
LASSERT(trd->trd_processing_task == current->pid);
DEBUG_REQ(D_HA, req, "processing final ping from %s:",
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
handle_recovery_req(thread, req,
trd->trd_recovery_handler);
/*
{
DEBUG_REQ((req->rq_no_reply || rc) ? D_WARNING : D_DLMTRACE, req,
"%s, NID=%s lock=%#llx: rc = %d",
- msg, libcfs_id2str(req->rq_peer),
+ msg, libcfs_idstr(&req->rq_peer),
handle ? handle->cookie : 0, rc);
if (req->rq_no_reply)
CWARN("No reply was sent, maybe cause b=21636.\n");
CERROR("%s from %s arrived at %llu with bad export cookie %llu\n",
ll_opcode2str(lustre_msg_get_opc(req->rq_reqmsg)),
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
(unsigned long long)req->rq_arrival_time.tv_sec,
lustre_msg_get_handle(req->rq_reqmsg)->cookie);
CERROR("received replay ack for unknown local cookie %#llx remote cookie %#llx from server %s id %s\n",
aa->lock_handle.cookie, reply->lock_handle.cookie,
req->rq_export->exp_client_uuid.uuid,
- libcfs_id2str(req->rq_peer));
+ libcfs_idstr(&req->rq_peer));
GOTO(out, rc = -ESTALE);
}
struct ptlrpc_user_desc *pud = req->rq_user_desc;
struct lu_ucred *ucred = mdt_ucred(info);
struct lu_nodemap *nodemap;
- lnet_nid_t peernid = req->rq_peer.nid;
+ lnet_nid_t peernid = lnet_nid_to_nid4(&req->rq_peer.nid);
__u32 perm = 0;
int setuid;
int setgid;
return false;
/* 3. Check the permission in the identities. */
- perm = mdt_identity_get_perm(uc->uc_identity,
- mdt_info_req(info)->rq_peer.nid);
+ perm = mdt_identity_get_perm(
+ uc->uc_identity,
+ lnet_nid_to_nid4(&mdt_info_req(info)->rq_peer.nid));
if (perm & CFS_SETGRP_PERM)
return true;
int mdt_check_ucred(struct mdt_thread_info *info)
{
- struct ptlrpc_request *req = mdt_info_req(info);
- struct mdt_device *mdt = info->mti_mdt;
- struct ptlrpc_user_desc *pud = req->rq_user_desc;
- struct lu_ucred *ucred = mdt_ucred(info);
- struct md_identity *identity = NULL;
- lnet_nid_t peernid = req->rq_peer.nid;
- __u32 perm = 0;
- int setuid;
- int setgid;
- int rc = 0;
+ struct ptlrpc_request *req = mdt_info_req(info);
+ struct mdt_device *mdt = info->mti_mdt;
+ struct ptlrpc_user_desc *pud = req->rq_user_desc;
+ struct lu_ucred *ucred = mdt_ucred(info);
+ struct md_identity *identity = NULL;
+ lnet_nid_t peernid = lnet_nid_to_nid4(&req->rq_peer.nid);
+ __u32 perm = 0;
+ int setuid;
+ int setgid;
+ int rc = 0;
- ENTRY;
+ ENTRY;
LASSERT(ucred != NULL);
if ((ucred->uc_valid == UCRED_OLD) || (ucred->uc_valid == UCRED_NEW))
uc->uc_identity = identity;
/* process root_squash here. */
- mdt_root_squash(info, mdt_info_req(info)->rq_peer.nid);
+ mdt_root_squash(info,
+ lnet_nid_to_nid4(&mdt_info_req(info)->rq_peer.nid));
uc->uc_valid = UCRED_OLD;
ucred_set_jobid(info, uc);
LCONSOLE_WARN("%s: Unable to add client %s "
"to file system %s: %d\n",
tgt_name(tsi->tsi_tgt),
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
mgi->mgi_fsname, rc);
} else {
rc = 0;
{
struct ptlrpc_connection *c;
struct lnet_nid self;
- struct lnet_process_id peer;
+ struct lnet_processid peer;
int err;
/*
return NULL;
}
- 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));
};
struct ptlrpc_connection *
-ptlrpc_connection_get(struct lnet_process_id peer4, struct lnet_nid *self,
+ptlrpc_connection_get(struct lnet_processid *peer_orig, struct lnet_nid *self,
struct obd_uuid *uuid)
{
struct ptlrpc_connection *conn, *conn2;
- struct lnet_processid peer;
+ struct lnet_processid peer = *peer_orig;
ENTRY;
- lnet_pid4_to_pid(peer4, &peer);
LNetPrimaryNID(&peer.nid);
conn = rhashtable_lookup_fast(&conn_hash, &peer, conn_hash_params);
if (conn) {
req->rq_reqdata_len = ev->mlength;
ktime_get_real_ts64(&req->rq_arrival_time);
/* Multi-Rail: keep track of both initiator and source NID. */
- req->rq_peer = lnet_pid_to_pid4(&ev->initiator);
+ req->rq_peer = ev->initiator;
req->rq_source = lnet_pid_to_pid4(&ev->source);
req->rq_self = ev->target.nid;
req->rq_rqbd = rqbd;
req, req->rq_xid, ev->mlength);
CDEBUG(D_RPCTRACE, "peer: %s (source: %s)\n",
- libcfs_id2str(req->rq_peer), libcfs_id2str(req->rq_source));
+ libcfs_idstr(&req->rq_peer), libcfs_id2str(req->rq_source));
spin_lock(&svcpt->scp_lock);
}
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
- struct lnet_process_id *peer,
+ struct lnet_processid *peer,
struct lnet_nid *self,
u32 refnet)
{
continue;
if (dist == 0) { /* local! use loopback LND */
- peer->nid = LNET_NID_LO_0;
- lnet_nid4_to_nid(peer->nid, self);
+ lnet_nid4_to_nid(LNET_NID_LO_0, self);
+ peer->nid = *self;
rc = 0;
break;
}
best_dist = dist;
best_order = order;
- peer->nid = lnet_nid_to_nid4(&dst_nid);
+ peer->nid = dst_nid;
*self = src_nid;
rc = 0;
}
}
- CDEBUG(D_NET, "%s->%s\n", uuid->uuid, libcfs_id2str(*peer));
+ CDEBUG(D_NET, "%s->%s\n", uuid->uuid, libcfs_idstr(peer));
return rc;
}
lnet_nid4_to_nid(req->rq_source.nid, &primary);
LNetPrimaryNID(&primary);
rsikey.nid4 = lnet_nid_to_nid4(&primary);
- nodemap_test_nid(req->rq_peer.nid, rsikey.nm_name,
+ nodemap_test_nid(lnet_nid_to_nid4(&req->rq_peer.nid), rsikey.nm_name,
sizeof(rsikey.nm_name));
/* duplicate context handle. for INIT it always 0 */
"krb5") &&
!krb5_allow_old_client_csum) {
CWARN("%s: deny connection from '%s' due to missing 'krb_csum' feature, set 'sptlrpc.gss.krb5_allow_old_client_csum=1' to allow, but recommend client upgrade: rc = %d\n",
- target->obd_name, libcfs_nid2str(req->rq_peer.nid),
+ target->obd_name, libcfs_nidstr(&req->rq_peer.nid),
-EPROTO);
GOTO(out, rc = SECSVC_DROP);
} else {
rsci->target = target;
- CDEBUG(D_SEC, "server create rsc %p(%u->%s)\n",
- rsci, rsci->ctx.gsc_uid, libcfs_nid2str(req->rq_peer.nid));
+ CDEBUG(D_SEC, "server create rsc %p(%u->%s)\n",
+ rsci, rsci->ctx.gsc_uid, libcfs_nidstr(&req->rq_peer.nid));
if (rsip->out_handle.len > PTLRPC_GSS_MAX_HANDLE_SIZE) {
CERROR("handle size %u too large\n", rsip->out_handle.len);
}
struct gss_svc_ctx *gss_svc_upcall_get_ctx(struct ptlrpc_request *req,
- struct gss_wire_ctx *gw)
+ struct gss_wire_ctx *gw)
{
- struct rsc *rsc;
+ struct rsc *rsc;
- rsc = gss_svc_searchbyctx(&gw->gw_handle);
- if (!rsc) {
+ rsc = gss_svc_searchbyctx(&gw->gw_handle);
+ if (!rsc) {
CWARN("Invalid gss ctx idx %#llx from %s\n",
- gss_handle_to_u64(&gw->gw_handle),
- libcfs_nid2str(req->rq_peer.nid));
- return NULL;
- }
+ gss_handle_to_u64(&gw->gw_handle),
+ libcfs_nidstr(&req->rq_peer.nid));
+ return NULL;
+ }
- return &rsc->ctx;
+ return &rsc->ctx;
}
void gss_svc_upcall_put_ctx(struct gss_svc_ctx *ctx)
rs->rs_repdata_len = lustre_msg_size_v2(rs->rs_repbuf->lm_bufcount,
rs->rs_repbuf->lm_buflens);
- CDEBUG(D_SEC, "prepare gss error notify(0x%x/0x%x) to %s\n",
- major, minor, libcfs_nid2str(req->rq_peer.nid));
- RETURN(0);
+ CDEBUG(D_SEC, "prepare gss error notify(0x%x/0x%x) to %s\n",
+ major, minor, libcfs_nidstr(&req->rq_peer.nid));
+ RETURN(0);
}
static
int swabbed, rc;
ENTRY;
- CDEBUG(D_SEC, "processing gss init(%d) request from %s\n", gw->gw_proc,
- libcfs_nid2str(req->rq_peer.nid));
+ CDEBUG(D_SEC, "processing gss init(%d) request from %s\n", gw->gw_proc,
+ libcfs_nidstr(&req->rq_peer.nid));
req->rq_ctx_init = 1;
if (grctx->src_ctx->gsc_usr_mds || grctx->src_ctx->gsc_usr_oss ||
grctx->src_ctx->gsc_usr_root)
CWARN("create svc ctx %p: user from %s authenticated as %s\n",
- grctx->src_ctx, libcfs_nid2str(req->rq_peer.nid),
+ grctx->src_ctx, libcfs_nidstr(&req->rq_peer.nid),
grctx->src_ctx->gsc_usr_root ? "root" :
(grctx->src_ctx->gsc_usr_mds ? "mds" :
(grctx->src_ctx->gsc_usr_oss ? "oss" : "null")));
else
CWARN("create svc ctx %p: accept user %u from %s\n",
grctx->src_ctx, grctx->src_ctx->gsc_uid,
- libcfs_nid2str(req->rq_peer.nid));
+ libcfs_nidstr(&req->rq_peer.nid));
if (gw->gw_flags & LUSTRE_GSS_PACK_USER) {
if (reqbuf->lm_bufcount < 4) {
if (rc == 0)
RETURN(SECSVC_OK);
- CERROR("svc %u failed: major 0x%08x: req xid %llu ctx %p idx "
- "%#llx(%u->%s)\n", gw->gw_svc, major, req->rq_xid,
- grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle),
- grctx->src_ctx->gsc_uid, libcfs_nid2str(req->rq_peer.nid));
+ CERROR("svc %u failed: major 0x%08x: req xid %llu ctx %p idx %#llx(%u->%s)\n",
+ gw->gw_svc, major, req->rq_xid,
+ grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle),
+ grctx->src_ctx->gsc_uid, libcfs_nidstr(&req->rq_peer.nid));
error:
/* we only notify client in case of NO_CONTEXT/BAD_SIG, which
* might happen after server reboot, to allow recovery. */
RETURN(SECSVC_DROP);
CWARN("destroy svc ctx %p idx %#llx (%u->%s)\n",
- grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle),
- grctx->src_ctx->gsc_uid, libcfs_nid2str(req->rq_peer.nid));
+ grctx->src_ctx, gss_handle_to_u64(&gw->gw_handle),
+ grctx->src_ctx->gsc_uid, libcfs_nidstr(&req->rq_peer.nid));
gss_svc_upcall_destroy_ctx(grctx->src_ctx);
req->rq_export->exp_obd->obd_name :
libcfs_nidstr_r(&req->rq_self, nidstr,
sizeof(nidstr)),
- libcfs_id2str(req->rq_peer), req->rq_xid,
+ libcfs_idstr(&req->rq_peer), req->rq_xid,
req->rq_reqlen, ptlrpc_rqphase2str(req),
(s64)req->rq_arrival_time.tv_sec,
(s64)(req->rq_arrival_time.tv_nsec / NSEC_PER_USEC),
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);
+ conn = ptlrpc_connection_get(&req->rq_peer, &req->rq_self,
+ NULL);
else
conn = ptlrpc_connection_addref(req->rq_export->exp_connection);
/**
* rhashtable operations for nrs_crrn_net::cn_cli_hash
*
- * This uses ptlrpc_request::rq_peer.nid as its key, in order to hash
+ * This uses ptlrpc_request::rq_peer.nid (as nid4) as its key, in order to hash
* nrs_crrn_client objects.
*/
static u32 nrs_crrn_hashfn(const void *data, u32 len, u32 seed)
struct nrs_crrn_client *cli;
struct nrs_crrn_client *tmp;
struct ptlrpc_request *req;
+ lnet_nid_t nid4;
if (parent == NULL) {
*resp = &((struct nrs_crrn_net *)policy->pol_private)->cn_res;
net = container_of(parent, struct nrs_crrn_net, cn_res);
req = container_of(nrq, struct ptlrpc_request, rq_nrq);
-
- cli = rhashtable_lookup_fast(&net->cn_cli_hash, &req->rq_peer.nid,
+ nid4 = lnet_nid_to_nid4(&req->rq_peer.nid);
+ cli = rhashtable_lookup_fast(&net->cn_cli_hash, &nid4,
nrs_crrn_hash_params);
if (cli)
goto out;
if (cli == NULL)
return -ENOMEM;
- cli->cc_nid = req->rq_peer.nid;
+ cli->cc_nid = nid4;
atomic_set(&cli->cc_ref, 0);
CDEBUG(D_RPCTRACE,
"NRS: starting to handle %s request from %s, with round "
"%llu\n", NRS_POL_NAME_CRRN,
- libcfs_id2str(req->rq_peer), nrq->nr_u.crr.cr_round);
+ libcfs_idstr(&req->rq_peer), nrq->nr_u.crr.cr_round);
/** Peek at the next request to be served */
node = binheap_root(net->cn_binheap);
CDEBUG(D_RPCTRACE,
"NRS: finished handling %s request from %s, with round %llu"
"\n", NRS_POL_NAME_CRRN,
- libcfs_id2str(req->rq_peer), nrq->nr_u.crr.cr_round);
+ libcfs_idstr(&req->rq_peer), nrq->nr_u.crr.cr_round);
}
/**
DEBUG_REQ(D_RPCTRACE, req,
"NRS: finished delayed request from %s after %llds",
- libcfs_id2str(req->rq_peer),
+ libcfs_idstr(&req->rq_peer),
(s64)(nrq->nr_u.delay.req_start_time -
req->rq_srv.sr_arrival_time.tv_sec));
}
CDEBUG(D_RPCTRACE, "NRS start %s request from %s, seq: %llu"
"\n", policy->pol_desc->pd_name,
- libcfs_id2str(req->rq_peer), nrq->nr_u.fifo.fr_sequence);
+ libcfs_idstr(&req->rq_peer), nrq->nr_u.fifo.fr_sequence);
}
return nrq;
rq_nrq);
CDEBUG(D_RPCTRACE, "NRS stop %s request from %s, seq: %llu\n",
- policy->pol_desc->pd_name, libcfs_id2str(req->rq_peer),
+ policy->pol_desc->pd_name, libcfs_idstr(&req->rq_peer),
nrq->nr_u.fifo.fr_sequence);
}
/**
* libcfs_hash operations for nrs_tbf_net::cn_cli_hash
*
- * This uses ptlrpc_request::rq_peer.nid as its key, in order to hash
+ * This uses ptlrpc_request::rq_peer.nid (as nid4) as its key, in order to hash
* nrs_tbf_client objects.
*/
#define NRS_TBF_NID_BKT_BITS 8
nrs_tbf_nid_cli_find(struct nrs_tbf_head *head,
struct ptlrpc_request *req)
{
- return cfs_hash_lookup(head->th_cli_hash, &req->rq_peer.nid);
+ lnet_nid_t nid4 = lnet_nid_to_nid4(&req->rq_peer.nid);
+
+ return cfs_hash_lookup(head->th_cli_hash, &nid4);
}
static struct nrs_tbf_client *
nrs_tbf_nid_cli_init(struct nrs_tbf_client *cli,
struct ptlrpc_request *req)
{
- cli->tc_nid = req->rq_peer.nid;
+ cli->tc_nid = lnet_nid_to_nid4(&req->rq_peer.nid);
}
static int nrs_tbf_nid_rule_init(struct ptlrpc_nrs_policy *policy,
jobid = NRS_TBF_JOBID_NULL;
snprintf(keystr, keystr_sz, "%s_%s_%d_%u_%u", jobid,
- libcfs_nid2str(req->rq_peer.nid), opc, id.ti_uid,
+ libcfs_nidstr(&req->rq_peer.nid), opc, id.ti_uid,
id.ti_gid);
if (cli) {
INIT_LIST_HEAD(&cli->tc_lru);
strlcpy(cli->tc_key, keystr, sizeof(cli->tc_key));
strlcpy(cli->tc_jobid, jobid, sizeof(cli->tc_jobid));
- cli->tc_nid = req->rq_peer.nid;
+ cli->tc_nid = lnet_nid_to_nid4(&req->rq_peer.nid);
cli->tc_opcode = opc;
cli->tc_id = id;
}
assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
CDEBUG(D_RPCTRACE, "NRS stop %s request from %s, seq: %llu\n",
- policy->pol_desc->pd_name, libcfs_id2str(req->rq_peer),
+ policy->pol_desc->pd_name, libcfs_idstr(&req->rq_peer),
nrq->nr_u.tbf.tr_sequence);
}
break;
default:
CERROR("error unpacking request from %s x%llu\n",
- libcfs_id2str(req->rq_peer), req->rq_xid);
+ libcfs_idstr(&req->rq_peer), req->rq_xid);
RETURN(SECSVC_DROP);
}
rc = ptlrpc_unpack_req_msg(req, req->rq_reqlen);
if (rc != 0) {
CERROR("error unpacking request: ptl %d from %s x%llu\n",
- svc->srv_req_portal, libcfs_id2str(req->rq_peer),
+ svc->srv_req_portal, libcfs_idstr(&req->rq_peer),
req->rq_xid);
goto err_req;
}
rc = lustre_unpack_req_ptlrpc_body(req, MSG_PTLRPC_BODY_OFF);
if (rc) {
CERROR("error unpacking ptlrpc body: ptl %d from %s x %llu\n",
- svc->srv_req_portal, libcfs_id2str(req->rq_peer),
+ svc->srv_req_portal, libcfs_idstr(&req->rq_peer),
req->rq_xid);
goto err_req;
}
if (lustre_msg_get_type(req->rq_reqmsg) != PTL_RPC_MSG_REQUEST) {
CERROR("wrong packet type received (type=%u) from %s\n",
lustre_msg_get_type(req->rq_reqmsg),
- libcfs_id2str(req->rq_peer));
+ libcfs_idstr(&req->rq_peer));
goto err_req;
}
if (ktime_get_real_seconds() > request->rq_deadline) {
DEBUG_REQ(D_ERROR, request,
"Dropping timed-out request from %s: deadline %lld/%llds ago",
- libcfs_id2str(request->rq_peer),
+ libcfs_idstr(&request->rq_peer),
request->rq_deadline -
request->rq_arrival_time.tv_sec,
ktime_get_real_seconds() - request->rq_deadline);
(request->rq_export ?
refcount_read(&request->rq_export->exp_handle.h_ref) : -99),
lustre_msg_get_status(request->rq_reqmsg), request->rq_xid,
- libcfs_id2str(request->rq_peer),
+ libcfs_idstr(&request->rq_peer),
lustre_msg_get_opc(request->rq_reqmsg),
lustre_msg_get_jobid(request->rq_reqmsg) ?: "");
refcount_read(&request->rq_export->exp_handle.h_ref) : -99),
lustre_msg_get_status(request->rq_reqmsg),
request->rq_xid,
- libcfs_id2str(request->rq_peer),
+ libcfs_idstr(&request->rq_peer),
lustre_msg_get_opc(request->rq_reqmsg),
lustre_msg_get_jobid(request->rq_reqmsg) ?: "",
timediff_usecs,
if (unlikely(s->tos_hs == NULL)) {
if (!printed) {
CERROR("%s: no handler for opcode 0x%x from %s\n",
- tgt_name(tgt), opc, libcfs_id2str(req->rq_peer));
+ tgt_name(tgt), opc, libcfs_idstr(&req->rq_peer));
printed = true;
}
goto err_unsupported;
GOTO(handle_recov, rc = 0);
}
CDEBUG(D_HA, "operation %d on unconnected OST from %s\n",
- opc, libcfs_id2str(req->rq_peer));
+ opc, libcfs_idstr(&req->rq_peer));
req->rq_status = -ENOTCONN;
rc = ptlrpc_error(req);
GOTO(out, rc);
read_lock(&tgt->lut_sptlrpc_lock);
sptlrpc_target_choose_flavor(&tgt->lut_sptlrpc_rset,
req->rq_sp_from,
- req->rq_peer.nid,
+ lnet_nid_to_nid4(&req->rq_peer.nid),
&flvr);
read_unlock(&tgt->lut_sptlrpc_lock);
CERROR("%s: unauthorized rpc flavor %x from %s, "
"expect %x\n", tgt_name(tgt),
req->rq_flvr.sf_rpc,
- libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nidstr(&req->rq_peer.nid),
exp->exp_flvr.sf_rpc);
rc = -EACCES;
}
static int check_read_checksum(struct niobuf_local *local_nb, int npages,
struct obd_export *exp, struct obdo *oa,
- const struct lnet_process_id *peer,
+ const struct lnet_processid *peer,
__u32 client_cksum, __u32 server_cksum,
enum cksum_types server_cksum_type)
{
DFID " object "DOSTID" extent [%llu-%llu], client returned csum"
" %x (type %x), server csum %x (type %x)\n",
exp->exp_obd->obd_name,
- msg, libcfs_nid2str(peer->nid),
+ msg, libcfs_nidstr(&peer->nid),
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : 0ULL,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) {
no_reply = 1;
CERROR("Dropping timed-out read from %s because locking object " DOSTID " took %lld seconds (limit was %lld).\n",
- libcfs_id2str(req->rq_peer), POSTID(&ioo->ioo_oid),
+ libcfs_idstr(&req->rq_peer), POSTID(&ioo->ioo_oid),
ktime_get_real_seconds() - req->rq_arrival_time.tv_sec,
req->rq_deadline - req->rq_arrival_time.tv_sec);
GOTO(out_lock, rc = -ETIMEDOUT);
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
LASSERT(body != NULL);
- if (desc && req->rq_peer.nid != desc->bd_sender) {
+ if (desc && lnet_nid_to_nid4(&req->rq_peer.nid) != desc->bd_sender) {
via = " via ";
router = libcfs_nid2str(desc->bd_sender);
}
LCONSOLE_ERROR_MSG(0x168, "%s: BAD WRITE CHECKSUM: from %s%s%s inode "
DFID" object "DOSTID" extent [%llu-%llu"
"]: client csum %x, server csum %x\n",
- exp->exp_obd->obd_name, libcfs_id2str(req->rq_peer),
+ exp->exp_obd->obd_name, libcfs_idstr(&req->rq_peer),
via, router,
body->oa.o_valid & OBD_MD_FLFID ?
body->oa.o_parent_seq : (__u64)0,
OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) {
no_reply = true;
CERROR("%s: Dropping timed-out write from %s because locking object " DOSTID " took %lld seconds (limit was %lld).\n",
- tgt_name(tsi->tsi_tgt), libcfs_id2str(req->rq_peer),
+ tgt_name(tsi->tsi_tgt), libcfs_idstr(&req->rq_peer),
POSTID(&ioo->ioo_oid),
ktime_get_real_seconds() - req->rq_arrival_time.tv_sec,
req->rq_deadline - req->rq_arrival_time.tv_sec);
} else if ((cksum_counter & (-cksum_counter)) ==
cksum_counter) {
CDEBUG(D_INFO, "Checksum %u from %s OK: %x\n",
- cksum_counter, libcfs_id2str(req->rq_peer),
+ cksum_counter, libcfs_idstr(&req->rq_peer),
repbody->oa.o_cksum);
}
}
struct lu_target *tgt = class_exp2tgt(exp);
struct tgt_session_info *tsi = tgt_ses_info(env);
struct ptlrpc_request *req = tgt_ses_req(tsi);
- struct lnet_nid nid;
if (exp_connect_flags(exp) & OBD_CONNECT_MDS ||
exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS)
return 0;
if (!req)
return 0;
- lnet_nid4_to_nid(req->rq_peer.nid, &nid);
- if (!LNetIsPeerLocal(&nid))
+ if (!LNetIsPeerLocal(&req->rq_peer.nid))
return 0;
return 1;