Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lnet / klnds / mxlnd / mxlnd_cb.c
index 535f547..8491194 100644 (file)
@@ -1,25 +1,44 @@
 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
- * Copyright (C) 2004 Cluster File Systems, Inc.
- *   Author: Eric Barton <eric@bartonsoftware.com>
- * Copyright (C) 2006 Myricom, Inc.
- *   Author: Myricom, Inc. <help at myri.com>
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
- *   This file is part of Lustre, http://www.lustre.org.
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
  *
- *   Lustre is free software; you can redistribute it and/or
- *   modify it under the terms of version 2 of the GNU General Public
- *   License as published by the Free Software Foundation.
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
  *
- *   Lustre is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
+ * Copyright (C) 2006 Myricom, Inc.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * lnet/klnds/mxlnd/mxlnd.c
+ *
+ * Author: Eric Barton <eric@bartonsoftware.com>
+ * Author: Scott Atchley <atchley at myri.com>
  */
 
 #include "mxlnd.h"
@@ -835,7 +854,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 */
@@ -1466,7 +1485,7 @@ mxlnd_setup_iov(struct kmx_ctx *ctx, u32 niov, struct iovec *iov, u32 offset, u3
         ctx->mxc_nseg = nseg;
         sum = 0;
         for (i = 0; i < nseg; i++) {
-                seg[i].segment_ptr = MX_KVA_TO_U64(iov[first_iov + i].iov_base);
+                seg[i].segment_ptr = MX_PA_TO_U64(virt_to_phys(iov[first_iov + i].iov_base));
                 seg[i].segment_length = (u32) iov[first_iov + i].iov_len;
                 if (i == 0) {
                         seg[i].segment_ptr += (u64) first_iov_offset;
@@ -1478,7 +1497,7 @@ mxlnd_setup_iov(struct kmx_ctx *ctx, u32 niov, struct iovec *iov, u32 offset, u3
                 sum += seg[i].segment_length;
         }
         ctx->mxc_seg_list = seg;
-        ctx->mxc_pin_type = MX_PIN_KERNEL;
+        ctx->mxc_pin_type = MX_PIN_PHYSICAL;
 #ifdef MX_PIN_FULLPAGES
         ctx->mxc_pin_type |= MX_PIN_FULLPAGES;
 #endif
@@ -2904,8 +2923,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,
@@ -2996,7 +3015,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));
@@ -3094,7 +3113,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));