From: isaac Date: Fri, 1 Aug 2008 02:35:40 +0000 (+0000) Subject: b=13139,i=liangzhen,i=maxim: X-Git-Tag: v1_9_50~95 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5c61559c099f9343a36886f4746ac966e4b4b70f b=13139,i=liangzhen,i=maxim: - removed portals compatibility (not interoperable with releases before 1.4.6. --- diff --git a/libcfs/include/libcfs/libcfs_private.h b/libcfs/include/libcfs/libcfs_private.h index ff52d87..1caf5be 100644 --- a/libcfs/include/libcfs/libcfs_private.h +++ b/libcfs/include/libcfs/libcfs_private.h @@ -303,7 +303,6 @@ __u32 libcfs_str2net(const char *str); 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)) diff --git a/libcfs/libcfs/nidstrings.c b/libcfs/libcfs/nidstrings.c index a733b29..e26b2789 100644 --- a/libcfs/libcfs/nidstrings.c +++ b/libcfs/libcfs/nidstrings.c @@ -515,26 +515,6 @@ libcfs_str2anynid(lnet_nid_t *nidp, const char *str) } #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); @@ -546,13 +526,5 @@ EXPORT_SYMBOL(libcfs_str2net); 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 diff --git a/lnet/ChangeLog b/lnet/ChangeLog index 1b1c107..480282c 100644 --- a/lnet/ChangeLog +++ b/lnet/ChangeLog @@ -17,6 +17,12 @@ Bugzilla : 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 diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 7e320f4..8d4b362 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -481,36 +481,6 @@ lnet_ni_decref(lnet_ni_t *ni) 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) { @@ -680,14 +650,13 @@ int lnet_connect(cfs_socket_t **sockp, lnet_nid_t peer_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 diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index cf27c58..2060f92 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -494,8 +494,6 @@ typedef struct 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__ diff --git a/lnet/klnds/gmlnd/gmlnd_comm.c b/lnet/klnds/gmlnd/gmlnd_comm.c index 86eef31..b3d48be 100644 --- a/lnet/klnds/gmlnd/gmlnd_comm.c +++ b/lnet/klnds/gmlnd/gmlnd_comm.c @@ -63,8 +63,7 @@ gmnal_pack_msg(gmnal_ni_t *gmni, gmnal_msg_t *msg, 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; } @@ -127,8 +126,7 @@ gmnal_unpack_msg(gmnal_ni_t *gmni, gmnal_rx_t *rx) 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; diff --git a/lnet/klnds/iiblnd/iiblnd.c b/lnet/klnds/iiblnd/iiblnd.c index 3719efc..a2c2b96 100644 --- a/lnet/klnds/iiblnd/iiblnd.c +++ b/lnet/klnds/iiblnd/iiblnd.c @@ -85,8 +85,7 @@ kibnal_pack_msg(kib_msg_t *msg, __u32 version, int credits, 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; @@ -2149,12 +2148,6 @@ kibnal_module_init (void) { 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; diff --git a/lnet/klnds/mxlnd/mxlnd_cb.c b/lnet/klnds/mxlnd/mxlnd_cb.c index f603a6e..86b4f21 100644 --- a/lnet/klnds/mxlnd/mxlnd_cb.c +++ b/lnet/klnds/mxlnd/mxlnd_cb.c @@ -855,7 +855,7 @@ mxlnd_pack_msg(struct kmx_ctx *tx) } /* 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 */ @@ -2924,8 +2924,8 @@ mxlnd_handle_rx_completion(struct kmx_ctx *rx) 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, @@ -3016,7 +3016,7 @@ mxlnd_handle_rx_completion(struct kmx_ctx *rx) 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)); @@ -3114,7 +3114,7 @@ mxlnd_handle_rx_completion(struct kmx_ctx *rx) 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)); diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 9f0f7a1..3aea97a 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -86,7 +86,7 @@ kiblnd_pack_msg (lnet_ni_t *ni, kib_msg_t *msg, 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; diff --git a/lnet/klnds/openiblnd/openiblnd.c b/lnet/klnds/openiblnd/openiblnd.c index 6bfb717..8e8fe4d 100644 --- a/lnet/klnds/openiblnd/openiblnd.c +++ b/lnet/klnds/openiblnd/openiblnd.c @@ -90,8 +90,7 @@ kibnal_pack_msg(kib_msg_t *msg, int version, int credits, 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; @@ -335,8 +334,7 @@ kibnal_make_svcqry (kib_conn_t *conn) 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", @@ -347,7 +345,7 @@ kibnal_make_svcqry (kib_conn_t *conn) 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), @@ -401,53 +399,23 @@ kibnal_handle_svcqry (struct socket *sock) 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 */ @@ -455,7 +423,7 @@ kibnal_handle_svcqry (struct socket *sock) 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; } @@ -478,7 +446,7 @@ kibnal_handle_svcqry (struct socket *sock) 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; } @@ -496,8 +464,7 @@ kibnal_handle_svcqry (struct socket *sock) 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), @@ -524,7 +491,6 @@ kibnal_handle_svcqry (struct socket *sock) /* 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: diff --git a/lnet/klnds/openiblnd/openiblnd.h b/lnet/klnds/openiblnd/openiblnd.h index 46b3502..7c27077 100644 --- a/lnet/klnds/openiblnd/openiblnd.h +++ b/lnet/klnds/openiblnd/openiblnd.h @@ -346,7 +346,7 @@ typedef struct #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 */ diff --git a/lnet/klnds/openiblnd/openiblnd_cb.c b/lnet/klnds/openiblnd/openiblnd_cb.c index 7e56807..737b32e 100644 --- a/lnet/klnds/openiblnd/openiblnd_cb.c +++ b/lnet/klnds/openiblnd/openiblnd_cb.c @@ -320,10 +320,8 @@ kibnal_rx_callback (struct ib_cq_entry *e) 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", @@ -1817,8 +1815,7 @@ kibnal_accept_connreq (kib_conn_t **connp, tTS_IB_CM_COMM_ID cid, * 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); @@ -2081,10 +2078,8 @@ kibnal_active_conn_callback (tTS_IB_CM_EVENT event, 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", diff --git a/lnet/klnds/qswlnd/qswlnd.c b/lnet/klnds/qswlnd/qswlnd.c index 0e2f652..b4b8179 100644 --- a/lnet/klnds/qswlnd/qswlnd.c +++ b/lnet/klnds/qswlnd/qswlnd.c @@ -269,12 +269,6 @@ kqswnal_startup (lnet_ni_t *ni) 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"); diff --git a/lnet/klnds/qswlnd/qswlnd.h b/lnet/klnds/qswlnd/qswlnd.h index 6c43950..be93372 100644 --- a/lnet/klnds/qswlnd/qswlnd.h +++ b/lnet/klnds/qswlnd/qswlnd.h @@ -191,7 +191,6 @@ typedef struct kqswnal_rx 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 diff --git a/lnet/klnds/qswlnd/qswlnd_cb.c b/lnet/klnds/qswlnd/qswlnd_cb.c index a018dc9..ff50456 100644 --- a/lnet/klnds/qswlnd/qswlnd_cb.c +++ b/lnet/klnds/qswlnd/qswlnd_cb.c @@ -620,8 +620,7 @@ kqswnal_launch (kqswnal_tx_t *ktx) 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: @@ -1056,20 +1055,13 @@ kqswnal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) * 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); @@ -1105,7 +1097,6 @@ kqswnal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) 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); @@ -1152,21 +1143,13 @@ kqswnal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) 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; @@ -1182,7 +1165,6 @@ kqswnal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) 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); @@ -1195,22 +1177,13 @@ kqswnal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) 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; @@ -1358,10 +1331,6 @@ kqswnal_parse (kqswnal_rx_t *krx) 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)); @@ -1517,25 +1486,6 @@ kqswnal_parse (kqswnal_rx_t *krx) 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: @@ -1559,7 +1509,6 @@ kqswnal_rxhandler(EP_RXD *rxd) 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) && @@ -1624,17 +1573,9 @@ kqswnal_recv (lnet_ni_t *ni, 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 */ @@ -1684,13 +1625,8 @@ kqswnal_recv (lnet_ni_t *ni, 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", diff --git a/lnet/klnds/ralnd/ralnd.c b/lnet/klnds/ralnd/ralnd.c index 12ed6be..760469a 100644 --- a/lnet/klnds/ralnd/ralnd.c +++ b/lnet/klnds/ralnd/ralnd.c @@ -70,8 +70,7 @@ kranal_pack_connreq(kra_connreq_t *connreq, kra_conn_t *conn, lnet_nid_t dstnid) 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; @@ -102,7 +101,6 @@ kranal_recv_connreq(struct socket *sock, kra_connreq_t *connreq, int active) 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! @@ -112,36 +110,9 @@ kranal_recv_connreq(struct socket *sock, kra_connreq_t *connreq, int active) 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)); @@ -746,7 +717,7 @@ kranal_conn_handshake (struct socket *sock, kra_peer_t *peer) /* 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", diff --git a/lnet/klnds/socklnd/socklnd_cb.c b/lnet/klnds/socklnd/socklnd_cb.c index 85e687a..318a4b9 100644 --- a/lnet/klnds/socklnd/socklnd_cb.c +++ b/lnet/klnds/socklnd/socklnd_cb.c @@ -2101,16 +2101,13 @@ ksocknal_send_hello (lnet_ni_t *ni, ksock_conn_t *conn, { /* 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; @@ -2173,42 +2170,11 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, 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, @@ -2268,13 +2234,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, 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) { @@ -2293,7 +2253,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, } 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 " diff --git a/lnet/klnds/viblnd/viblnd.c b/lnet/klnds/viblnd/viblnd.c index 63ec5b6..a73eca7 100644 --- a/lnet/klnds/viblnd/viblnd.c +++ b/lnet/klnds/viblnd/viblnd.c @@ -203,8 +203,7 @@ kibnal_pack_msg(kib_msg_t *msg, __u32 version, int credits, 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; diff --git a/lnet/klnds/viblnd/viblnd_cb.c b/lnet/klnds/viblnd/viblnd_cb.c index 44c4718..8ebb739 100644 --- a/lnet/klnds/viblnd/viblnd_cb.c +++ b/lnet/klnds/viblnd/viblnd_cb.c @@ -485,10 +485,8 @@ kibnal_rx_complete (kib_rx_t *rx, vv_comp_status_t vvrc, int nob, __u64 rxseq) 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", @@ -2428,8 +2426,7 @@ kibnal_recv_connreq(cm_cep_handle_t *cep, cm_request_data_t *cmreq) 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)); @@ -2888,8 +2885,7 @@ kibnal_check_connreply (kib_conn_t *conn) } 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 diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c index 27a58ff..cadd36f 100644 --- a/lnet/lnet/acceptor.c +++ b/lnet/lnet/acceptor.c @@ -161,35 +161,28 @@ lnet_connect(cfs_socket_t **sockp, lnet_nid_t peer_nid, 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; @@ -214,7 +207,7 @@ lnet_accept_magic(__u32 magic, __u32 constant) } 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; @@ -224,10 +217,6 @@ lnet_accept(lnet_ni_t *blind_ni, cfs_socket_t *sock, __u32 magic) 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); @@ -337,25 +326,13 @@ lnet_accept(lnet_ni_t *blind_ni, cfs_socket_t *sock, __u32 magic) 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) @@ -363,26 +340,13 @@ 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(); @@ -401,9 +365,7 @@ lnet_acceptor(void *arg) 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 */ @@ -437,18 +399,6 @@ lnet_acceptor(void *arg) 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) { @@ -457,7 +407,7 @@ lnet_acceptor(void *arg) goto failed; } - rc = lnet_accept(NULL, newsock, magic); + rc = lnet_accept(newsock, magic); if (rc != 0) goto failed; @@ -470,10 +420,7 @@ lnet_acceptor(void *arg) 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); @@ -501,7 +448,7 @@ lnet_acceptor_start(void) 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); @@ -817,7 +764,7 @@ lnet_acceptor_start(void) 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; } diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index e2bfe89..9408f69 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -59,10 +59,6 @@ static char *routes = ""; 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) { @@ -92,28 +88,6 @@ lnet_get_networks(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) { @@ -195,12 +169,6 @@ lnet_get_networks (void) return default_networks; } -int -lnet_get_portals_compatibility(void) -{ - return 0; -} - # ifndef HAVE_LIBPTHREAD void lnet_init_locks(void) @@ -811,7 +779,7 @@ lnet_net2ni_locked (__u32 net) 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; } @@ -843,7 +811,7 @@ lnet_nid2ni_locked (lnet_nid_t nid) 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; } @@ -867,11 +835,9 @@ lnet_islocalnid (lnet_nid_t nid) } 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; @@ -881,14 +847,8 @@ lnet_count_acceptor_nis (lnet_ni_t **first_ni) 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(); @@ -1123,17 +1083,6 @@ lnet_startup_lndnis (void) 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++; } @@ -1162,20 +1111,13 @@ lnet_startup_lndnis (void) 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; @@ -1355,7 +1297,8 @@ LNetCtl(unsigned int cmd, void *arg) (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]); diff --git a/lnet/lnet/config.c b/lnet/lnet/config.c index 70cd67e..da39bef 100644 --- a/lnet/lnet/config.c +++ b/lnet/lnet/config.c @@ -239,13 +239,6 @@ lnet_parse_networks(struct list_head *nilist, char *networks) 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) @@ -728,14 +721,6 @@ lnet_parse_routes (char *routes, int *im_a_router) *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) { diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 3df4ee8..8a66ba7 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1232,10 +1232,8 @@ lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg) 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 */ @@ -1309,7 +1307,6 @@ lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg) 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); } @@ -1971,7 +1968,7 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_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: @@ -2011,18 +2008,7 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, * 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", @@ -2032,8 +2018,7 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, 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 " @@ -2479,11 +2464,7 @@ LNetDist (lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp) 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) { @@ -2497,10 +2478,7 @@ LNetDist (lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp) 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) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index e1ab172..8d9fd29 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -13,6 +13,12 @@ tbd Sun Microsystems, Inc. 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