lnet_nid_t libcfs_str2nid(const char *str);
int libcfs_str2anynid(lnet_nid_t *nid, const char *str);
char *libcfs_id2str(lnet_process_id_t id);
-void libcfs_setnet0alias(int type);
/* how an LNET NID encodes net:address */
#define LNET_NIDADDR(nid) ((__u32)((nid) & 0xffffffff))
}
#ifdef __KERNEL__
-void
-libcfs_setnet0alias(int lnd)
-{
- struct netstrfns *nf = libcfs_lnd2netstrfns(lnd);
- struct netstrfns *nf0 = &libcfs_netstrfns[libcfs_nnetstrfns - 1];
-
- /* Ghastly hack to allow LNET to inter-operate with portals.
- * NET type 0 becomes an alias for whatever local network we have, and
- * this assignment here means we can parse and print its NIDs */
-
- LASSERT (nf != NULL);
- LASSERT (nf0->nf_type < 0);
-
- nf0->nf_name = "zero";//nf->nf_name;
- nf0->nf_modname = nf->nf_modname;
- nf0->nf_addr2str = nf->nf_addr2str;
- nf0->nf_str2addr = nf->nf_str2addr;
- mb();
- nf0->nf_type = 0;
-}
EXPORT_SYMBOL(libcfs_isknown_lnd);
EXPORT_SYMBOL(libcfs_lnd2modname);
EXPORT_SYMBOL(libcfs_str2nid);
EXPORT_SYMBOL(libcfs_id2str);
EXPORT_SYMBOL(libcfs_str2anynid);
-EXPORT_SYMBOL(libcfs_setnet0alias);
-#else /* __KERNEL__ */
-void
-libcfs_setnet0alias(int lnd)
-{
- LCONSOLE_ERROR_MSG(0x125, "Liblustre cannot interoperate with old "
- "Portals.\nportals_compatibility must be set to "
- "'none'.\n");
-}
+
#endif
Description:
Details :
+Severity : normal
+Bugzilla : 13139
+Description: Remove portals compatibility
+Details : Remove portals compatibility, not interoperable with releases
+ before 1.4.6
+
Severity : major
Bugzilla : 16338
Description: Continuous recovery on 33 of 413 nodes after lustre oss failure
LNET_UNLOCK();
}
-static inline lnet_nid_t
-lnet_ptlcompat_srcnid(lnet_nid_t src, lnet_nid_t dst)
-{
- /* Give myself a portals srcnid if I'm sending to portals */
- if (the_lnet.ln_ptlcompat > 0 &&
- LNET_NIDNET(dst) == 0)
- return LNET_MKNID(0, LNET_NIDADDR(src));
-
- return src;
-}
-
-static inline int
-lnet_ptlcompat_matchnid(lnet_nid_t lnet_nid, lnet_nid_t ptl_nid)
-{
- return ((ptl_nid == lnet_nid) ||
- (the_lnet.ln_ptlcompat > 0 &&
- LNET_NIDNET(ptl_nid) == 0 &&
- LNET_NETTYP(LNET_NIDNET(lnet_nid)) != LOLND &&
- LNET_NIDADDR(ptl_nid) == LNET_NIDADDR(lnet_nid)));
-}
-
-static inline int
-lnet_ptlcompat_matchnet(__u32 lnet_net, __u32 ptl_net)
-{
- return ((ptl_net == lnet_net) ||
- (the_lnet.ln_ptlcompat > 0 &&
- ptl_net == 0 &&
- LNET_NETTYP(lnet_net) != LOLND));
-}
-
static inline struct list_head *
lnet_nid2peerhash (lnet_nid_t nid)
{
__u32 local_ip, __u32 peer_ip, int peer_port);
void lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
__u32 peer_ip, int port);
-int lnet_count_acceptor_nis(lnet_ni_t **first_ni);
-int lnet_accept(lnet_ni_t *blind_ni, cfs_socket_t *sock, __u32 magic);
+int lnet_count_acceptor_nis(void);
int lnet_acceptor_timeout(void);
int lnet_acceptor_port(void);
#endif
#ifdef HAVE_LIBPTHREAD
-int lnet_count_acceptor_nis(lnet_ni_t **first_ni);
+int lnet_count_acceptor_nis(void);
int lnet_acceptor_port(void);
#endif
int ln_refcount; /* LNetNIInit/LNetNIFini counter */
int ln_niinit_self; /* Have I called LNetNIInit myself? */
- int ln_ptlcompat; /* do I support talking to portals? */
-
struct list_head ln_lnds; /* registered LNDs */
#ifdef __KERNEL__
msg->gmm_magic = GMNAL_MSG_MAGIC;
msg->gmm_version = GMNAL_MSG_VERSION;
msg->gmm_type = type;
- msg->gmm_srcnid = lnet_ptlcompat_srcnid(gmni->gmni_ni->ni_nid,
- dstnid);
+ msg->gmm_srcnid = gmni->gmni_ni->ni_nid;
msg->gmm_dstnid = dstnid;
}
return -EPROTO;
}
- if (!lnet_ptlcompat_matchnid(gmni->gmni_ni->ni_nid,
- msg->gmm_dstnid)) {
+ if (gmni->gmni_ni->ni_nid != msg->gmm_dstnid) {
CERROR("Bad dst nid from %u: %s\n",
rx->rx_recv_gmid, libcfs_nid2str(msg->gmm_dstnid));
return -EPROTO;
msg->ibm_credits = credits;
/* ibm_nob */
msg->ibm_cksum = 0;
- msg->ibm_srcnid = lnet_ptlcompat_srcnid(kibnal_data.kib_ni->ni_nid,
- dstnid);
+ msg->ibm_srcnid = kibnal_data.kib_ni->ni_nid;
msg->ibm_srcstamp = kibnal_data.kib_incarnation;
msg->ibm_dstnid = dstnid;
msg->ibm_dststamp = dststamp;
{
int rc;
- if (the_lnet.ln_ptlcompat != 0) {
- LCONSOLE_ERROR_MSG(0x12c, "IIB does not support portals "
- "compatibility mode\n");
- return -ENODEV;
- }
-
rc = kibnal_tunables_init();
if (rc != 0)
return rc;
}
/* mxm_nob */
msg->mxm_cksum = 0;
- msg->mxm_srcnid = lnet_ptlcompat_srcnid(kmxlnd_data.kmx_ni->ni_nid, tx->mxc_nid);
+ msg->mxm_srcnid = kmxlnd_data.kmx_ni->ni_nid;
msg->mxm_srcstamp = kmxlnd_data.kmx_incarnation;
msg->mxm_dstnid = tx->mxc_nid;
/* if it is a new peer, the dststamp will be 0 */
seq = msg->mxm_seq;
if (type != MXLND_MSG_CONN_REQ &&
- (!lnet_ptlcompat_matchnid(rx->mxc_nid, msg->mxm_srcnid) ||
- !lnet_ptlcompat_matchnid(kmxlnd_data.kmx_ni->ni_nid, msg->mxm_dstnid))) {
+ (rx->mxc_nid != msg->mxm_srcnid ||
+ kmxlnd_data.kmx_ni->ni_nid != msg->mxm_dstnid)) {
CDEBUG(D_NETERROR, "rx with mismatched NID (type %s) (my nid is "
"0x%llx and rx msg dst is 0x%llx)\n",
mxlnd_msgtype_to_str(type), kmxlnd_data.kmx_ni->ni_nid,
break;
case MXLND_MSG_CONN_REQ:
- if (!lnet_ptlcompat_matchnid(kmxlnd_data.kmx_ni->ni_nid, msg->mxm_dstnid)) {
+ if (kmxlnd_data.kmx_ni->ni_nid != msg->mxm_dstnid) {
CDEBUG(D_NETERROR, "Can't accept %s: bad dst nid %s\n",
libcfs_nid2str(msg->mxm_srcnid),
libcfs_nid2str(msg->mxm_dstnid));
break;
case MXLND_MSG_CONN_ACK:
- if (!lnet_ptlcompat_matchnid(kmxlnd_data.kmx_ni->ni_nid, msg->mxm_dstnid)) {
+ if (kmxlnd_data.kmx_ni->ni_nid != msg->mxm_dstnid) {
CDEBUG(D_NETERROR, "Can't accept CONN_ACK from %s: "
"bad dst nid %s\n", libcfs_nid2str(msg->mxm_srcnid),
libcfs_nid2str(msg->mxm_dstnid));
msg->ibm_credits = credits;
/* ibm_nob */
msg->ibm_cksum = 0;
- msg->ibm_srcnid = lnet_ptlcompat_srcnid(ni->ni_nid, dstnid);
+ msg->ibm_srcnid = ni->ni_nid;
msg->ibm_srcstamp = net->ibn_incarnation;
msg->ibm_dstnid = dstnid;
msg->ibm_dststamp = dststamp;
msg->ibm_credits = credits;
/* ibm_nob */
msg->ibm_cksum = 0;
- msg->ibm_srcnid = lnet_ptlcompat_srcnid(kibnal_data.kib_ni->ni_nid,
- dstnid);
+ msg->ibm_srcnid = kibnal_data.kib_ni->ni_nid;
msg->ibm_srcstamp = kibnal_data.kib_incarnation;
msg->ibm_dstnid = dstnid;
msg->ibm_dststamp = dststamp;
goto out;
}
- if (!lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg->ibm_dstnid) ||
+ if (kibnal_data.kib_ni->ni_nid != msg->ibm_dstnid ||
msg->ibm_dststamp != kibnal_data.kib_incarnation) {
CERROR("Unexpected dst NID/stamp %s/"LPX64" from "
"%s at %u.%u.%u.%u/%d\n",
goto out;
}
- if (!lnet_ptlcompat_matchnid(peer->ibp_nid, msg->ibm_srcnid)) {
+ if (peer->ibp_nid != msg->ibm_srcnid) {
CERROR("Unexpected src NID %s from %s at %u.%u.%u.%u/%d\n",
libcfs_nid2str(msg->ibm_srcnid),
libcfs_nid2str(peer->ibp_nid),
if (msg->ibm_magic != IBNAL_MSG_MAGIC &&
msg->ibm_magic != __swab32(IBNAL_MSG_MAGIC)) {
/* Unexpected magic! */
- if (the_lnet.ln_ptlcompat == 0) {
- if (msg->ibm_magic == LNET_PROTO_MAGIC ||
- msg->ibm_magic == __swab32(LNET_PROTO_MAGIC)) {
- /* future protocol version compatibility!
- * When LNET unifies protocols over all LNDs,
- * the first thing sent will be a version
- * query. I send back a reply in my current
- * protocol to tell her I'm "old" */
- kibnal_init_msg(msg, 0, 0);
- kibnal_pack_msg(msg, IBNAL_MSG_VERSION, 0,
- LNET_NID_ANY, 0);
- reject = 1;
- goto reply;
- }
-
- CERROR ("Bad magic(1) %#08x (%#08x expected) from "
- "%u.%u.%u.%u/%d\n", msg->ibm_magic,
- IBNAL_MSG_MAGIC, HIPQUAD(peer_ip), peer_port);
- goto out;
- }
-
- /* When portals compatibility is set, I may be passed a new
- * connection "blindly" by the acceptor, and I have to
- * determine if my peer has sent an acceptor connection request
- * or not. */
- rc = lnet_accept(kibnal_data.kib_ni, sock, msg->ibm_magic);
- if (rc != 0)
- goto out;
-
- /* It was an acceptor connection request!
- * Now I should see my magic... */
- rc = libcfs_sock_read(sock, &msg->ibm_magic,
- sizeof(msg->ibm_magic),
- lnet_acceptor_timeout());
- if (rc != 0) {
- CERROR("Error %d receiving svcqry(2) from %u.%u.%u.%u/%d\n",
- rc, HIPQUAD(peer_ip), peer_port);
- goto out;
+ if (msg->ibm_magic == LNET_PROTO_MAGIC ||
+ msg->ibm_magic == __swab32(LNET_PROTO_MAGIC)) {
+ /* future protocol version compatibility! When LNET
+ * unifies protocols over all LNDs, the first thing
+ * sent will be a version query. I send back a reply
+ * in my current protocol to tell her I'm "old" */
+ kibnal_init_msg(msg, 0, 0);
+ kibnal_pack_msg(msg, IBNAL_MSG_VERSION, 0,
+ LNET_NID_ANY, 0);
+ reject = 1;
+ goto reply;
}
- if (msg->ibm_magic != IBNAL_MSG_MAGIC &&
- msg->ibm_magic != __swab32(IBNAL_MSG_MAGIC)) {
- CERROR ("Bad magic(2) %#08x (%#08x expected) from "
- "%u.%u.%u.%u/%d\n", msg->ibm_magic,
- IBNAL_MSG_MAGIC, HIPQUAD(peer_ip), peer_port);
- goto out;
- }
+ CERROR ("Bad magic(1) %#08x (%#08x expected) from "
+ "%u.%u.%u.%u/%d\n", msg->ibm_magic,
+ IBNAL_MSG_MAGIC, HIPQUAD(peer_ip), peer_port);
+ goto out;
}
/* Now check version */
rc = libcfs_sock_read(sock, &msg->ibm_version, sizeof(msg->ibm_version),
lnet_acceptor_timeout());
if (rc != 0) {
- CERROR("Error %d receiving svcqry(3) from %u.%u.%u.%u/%d\n",
+ CERROR("Error %d receiving svcqry(2) from %u.%u.%u.%u/%d\n",
rc, HIPQUAD(peer_ip), peer_port);
goto out;
}
offsetof(kib_msg_t, ibm_type),
lnet_acceptor_timeout());
if (rc != 0) {
- CERROR("Error %d receiving svcqry(4) from %u.%u.%u.%u/%d\n",
+ CERROR("Error %d receiving svcqry(3) from %u.%u.%u.%u/%d\n",
rc, HIPQUAD(peer_ip), peer_port);
goto out;
}
goto out;
}
- if (!lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg->ibm_dstnid)) {
+ if (kibnal_data.kib_ni->ni_nid != msg->ibm_dstnid) {
CERROR("Unexpected dstnid %s: expected %s from %u.%u.%u.%u/%d\n",
libcfs_nid2str(msg->ibm_dstnid),
libcfs_nid2str(kibnal_data.kib_ni->ni_nid),
/* Only complain if we're not rejecting */
CERROR("Error %d replying to svcqry from %u.%u.%u.%u/%d\n",
rc, HIPQUAD(peer_ip), peer_port);
- goto out;
}
out:
#define IBNAL_MSG_MAGIC LNET_PROTO_OPENIB_MAGIC /* unique magic */
#define IBNAL_MSG_VERSION_RDMAREPLYNOTRSRVD 2 /* previous protocol version */
-#define IBNAL_MSG_VERSION 3 /* current protocol version */
+#define IBNAL_MSG_VERSION 3 /* current protocol version */
#define IBNAL_MSG_SVCQRY 0xb0 /* service query */
#define IBNAL_MSG_SVCRSP 0xb1 /* service response */
goto failed;
}
- if (!lnet_ptlcompat_matchnid(conn->ibc_peer->ibp_nid,
- msg->ibm_srcnid) ||
- !lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg->ibm_dstnid) ||
+ if (conn->ibc_peer->ibp_nid != msg->ibm_srcnid ||
+ kibnal_data.kib_ni->ni_nid != msg->ibm_dstnid ||
msg->ibm_srcstamp != conn->ibc_incarnation ||
msg->ibm_dststamp != kibnal_data.kib_incarnation) {
CERROR ("Stale rx from %s\n",
* NB If my incarnation changes after this, the peer will get nuked and
* we'll spot that when the connection is finally added into the peer's
* connlist */
- if (!lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg->ibm_dstnid) ||
+ if (kibnal_data.kib_ni->ni_nid != msg->ibm_dstnid ||
msg->ibm_dststamp != kibnal_data.kib_incarnation) {
write_unlock_irqrestore (&kibnal_data.kib_global_lock, flags);
return TS_IB_CM_CALLBACK_ABORT;
}
- if (!lnet_ptlcompat_matchnid(conn->ibc_peer->ibp_nid,
- msg->ibm_srcnid) ||
- !lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg->ibm_dstnid) ||
+ if (conn->ibc_peer->ibp_nid != msg->ibm_srcnid ||
+ kibnal_data.kib_ni->ni_nid != msg->ibm_dstnid ||
msg->ibm_srcstamp != conn->ibc_incarnation ||
msg->ibm_dststamp != kibnal_data.kib_incarnation) {
CERROR("Stale conn ack from %s\n",
LASSERT (ni->ni_lnd == &the_kqswlnd);
-#if KQSW_CKSUM
- if (the_lnet.ln_ptlcompat != 0) {
- CERROR("Checksumming version not portals compatible\n");
- return -ENODEV;
- }
-#endif
/* Only 1 instance supported */
if (kqswnal_data.kqn_init != KQN_INIT_NOTHING) {
CERROR ("Only 1 instance supported\n");
int krx_npages; /* # pages in receive buffer */
int krx_nob; /* Number Of Bytes received into buffer */
int krx_rpc_reply_needed:1; /* peer waiting for EKC RPC reply */
- int krx_raw_lnet_hdr:1; /* msg is a raw lnet hdr (portals compatible) */
int krx_state; /* what this RX is doing */
atomic_t krx_refcount; /* how to tell when rpc is done */
#if KQSW_CKSUM
switch (ktx->ktx_state) {
case KTX_GETTING:
case KTX_PUTTING:
- if (the_lnet.ln_testprotocompat != 0 &&
- the_lnet.ln_ptlcompat == 0) {
+ if (the_lnet.ln_testprotocompat != 0) {
kqswnal_msg_t *msg = (kqswnal_msg_t *)ktx->ktx_buffer;
/* single-shot proto test:
* ktx_frags[1] and onward with the network addresses
* of the buffer frags. */
- if (the_lnet.ln_ptlcompat == 2) {
- /* Strong portals compatibility: send "raw" LNET
- * header + rdma descriptor */
- mhdr = (lnet_hdr_t *)ktx->ktx_buffer;
- rmd = (kqswnal_remotemd_t *)(mhdr + 1);
- } else {
- /* Send an RDMA message */
- msg->kqm_magic = LNET_PROTO_QSW_MAGIC;
- msg->kqm_version = QSWLND_PROTO_VERSION;
- msg->kqm_type = QSWLND_MSG_RDMA;
+ /* Send an RDMA message */
+ msg->kqm_magic = LNET_PROTO_QSW_MAGIC;
+ msg->kqm_version = QSWLND_PROTO_VERSION;
+ msg->kqm_type = QSWLND_MSG_RDMA;
- mhdr = &msg->kqm_u.rdma.kqrm_hdr;
- rmd = &msg->kqm_u.rdma.kqrm_rmd;
- }
+ mhdr = &msg->kqm_u.rdma.kqrm_hdr;
+ rmd = &msg->kqm_u.rdma.kqrm_rmd;
*mhdr = *hdr;
nob = (((char *)rmd) - ktx->ktx_buffer);
ep_nmd_subset(&ktx->ktx_frags[0], &ktx->ktx_ebuffer, 0, nob);
#if KQSW_CKSUM
- LASSERT (the_lnet.ln_ptlcompat != 2);
msg->kqm_nob = nob + payload_nob;
msg->kqm_cksum = 0;
msg->kqm_cksum = kqswnal_csum(~0, (char *)msg, nob);
char *payload;
kqswnal_msg_t *msg = (kqswnal_msg_t *)ktx->ktx_buffer;
- /* small message: single frag copied into the pre-mapped buffer */
- if (the_lnet.ln_ptlcompat == 2) {
- /* Strong portals compatibility: send "raw" LNET header
- * + payload */
- mhdr = (lnet_hdr_t *)ktx->ktx_buffer;
- payload = (char *)(mhdr + 1);
- } else {
- /* Send an IMMEDIATE message */
- msg->kqm_magic = LNET_PROTO_QSW_MAGIC;
- msg->kqm_version = QSWLND_PROTO_VERSION;
- msg->kqm_type = QSWLND_MSG_IMMEDIATE;
+ /* single frag copied into the pre-mapped buffer */
+ msg->kqm_magic = LNET_PROTO_QSW_MAGIC;
+ msg->kqm_version = QSWLND_PROTO_VERSION;
+ msg->kqm_type = QSWLND_MSG_IMMEDIATE;
- mhdr = &msg->kqm_u.immediate.kqim_hdr;
- payload = msg->kqm_u.immediate.kqim_payload;
- }
+ mhdr = &msg->kqm_u.immediate.kqim_hdr;
+ payload = msg->kqm_u.immediate.kqim_payload;
*mhdr = *hdr;
nob = (payload - ktx->ktx_buffer) + payload_nob;
payload_niov, payload_iov,
payload_offset, payload_nob);
#if KQSW_CKSUM
- LASSERT (the_lnet.ln_ptlcompat != 2);
msg->kqm_nob = nob;
msg->kqm_cksum = 0;
msg->kqm_cksum = kqswnal_csum(~0, (char *)msg, nob);
lnet_hdr_t *mhdr;
kqswnal_msg_t *msg = (kqswnal_msg_t *)ktx->ktx_buffer;
- /* large message: multiple frags: first is hdr in pre-mapped buffer */
- if (the_lnet.ln_ptlcompat == 2) {
- /* Strong portals compatibility: send "raw" LNET header
- * + payload */
- mhdr = (lnet_hdr_t *)ktx->ktx_buffer;
- nob = sizeof(lnet_hdr_t);
- } else {
- /* Send an IMMEDIATE message */
- msg->kqm_magic = LNET_PROTO_QSW_MAGIC;
- msg->kqm_version = QSWLND_PROTO_VERSION;
- msg->kqm_type = QSWLND_MSG_IMMEDIATE;
+ /* multiple frags: first is hdr in pre-mapped buffer */
+ msg->kqm_magic = LNET_PROTO_QSW_MAGIC;
+ msg->kqm_version = QSWLND_PROTO_VERSION;
+ msg->kqm_type = QSWLND_MSG_IMMEDIATE;
- mhdr = &msg->kqm_u.immediate.kqim_hdr;
- nob = offsetof(kqswnal_msg_t,
- kqm_u.immediate.kqim_payload);
- }
+ mhdr = &msg->kqm_u.immediate.kqim_hdr;
+ nob = offsetof(kqswnal_msg_t, kqm_u.immediate.kqim_payload);
*mhdr = *hdr;
LASSERT (atomic_read(&krx->krx_refcount) == 1);
- /* If ln_ptlcompat is set, peers may send me an "old" unencapsulated
- * lnet hdr */
- LASSERT (offsetof(kqswnal_msg_t, kqm_u) <= sizeof(lnet_hdr_t));
-
if (krx->krx_nob < offsetof(kqswnal_msg_t, kqm_u)) {
CERROR("Short message %d received from %s\n",
krx->krx_nob, libcfs_nid2str(fromnid));
goto done;
}
- if (the_lnet.ln_ptlcompat != 0) {
- /* Portals compatibility (strong or weak)
- * This could be an unencapsulated LNET header. If it's big
- * enough, let LNET's parser sort it out */
-
- if (krx->krx_nob < sizeof(lnet_hdr_t)) {
- CERROR("Short portals-compatible message from %s\n",
- libcfs_nid2str(fromnid));
- goto done;
- }
-
- krx->krx_raw_lnet_hdr = 1;
- rc = lnet_parse(ni, (lnet_hdr_t *)msg,
- fromnid, krx, krx->krx_rpc_reply_needed);
- if (rc < 0)
- goto done;
- return;
- }
-
CERROR("Unrecognised magic %08x from %s\n",
msg->kqm_magic, libcfs_nid2str(fromnid));
done:
krx->krx_state = KRX_PARSE;
krx->krx_rxd = rxd;
krx->krx_nob = nob;
- krx->krx_raw_lnet_hdr = 0;
/* RPC reply iff rpc request received without error */
krx->krx_rpc_reply_needed = ep_rxd_isrpc(rxd) &&
if (krx->krx_rpc_reply_needed) {
/* optimized (rdma) request sent as RPC */
- if (krx->krx_raw_lnet_hdr) {
- LASSERT (the_lnet.ln_ptlcompat != 0);
- hdr = (lnet_hdr_t *)msg;
- rmd = kqswnal_get_portalscompat_rmd(krx);
- if (rmd == NULL)
- return (-EPROTO);
- } else {
- LASSERT (msg->kqm_type == QSWLND_MSG_RDMA);
- hdr = &msg->kqm_u.rdma.kqrm_hdr;
- rmd = &msg->kqm_u.rdma.kqrm_rmd;
- }
+ LASSERT (msg->kqm_type == QSWLND_MSG_RDMA);
+ hdr = &msg->kqm_u.rdma.kqrm_hdr;
+ rmd = &msg->kqm_u.rdma.kqrm_rmd;
/* NB header is still in wire byte order */
return rc;
}
- if (krx->krx_raw_lnet_hdr) {
- LASSERT (the_lnet.ln_ptlcompat != 0);
- msg_offset = sizeof(lnet_hdr_t);
- } else {
- LASSERT (msg->kqm_type == QSWLND_MSG_IMMEDIATE);
- msg_offset = offsetof(kqswnal_msg_t, kqm_u.immediate.kqim_payload);
- }
+ LASSERT (msg->kqm_type == QSWLND_MSG_IMMEDIATE);
+ msg_offset = offsetof(kqswnal_msg_t, kqm_u.immediate.kqim_payload);
if (krx->krx_nob < msg_offset + rlen) {
CERROR("Bad message size from %s: have %d, need %d + %d\n",
return;
connreq->racr_devid = conn->rac_device->rad_id;
- connreq->racr_srcnid = lnet_ptlcompat_srcnid(kranal_data.kra_ni->ni_nid,
- dstnid);
+ connreq->racr_srcnid = kranal_data.kra_ni->ni_nid;
connreq->racr_dstnid = dstnid;
connreq->racr_peerstamp = kranal_data.kra_peerstamp;
connreq->racr_connstamp = conn->rac_my_connstamp;
connreq->racr_magic != __swab32(RANAL_MSG_MAGIC)) {
/* Unexpected magic! */
if (!active &&
- the_lnet.ln_ptlcompat == 0 &&
(connreq->racr_magic == LNET_PROTO_MAGIC ||
connreq->racr_magic == __swab32(LNET_PROTO_MAGIC))) {
/* future protocol version compatibility!
return EPROTO;
}
- if (active ||
- the_lnet.ln_ptlcompat == 0) {
- CERROR("Unexpected magic %08x (1)\n",
- connreq->racr_magic);
- return -EPROTO;
- }
-
- /* When portals compatibility is set, I may be passed a new
- * connection "blindly" by the acceptor, and I have to
- * determine if my peer has sent an acceptor connection request
- * or not. This isn't a connreq, so I'll get the acceptor to
- * look at it... */
- rc = lnet_accept(kranal_data.kra_ni, sock, connreq->racr_magic);
- if (rc != 0)
- return -EPROTO;
-
- /* ...and if it's OK I'm back to looking for a connreq... */
- rc = libcfs_sock_read(sock, &connreq->racr_magic,
- sizeof(connreq->racr_magic), timeout);
- if (rc != 0) {
- CERROR("Read(magic) failed(2): %d\n", rc);
- return -EIO;
- }
-
- if (connreq->racr_magic != RANAL_MSG_MAGIC &&
- connreq->racr_magic != __swab32(RANAL_MSG_MAGIC)) {
- CERROR("Unexpected magic %08x(2)\n",
- connreq->racr_magic);
- return -EPROTO;
- }
+ CERROR("Unexpected magic %08x (%s)\n",
+ connreq->racr_magic, active ? "active" : "passive");
+ return -EPROTO;
}
swab = (connreq->racr_magic == __swab32(RANAL_MSG_MAGIC));
/* Refuse connection if peer thinks we are a different NID. We check
* this while holding the global lock, to synch with connection
* destruction on NID change. */
- if (!lnet_ptlcompat_matchnid(kranal_data.kra_ni->ni_nid, dst_nid)) {
+ if (kranal_data.kra_ni->ni_nid != dst_nid) {
write_unlock_irqrestore(&kranal_data.kra_global_lock, flags);
CERROR("Stale/bad connection with %s: dst_nid %s, expected %s\n",
{
/* CAVEAT EMPTOR: this byte flips 'ipaddrs' */
ksock_net_t *net = (ksock_net_t *)ni->ni_data;
- lnet_nid_t srcnid;
LASSERT (0 <= hello->kshm_nips && hello->kshm_nips <= LNET_MAX_INTERFACES);
/* rely on caller to hold a ref on socket so it wouldn't disappear */
LASSERT (conn->ksnc_proto != NULL);
- srcnid = lnet_ptlcompat_srcnid(ni->ni_nid, peer_nid);
-
- hello->kshm_src_nid = srcnid;
+ hello->kshm_src_nid = ni->ni_nid;
hello->kshm_dst_nid = peer_nid;
hello->kshm_src_pid = the_lnet.ln_pid;
hello->kshm_magic != __swab32(LNET_PROTO_MAGIC) &&
hello->kshm_magic != le32_to_cpu (LNET_PROTO_TCP_MAGIC)) {
/* Unexpected magic! */
- if (active ||
- the_lnet.ln_ptlcompat == 0) {
- CERROR ("Bad magic(1) %#08x (%#08x expected) from "
- "%u.%u.%u.%u\n", __cpu_to_le32 (hello->kshm_magic),
- LNET_PROTO_TCP_MAGIC,
- HIPQUAD(conn->ksnc_ipaddr));
- return -EPROTO;
- }
-
- /* When portals compatibility is set, I may be passed a new
- * connection "blindly" by the acceptor, and I have to
- * determine if my peer has sent an acceptor connection request
- * or not. This isn't a 'hello', so I'll get the acceptor to
- * look at it... */
- rc = lnet_accept(ni, sock, hello->kshm_magic);
- if (rc != 0)
- return -EPROTO;
-
- /* ...and if it's OK I'm back to looking for a 'hello'... */
- rc = libcfs_sock_read(sock, &hello->kshm_magic,
- sizeof (hello->kshm_magic), timeout);
- if (rc != 0) {
- CERROR ("Error %d reading HELLO from %u.%u.%u.%u\n",
- rc, HIPQUAD(conn->ksnc_ipaddr));
- LASSERT (rc < 0);
- return rc;
- }
-
- /* Only need to check V1.x magic */
- if (hello->kshm_magic != le32_to_cpu (LNET_PROTO_TCP_MAGIC)) {
- CERROR ("Bad magic(2) %#08x (%#08x expected) from "
- "%u.%u.%u.%u\n", __cpu_to_le32 (hello->kshm_magic),
- LNET_PROTO_TCP_MAGIC,
- HIPQUAD(conn->ksnc_ipaddr));
- return -EPROTO;
- }
+ CERROR ("Bad magic(1) %#08x (%#08x expected) from "
+ "%u.%u.%u.%u\n", __cpu_to_le32 (hello->kshm_magic),
+ LNET_PROTO_TCP_MAGIC,
+ HIPQUAD(conn->ksnc_ipaddr));
+ return -EPROTO;
}
rc = libcfs_sock_read(sock, &hello->kshm_version,
recv_id.nid = LNET_MKNID(LNET_NIDNET(ni->ni_nid), conn->ksnc_ipaddr);
} else {
recv_id.nid = hello->kshm_src_nid;
-
- if (the_lnet.ln_ptlcompat > 1 && /* portals peers may exist */
- LNET_NIDNET(recv_id.nid) == 0) /* this is one */
- recv_id.pid = the_lnet.ln_pid; /* give it a sensible pid */
- else
- recv_id.pid = hello->kshm_src_pid;
-
+ recv_id.pid = hello->kshm_src_pid;
}
if (!active) {
}
if (peerid->pid != recv_id.pid ||
- !lnet_ptlcompat_matchnid(peerid->nid, recv_id.nid)) {
+ peerid->nid != recv_id.nid) {
LCONSOLE_ERROR_MSG(0x130, "Connected successfully to %s on host"
" %u.%u.%u.%u, but they claimed they were "
"%s; please check your Lustre "
msg->ibm_credits = credits;
/* ibm_nob */
msg->ibm_cksum = 0;
- msg->ibm_srcnid = lnet_ptlcompat_srcnid(kibnal_data.kib_ni->ni_nid,
- dstnid);
+ msg->ibm_srcnid = kibnal_data.kib_ni->ni_nid;
msg->ibm_srcstamp = kibnal_data.kib_incarnation;
msg->ibm_dstnid = dstnid;
msg->ibm_dststamp = dststamp;
rx->rx_nob = nob; /* Can trust 'nob' now */
- if (!lnet_ptlcompat_matchnid(conn->ibc_peer->ibp_nid,
- msg->ibm_srcnid) ||
- !lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg->ibm_dstnid) ||
+ if (conn->ibc_peer->ibp_nid != msg->ibm_srcnid ||
+ kibnal_data.kib_ni->ni_nid != msg->ibm_dstnid ||
msg->ibm_srcstamp != conn->ibc_incarnation ||
msg->ibm_dststamp != kibnal_data.kib_incarnation) {
CERROR ("Stale rx from %s\n",
goto reject;
}
- if (!lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- rxmsg.ibm_dstnid)) {
+ if (kibnal_data.kib_ni->ni_nid != rxmsg.ibm_dstnid) {
CERROR("Can't accept %s: bad dst nid %s\n",
libcfs_nid2str(rxmsg.ibm_srcnid),
libcfs_nid2str(rxmsg.ibm_dstnid));
}
read_lock_irqsave(&kibnal_data.kib_global_lock, flags);
- if (lnet_ptlcompat_matchnid(kibnal_data.kib_ni->ni_nid,
- msg.ibm_dstnid) &&
+ if (kibnal_data.kib_ni->ni_nid == msg.ibm_dstnid &&
msg.ibm_dststamp == kibnal_data.kib_incarnation)
rc = 0;
else
CLASSERT (LNET_PROTO_ACCEPTOR_VERSION == 1);
- if (the_lnet.ln_ptlcompat != 2) {
- /* When portals compatibility is "strong", simply
- * connect (i.e. send no acceptor connection request).
- * Othewise send an acceptor connection request. I can
- * have no portals peers so everyone else should
- * understand my protocol. */
- cr.acr_magic = LNET_PROTO_ACCEPTOR_MAGIC;
- cr.acr_version = LNET_PROTO_ACCEPTOR_VERSION;
- cr.acr_nid = peer_nid;
-
- if (the_lnet.ln_testprotocompat != 0) {
- /* single-shot proto check */
- LNET_LOCK();
- if ((the_lnet.ln_testprotocompat & 4) != 0) {
- cr.acr_version++;
- the_lnet.ln_testprotocompat &= ~4;
- }
- if ((the_lnet.ln_testprotocompat & 8) != 0) {
- cr.acr_magic = LNET_PROTO_MAGIC;
- the_lnet.ln_testprotocompat &= ~8;
- }
- LNET_UNLOCK();
+ cr.acr_magic = LNET_PROTO_ACCEPTOR_MAGIC;
+ cr.acr_version = LNET_PROTO_ACCEPTOR_VERSION;
+ cr.acr_nid = peer_nid;
+
+ if (the_lnet.ln_testprotocompat != 0) {
+ /* single-shot proto check */
+ LNET_LOCK();
+ if ((the_lnet.ln_testprotocompat & 4) != 0) {
+ cr.acr_version++;
+ the_lnet.ln_testprotocompat &= ~4;
}
-
- rc = libcfs_sock_write(sock, &cr, sizeof(cr),
- accept_timeout);
- if (rc != 0)
- goto failed_sock;
+ if ((the_lnet.ln_testprotocompat & 8) != 0) {
+ cr.acr_magic = LNET_PROTO_MAGIC;
+ the_lnet.ln_testprotocompat &= ~8;
+ }
+ LNET_UNLOCK();
}
+
+ rc = libcfs_sock_write(sock, &cr, sizeof(cr),
+ accept_timeout);
+ if (rc != 0)
+ goto failed_sock;
*sockp = sock;
return 0;
}
int
-lnet_accept(lnet_ni_t *blind_ni, cfs_socket_t *sock, __u32 magic)
+lnet_accept(cfs_socket_t *sock, __u32 magic)
{
lnet_acceptor_connreq_t cr;
__u32 peer_ip;
lnet_ni_t *ni;
char *str;
- /* CAVEAT EMPTOR: I may be called by an LND in any thread's context if
- * I passed the new socket "blindly" to the single NI that needed an
- * acceptor. If so, blind_ni != NULL... */
-
LASSERT (sizeof(cr) <= 16); /* not too big for the stack */
rc = libcfs_sock_getaddr(sock, 1, &peer_ip, &peer_port);
return -EPERM;
}
- CDEBUG(D_NET, "Accept %s from %u.%u.%u.%u%s\n",
- libcfs_nid2str(cr.acr_nid), HIPQUAD(peer_ip),
- blind_ni == NULL ? "" : " (blind)");
-
- if (blind_ni == NULL) {
- /* called by the acceptor: call into the requested NI... */
- rc = ni->ni_lnd->lnd_accept(ni, sock);
- } else {
- /* portals_compatible set and the (only) NI called me to verify
- * and skip the connection request... */
- LASSERT (the_lnet.ln_ptlcompat != 0);
- LASSERT (ni == blind_ni);
- rc = 0;
- }
+ CDEBUG(D_NET, "Accept %s from %u.%u.%u.%u\n",
+ libcfs_nid2str(cr.acr_nid), HIPQUAD(peer_ip));
+ rc = ni->ni_lnd->lnd_accept(ni, sock);
lnet_ni_decref(ni);
return rc;
}
-EXPORT_SYMBOL(lnet_accept);
int
lnet_acceptor(void *arg)
char name[16];
cfs_socket_t *newsock;
int rc;
- int n_acceptor_nis;
__u32 magic;
__u32 peer_ip;
int peer_port;
- lnet_ni_t *blind_ni = NULL;
int secure = (int)((unsigned long)arg);
LASSERT (lnet_acceptor_state.pta_sock == NULL);
- if (the_lnet.ln_ptlcompat != 0) {
- /* When portals_compatibility is enabled, peers may connect
- * without sending an acceptor connection request. There is no
- * ambiguity about which network the peer wants to connect to
- * since there can only be 1 network, so I pass connections
- * "blindly" to it. */
- n_acceptor_nis = lnet_count_acceptor_nis(&blind_ni);
- LASSERT (n_acceptor_nis == 1);
- LASSERT (blind_ni != NULL);
- }
-
snprintf(name, sizeof(name), "acceptor_%03d", accept_port);
cfs_daemonize(name);
cfs_block_allsigs();
lnet_acceptor_state.pta_sock = NULL;
} else {
- LCONSOLE(0, "Accept %s, port %d%s\n",
- accept, accept_port,
- blind_ni == NULL ? "" : " (proto compatible)");
+ LCONSOLE(0, "Accept %s, port %d\n", accept, accept_port);
}
/* set init status and unblock parent */
goto failed;
}
- if (blind_ni != NULL) {
- rc = blind_ni->ni_lnd->lnd_accept(blind_ni, newsock);
- if (rc != 0) {
- CERROR("NI %s refused 'blind' connection from "
- "%u.%u.%u.%u\n",
- libcfs_nid2str(blind_ni->ni_nid),
- HIPQUAD(peer_ip));
- goto failed;
- }
- continue;
- }
-
rc = libcfs_sock_read(newsock, &magic, sizeof(magic),
accept_timeout);
if (rc != 0) {
goto failed;
}
- rc = lnet_accept(NULL, newsock, magic);
+ rc = lnet_accept(newsock, magic);
if (rc != 0)
goto failed;
libcfs_sock_release(lnet_acceptor_state.pta_sock);
lnet_acceptor_state.pta_sock = NULL;
- if (blind_ni != NULL)
- lnet_ni_decref(blind_ni);
-
- LCONSOLE(0,"Acceptor stopping\n");
+ LCONSOLE(0, "Acceptor stopping\n");
/* unblock lnet_acceptor_stop() */
mutex_up(&lnet_acceptor_state.pta_signal);
return -EINVAL;
}
- if (lnet_count_acceptor_nis(NULL) == 0) /* not required */
+ if (lnet_count_acceptor_nis() == 0) /* not required */
return 0;
pid = cfs_kernel_thread(lnet_acceptor, (void *)secure, 0);
return -EINVAL;
}
- if (lnet_count_acceptor_nis(NULL) == 0) { /* not required */
+ if (lnet_count_acceptor_nis() == 0) { /* not required */
skip_waiting_for_completion = 1;
return 0;
}
CFS_MODULE_PARM(routes, "s", charp, 0444,
"routes to non-local networks");
-static char *portals_compatibility = "none";
-CFS_MODULE_PARM(portals_compatibility, "s", charp, 0444,
- "wire protocol compatibility: 'strong'|'weak'|'none'");
-
char *
lnet_get_routes(void)
{
return "tcp";
}
-int
-lnet_get_portals_compatibility(void)
-{
- if (!strcmp(portals_compatibility, "none")) {
- return 0;
- }
-
- if (!strcmp(portals_compatibility, "weak")) {
- return 1;
- LCONSOLE_WARN("Starting in weak portals-compatible mode\n");
- }
-
- if (!strcmp(portals_compatibility, "strong")) {
- return 2;
- LCONSOLE_WARN("Starting in strong portals-compatible mode\n");
- }
-
- LCONSOLE_ERROR_MSG(0x102, "portals_compatibility=\"%s\" not supported\n",
- portals_compatibility);
- return -EINVAL;
-}
-
void
lnet_init_locks(void)
{
return default_networks;
}
-int
-lnet_get_portals_compatibility(void)
-{
- return 0;
-}
-
# ifndef HAVE_LIBPTHREAD
void lnet_init_locks(void)
list_for_each (tmp, &the_lnet.ln_nis) {
ni = list_entry(tmp, lnet_ni_t, ni_list);
- if (lnet_ptlcompat_matchnet(LNET_NIDNET(ni->ni_nid), net)) {
+ if (LNET_NIDNET(ni->ni_nid) == net) {
lnet_ni_addref_locked(ni);
return ni;
}
list_for_each (tmp, &the_lnet.ln_nis) {
ni = list_entry(tmp, lnet_ni_t, ni_list);
- if (lnet_ptlcompat_matchnid(ni->ni_nid, nid)) {
+ if (ni->ni_nid == nid) {
lnet_ni_addref_locked(ni);
return ni;
}
}
int
-lnet_count_acceptor_nis (lnet_ni_t **first_ni)
+lnet_count_acceptor_nis (void)
{
- /* Return the # of NIs that need the acceptor. Return the first one in
- * *first_ni so the acceptor can pass it connections "blind" to retain
- * binary compatibility. */
+ /* Return the # of NIs that need the acceptor. */
int count = 0;
#if defined(__KERNEL__) || defined(HAVE_LIBPTHREAD)
struct list_head *tmp;
list_for_each (tmp, &the_lnet.ln_nis) {
ni = list_entry(tmp, lnet_ni_t, ni_list);
- if (ni->ni_lnd->lnd_accept != NULL) {
- /* This LND uses the acceptor */
- if (count == 0 && first_ni != NULL) {
- lnet_ni_addref_locked(ni);
- *first_ni = ni;
- }
+ if (ni->ni_lnd->lnd_accept != NULL)
count++;
- }
}
LNET_UNLOCK();
libcfs_nid2str(ni->ni_nid),
ni->ni_peertxcredits, ni->ni_txcredits);
- /* Handle nidstrings for network 0 just like this one */
- if (the_lnet.ln_ptlcompat > 0) {
- if (nicount > 0) {
- LCONSOLE_ERROR_MSG(0x108, "Can't run > 1 "
- "network when portals_compatibility is "
- "set\n");
- goto failed;
- }
- libcfs_setnet0alias(lnd->lnd_type);
- }
-
nicount++;
}
int
LNetInit(void)
{
- int rc;
-
lnet_assert_wire_constants ();
LASSERT (!the_lnet.ln_init);
memset(&the_lnet, 0, sizeof(the_lnet));
- rc = lnet_get_portals_compatibility();
- if (rc < 0)
- return rc;
-
lnet_init_locks();
CFS_INIT_LIST_HEAD(&the_lnet.ln_lnds);
- the_lnet.ln_ptlcompat = rc;
the_lnet.ln_refcount = 0;
the_lnet.ln_init = 1;
(time_t)data->ioc_u64[0]);
case IOC_LIBCFS_PORTALS_COMPATIBILITY:
- return the_lnet.ln_ptlcompat;
+ /* This can be removed once lustre stops calling it */
+ return 0;
case IOC_LIBCFS_LNET_DIST:
rc = LNetDist(data->ioc_nid, &data->ioc_nid, &data->ioc_u32[1]);
goto failed;
}
- if (nnets > 0 &&
- the_lnet.ln_ptlcompat > 0) {
- LCONSOLE_ERROR_MSG(0x114, "Only 1 network supported when"
- " 'portals_compatible' is set\n");
- goto failed;
- }
-
nnets++;
ni = lnet_new_ni(net, nilist);
if (ni == NULL)
*im_a_router = 0;
- if (the_lnet.ln_ptlcompat > 0 &&
- routes[0] != 0) {
- /* Can't route when running in compatibility mode */
- LCONSOLE_ERROR_MSG(0x116, "Route tables are not supported when "
- "'portals_compatible' is set\n");
- return -EINVAL;
- }
-
CFS_INIT_LIST_HEAD(&tbs);
if (lnet_str2tbs_sep(&tbs, routes) < 0) {
LASSERT (src_nid != LNET_NID_ANY);
- if (!msg->msg_routing) {
- src_nid = lnet_ptlcompat_srcnid(src_nid, dst_nid);
+ if (!msg->msg_routing)
msg->msg_hdr.src_nid = cpu_to_le64(src_nid);
- }
if (src_ni == the_lnet.ln_loni) {
/* No send credit hassles with LOLND */
if (!msg->msg_routing) {
/* I'm the source and now I know which NI to send on */
- src_nid = lnet_ptlcompat_srcnid(src_nid, dst_nid);
msg->msg_hdr.src_nid = cpu_to_le64(src_nid);
}
dest_nid = le64_to_cpu(hdr->dest_nid);
payload_length = le32_to_cpu(hdr->payload_length);
- for_me = lnet_ptlcompat_matchnid(ni->ni_nid, dest_nid);
+ for_me = (ni->ni_nid == dest_nid);
switch (type) {
case LNET_MSG_ACK:
* or malicious so we chop them off at the knees :) */
if (!for_me) {
- if (the_lnet.ln_ptlcompat > 0) {
- /* portals compatibility is single-network */
- CERROR ("%s, src %s: Bad dest nid %s "
- "(routing not supported)\n",
- libcfs_nid2str(from_nid),
- libcfs_nid2str(src_nid),
- libcfs_nid2str(dest_nid));
- return -EPROTO;
- }
-
- if (the_lnet.ln_ptlcompat == 0 &&
- LNET_NIDNET(dest_nid) == LNET_NIDNET(ni->ni_nid)) {
+ if (LNET_NIDNET(dest_nid) == LNET_NIDNET(ni->ni_nid)) {
/* should have gone direct */
CERROR ("%s, src %s: Bad dest nid %s "
"(should have been sent direct)\n",
return -EPROTO;
}
- if (the_lnet.ln_ptlcompat == 0 &&
- lnet_islocalnid(dest_nid)) {
+ if (lnet_islocalnid(dest_nid)) {
/* dest is another local NI; sender should have used
* this node's NID on its own network */
CERROR ("%s, src %s: Bad dest nid %s "
list_for_each (e, &the_lnet.ln_nis) {
ni = list_entry(e, lnet_ni_t, ni_list);
- if (ni->ni_nid == dstnid ||
- (the_lnet.ln_ptlcompat > 0 &&
- LNET_NIDNET(dstnid) == 0 &&
- LNET_NIDADDR(dstnid) == LNET_NIDADDR(ni->ni_nid) &&
- LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) != LOLND)) {
+ if (ni->ni_nid == dstnid) {
if (srcnidp != NULL)
*srcnidp = dstnid;
if (orderp != NULL) {
return local_nid_dist_zero ? 0 : 1;
}
- if (LNET_NIDNET(ni->ni_nid) == dstnet ||
- (the_lnet.ln_ptlcompat > 0 &&
- dstnet == 0 &&
- LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) != LOLND)) {
+ if (LNET_NIDNET(ni->ni_nid) == dstnet) {
if (srcnidp != NULL)
*srcnidp = ni->ni_nid;
if (orderp != NULL)
removed cwd "./" (refer to Bugzilla 14399).
Severity : normal
+Bugzilla : 13139
+Description: Remove portals compatibility
+Details : Remove portals compatibility, not interoperable with releases
+ before 1.4.6
+
+Severity : normal
Bugzilla : 15576
Description: Resolve device initialization race
Details : Prevent proc handler from accessing devices added to the