+header-guards-2.6-suse.patch
ext3-wantedi-2.6-suse.patch
ext3-san-jdike-2.6-suse.patch
iopen-2.6-suse.patch
ext3-ea-in-inode-2.6-suse.patch
export-ext3-2.6-suse.patch
ext3-include-fixes-2.6-suse.patch
+ext3-xattr-header-move-2.6.suse.patch
AC_HELP_STRING([--with-cray-portals=path],
[path to cray portals]),
[
- CRAY_PORTALS_INCLUDE="-I$with_cray_portals"
- AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
+ if test "$with_cray_portals" != no; then
+ if test -r $with_cray_portals/include/portals/api.h ; then
+ CRAY_PORTALS_INCLUDE="-I$with_cray_portals/include"
+ AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
+ else
+ AC_MSG_ERROR([--with-cray-portals specified badly])
+ fi
+ fi
],[with_cray_portals=no])
AC_MSG_RESULT([$with_cray_portals])
+
AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
+
+# -------- enable tests and utils? -------
if test x$enable_tests = xno ; then
AC_MSG_NOTICE([disabling tests])
enable_tests=no
#define PORTAL_DEBUG
+#ifdef __linux__
+# include <asm/types.h>
+# if defined(__powerpc__) && !defined(__KERNEL__)
+# define __KERNEL__
+# include <asm/timex.h>
+# undef __KERNEL__
+# else
+# include <asm/timex.h>
+# endif
+#else
+# include <sys/types.h>
+typedef u_int32_t __u32;
+typedef u_int64_t __u64;
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+#endif
+
#ifndef offsetof
# define offsetof(typ,memb) ((int)((char *)&(((typ *)0)->memb)))
#endif
-# define DEBUG_SUBSYSTEM S_PORTALS
-# define PORTAL_DEBUG
#include "build_check.h"
#ifndef _PTLCTL_H_
#define _PTLCTL_H_
+#include <portals/types.h>
+#include <linux/kp30.h>
+#include <linux/libcfs.h>
+
#define PORTALS_DEV_ID 0
#define PORTALS_DEV_PATH "/dev/portals"
#define OBD_DEV_ID 1
#ifndef _PTLCTL_H_
#define _PTLCTL_H_
+#include <portals/types.h>
+#include <linux/kp30.h>
+#include <linux/libcfs.h>
+
#define PORTALS_DEV_ID 0
#define PORTALS_DEV_PATH "/dev/portals"
#define OBD_DEV_ID 1
#include "build_check.h"
-#ifdef __linux__
-# include <asm/types.h>
-# if defined(__powerpc__) && !defined(__KERNEL__)
-# define __KERNEL__
-# include <asm/timex.h>
-# undef __KERNEL__
-# else
-# include <asm/timex.h>
-# endif
-#else
-# include <sys/types.h>
-typedef u_int32_t __u32;
-typedef u_int64_t __u64;
-#endif
-
-#ifdef __KERNEL__
-# include <linux/time.h>
-#else
-# include <sys/time.h>
-# define do_gettimeofday(tv) gettimeofday(tv, NULL);
-#endif
-
+#include <linux/libcfs.h>
#include <portals/errno.h>
/* This implementation uses the same type for API function return codes and
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
int ptl_get_event (ptl_eq_t *eq, ptl_event_t *ev)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
int PtlInit(int *max_interfaces)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
int ptl_init;
noinst_LIBRARIES = libtcpnal.a
endif
+if !CRAY_PORTALS
pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h
libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h
libtcpnal_a_CPPFLAGS = $(LLCPPFLAGS)
libtcpnal_a_CFLAGS = $(LLCFLAGS)
+endif
\ No newline at end of file
noinst_LIBRARIES = libtcpnal.a
endif
+if !CRAY_PORTALS
pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h
libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h
libtcpnal_a_CPPFLAGS = $(LLCPPFLAGS)
libtcpnal_a_CFLAGS = $(LLCFLAGS)
+endif
\ No newline at end of file
if LIBLUSTRE
noinst_LIBRARIES = libuptlctl.a
-libuptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
+libuptlctl_a_SOURCES = portals.c debug.c l_ioctl.c
libuptlctl_a_CPPFLAGS = $(LLCPPFLAGS)
libuptlctl_a_CFLAGS = $(LLCFLAGS)
endif
-sbin_PROGRAMS = acceptor ptlctl debugctl routerstat wirecheck gmnalnid
+sbin_PROGRAMS = debugctl
+
lib_LIBRARIES = libptlctl.a
+libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
+
+if !CRAY_PORTALS
+sbin_PROGRAMS += acceptor ptlctl routerstat wirecheck gmnalnid
+
acceptor_SOURCES = acceptor.c
wirecheck_SOURCES = wirecheck.c
-libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
-
gmnalnid_SOURCES = gmnalnid.c
ptlctl_SOURCES = ptlctl.c
ptlctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
ptlctl_DEPENDENCIES = libptlctl.a
+routerstat_SOURCES = routerstat.c
+endif
+
debugctl_SOURCES = debugctl.c
debugctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
debugctl_DEPENDENCIES = libptlctl.a
-routerstat_SOURCES = routerstat.c
return 1;
}
-/* Convert human readable size string to and int; "1k" -> 1000 */
-int Parser_size (int *sizep, char *str) {
- int size;
- char mod[32];
-
- switch (sscanf (str, "%d%1[gGmMkK]", &size, mod)) {
- default:
- return (-1);
-
- case 1:
- *sizep = size;
- return (0);
-
- case 2:
- switch (*mod) {
- case 'g':
- case 'G':
- *sizep = size << 30;
- return (0);
-
- case 'm':
- case 'M':
- *sizep = size << 20;
- return (0);
-
- case 'k':
- case 'K':
- *sizep = size << 10;
- return (0);
-
- default:
- *sizep = size;
- return (0);
- }
- }
-}
-
-/* Convert a string boolean to an int; "enable" -> 1 */
-int Parser_bool (int *b, char *str) {
- if (!strcasecmp (str, "no") ||
- !strcasecmp (str, "n") ||
- !strcasecmp (str, "off") ||
- !strcasecmp (str, "down") ||
- !strcasecmp (str, "disable"))
- {
- *b = 0;
- return (0);
- }
-
- if (!strcasecmp (str, "yes") ||
- !strcasecmp (str, "y") ||
- !strcasecmp (str, "on") ||
- !strcasecmp (str, "up") ||
- !strcasecmp (str, "enable"))
- {
- *b = 1;
- return (0);
- }
-
- return (-1);
-}
-
int Parser_quit(int argc, char **argv)
{
argc = argc;
/* Extracts an integer from a string with a base */
int Parser_arg2int(const char *inp, long *result, int base);
-/* Convert human readable size string to and int; "1k" -> 1000 */
-int Parser_size(int *sizep, char *str);
-
-/* Convert a string boolean to an int; "enable" -> 1 */
-int Parser_bool(int *b, char *str);
-
#endif
static cfg_record_cb_t g_record_cb;
+/* Convert a string boolean to an int; "enable" -> 1 */
+int ptl_parse_bool (int *b, char *str) {
+ if (!strcasecmp (str, "no") ||
+ !strcasecmp (str, "n") ||
+ !strcasecmp (str, "off") ||
+ !strcasecmp (str, "down") ||
+ !strcasecmp (str, "disable"))
+ {
+ *b = 0;
+ return (0);
+ }
+
+ if (!strcasecmp (str, "yes") ||
+ !strcasecmp (str, "y") ||
+ !strcasecmp (str, "on") ||
+ !strcasecmp (str, "up") ||
+ !strcasecmp (str, "enable"))
+ {
+ *b = 1;
+ return (0);
+ }
+
+ return (-1);
+}
+
+/* Convert human readable size string to and int; "1k" -> 1000 */
+int ptl_parse_size (int *sizep, char *str) {
+ int size;
+ char mod[32];
+
+ switch (sscanf (str, "%d%1[gGmMkK]", &size, mod)) {
+ default:
+ return (-1);
+
+ case 1:
+ *sizep = size;
+ return (0);
+
+ case 2:
+ switch (*mod) {
+ case 'g':
+ case 'G':
+ *sizep = size << 30;
+ return (0);
+
+ case 'm':
+ case 'M':
+ *sizep = size << 20;
+ return (0);
+
+ case 'k':
+ case 'K':
+ *sizep = size << 10;
+ return (0);
+
+ default:
+ *sizep = size;
+ return (0);
+ }
+ }
+}
+
int
ptl_set_cfg_record_cb(cfg_record_cb_t cb)
{
return (-1);
}
+__u64 ptl_nid2u64(ptl_nid_t nid)
+{
+ switch (sizeof (nid)) {
+ case 8:
+ return (nid);
+ case 4:
+ return ((__u32)nid);
+ default:
+ fprintf(stderr, "Unexpected sizeof(ptl_nid_t) == %d\n", sizeof(nid));
+ abort();
+ /* notreached */
+ return (-1);
+ }
+}
+
char *
ptl_nid2str (char *buffer, ptl_nid_t nid)
{
- __u32 addr = htonl((__u32)nid); /* back to NETWORK byte order */
- struct hostent *he = gethostbyaddr ((const char *)&addr, sizeof (addr), AF_INET);
+ __u64 nid64 = ptl_nid2u64(nid);
+ struct hostent *he;
+
+ if ((nid64 & ~((__u64)((__u32)-1))) != 0) {
+ /* top bits set */
+ he = NULL;
+ } else {
+ __u32 addr = htonl((__u32)nid); /* back to NETWORK byte order */
+
+ he = gethostbyaddr ((const char *)&addr, sizeof (addr), AF_INET);
+ }
if (he != NULL)
strcpy (buffer, he->h_name);
else
- sprintf (buffer, LPX64, nid);
+ sprintf (buffer, LPX64, nid64);
return (buffer);
}
char *nidstr;
struct portals_cfg pcfg;
ptl_nid_t mynid;
-
+
if (argc > 2) {
fprintf(stderr, "usage: %s [NID]\n", argv[0]);
fprintf(stderr, "NID defaults to the primary IP address of the machine.\n");
fprintf(stderr, "setting my NID failed: %s\n",
strerror(errno));
else
- printf("registered my nid "LPX64" (%s)\n", mynid, hostname);
+ printf("registered my nid "LPX64" (%s)\n",
+ ptl_nid2u64(mynid), hostname);
return 0;
}
if (argc > 1)
{
- if (Parser_size (&size, argv[1]) != 0 || size < 0)
+ if (ptl_parse_size (&size, argv[1]) != 0 || size < 0)
{
fprintf (stderr, "Can't parse size %s\n", argv[1]);
return (0);
if (argc > 1)
{
- if (Parser_size (&size, argv[1]) != 0 || size < 0)
+ if (ptl_parse_size (&size, argv[1]) != 0 || size < 0)
{
fprintf (stderr, "Can't parse size %s\n", argv[1]);
return (0);
if (argc > 1)
{
- if (Parser_bool (&enable, argv[1]) != 0)
+ if (ptl_parse_bool (&enable, argv[1]) != 0)
{
fprintf (stderr, "Can't parse boolean %s\n", argv[1]);
return (-1);
rc = pcfg_ioctl(&pcfg);
if (rc != 0)
{
- fprintf (stderr, "NAL_CMD_DEL_ROUTE ("LPX64") failed: %s\n", nid, strerror (errno));
+ fprintf (stderr, "NAL_CMD_DEL_ROUTE ("LPX64") failed: %s\n",
+ ptl_nid2u64(nid), strerror (errno));
return (-1);
}
return (-1);
}
- if (Parser_bool (&enable, argv[2]) != 0) {
+ if (ptl_parse_bool (&enable, argv[2]) != 0) {
fprintf (stderr, "Can't parse boolean %s\n", argv[2]);
return (-1);
}
if (rc != 0)
{
fprintf (stderr, "NAL_CMD_NOTIFY_ROUTER ("LPX64") failed: %s\n",
- nid, strerror (errno));
+ ptl_nid2u64(nid), strerror (errno));
return (-1);
}
LUSTRE="$PWD"
AC_SUBST(LUSTRE)
-# cray portals turns these off
+#
AM_CONDITIONAL(UTILS, test x$enable_utils = xyes)
AM_CONDITIONAL(TESTS, test x$enable_tests = xyes)
struct ptlrpc_srv_ni srv_interfaces[0];
};
+static inline char *ptlrpc_peernid2str(struct ptlrpc_peer *p, char *str)
+{
+ return (portals_nid2str(p->peer_ni->pni_number, p->peer_nid, str));
+}
+
/* ptlrpc/events.c */
extern struct ptlrpc_ni ptlrpc_interfaces[];
extern int ptlrpc_ninterfaces;
+header-guards-2.6-suse.patch
ext3-wantedi-2.6-suse.patch
ext3-san-jdike-2.6-suse.patch
iopen-2.6-suse.patch
ext3-ea-in-inode-2.6-suse.patch
export-ext3-2.6-suse.patch
ext3-include-fixes-2.6-suse.patch
+ext3-xattr-header-move-2.6.suse.patch
obd_str2uuid (&cluuid, str);
/* XXX extract a nettype and format accordingly */
- snprintf(remote_uuid.uuid, sizeof remote_uuid,
- "NET_"LPX64"_UUID", req->rq_peer.peer_nid);
+ switch (sizeof(ptl_nid_t)) {
+ /* NB the casts only avoid compiler warnings */
+ case 8:
+ snprintf(remote_uuid.uuid, sizeof remote_uuid,
+ "NET_"LPX64"_UUID", (__u64)req->rq_peer.peer_nid);
+ break;
+ case 4:
+ snprintf(remote_uuid.uuid, sizeof remote_uuid,
+ "NET_%x_UUID", (__u32)req->rq_peer.peer_nid);
+ break;
+ default:
+ LBUG();
+ }
spin_lock_bh(&target->obd_processing_task_lock);
abort_recovery = target->obd_abort_recovery;
if (lock->l_conn_export != NULL)
obd = lock->l_conn_export->exp_obd;
if (lock->l_export && lock->l_export->exp_connection) {
- CDEBUG(level, " Node: NID "LPX64" (%s) on %s (rhandle: "LPX64")\n",
- lock->l_export->exp_connection->c_peer.peer_nid,
- portals_nid2str(lock->l_export->exp_connection->c_peer.peer_ni->pni_number,
- lock->l_export->exp_connection->c_peer.peer_nid, str),
+ CDEBUG(level, " Node: NID %s on %s (rhandle: "LPX64")\n",
+ ptlrpc_peernid2str(&lock->l_export->exp_connection->c_peer, str),
lock->l_export->exp_connection->c_peer.peer_ni->pni_name,
lock->l_remote_handle.cookie);
} else if (obd == NULL) {
CDEBUG(level, " Node: local\n");
} else {
struct obd_import *imp = obd->u.cli.cl_import;
- CDEBUG(level, " Node: NID "LPX64" (%s) on %s (rhandle: "LPX64")\n",
- imp->imp_connection->c_peer.peer_nid,
- portals_nid2str(imp->imp_connection->c_peer.peer_ni->pni_number,
- imp->imp_connection->c_peer.peer_nid, str),
+ CDEBUG(level, " Node: NID %s on %s (rhandle: "LPX64")\n",
+ ptlrpc_peernid2str(&imp->imp_connection->c_peer, str),
imp->imp_connection->c_peer.peer_ni->pni_name,
lock->l_remote_handle.cookie);
}
break;
LDLM_ERROR(lock, "lock callback timer expired: evicting client "
- "%s@%s nid "LPX64" (%s) ",
+ "%s@%s nid %s ",
lock->l_export->exp_client_uuid.uuid,
lock->l_export->exp_connection->c_remote_uuid.uuid,
- lock->l_export->exp_connection->c_peer.peer_nid,
- portals_nid2str(lock->l_export->exp_connection->c_peer.peer_ni->pni_number,
- lock->l_export->exp_connection->c_peer.peer_nid,
- str));
+ ptlrpc_peernid2str(&lock->l_export->exp_connection->c_peer, str));
spin_lock_bh(&expired_lock_thread.elt_lock);
list_del(&lock->l_pending_chain);
static void ldlm_failed_ast(struct ldlm_lock *lock, int rc,const char *ast_type)
{
- const struct ptlrpc_connection *conn = lock->l_export->exp_connection;
+ struct ptlrpc_connection *conn = lock->l_export->exp_connection;
char str[PTL_NALFMT_SIZE];
CERROR("%s AST failed (%d) for res "LPU64"/"LPU64
- ", mode %s: evicting client %s@%s NID "LPX64" (%s)\n",
+ ", mode %s: evicting client %s@%s NID %s\n",
ast_type, rc,
lock->l_resource->lr_name.name[0],
lock->l_resource->lr_name.name[1],
ldlm_lockname[lock->l_granted_mode],
lock->l_export->exp_client_uuid.uuid,
- conn->c_remote_uuid.uuid, conn->c_peer.peer_nid,
- portals_nid2str(conn->c_peer.peer_ni->pni_number,
- conn->c_peer.peer_nid, str));
+ conn->c_remote_uuid.uuid,
+ ptlrpc_peernid2str(&conn->c_peer, str));
ptlrpc_fail_export(lock->l_export);
}
struct ptlrpc_request *req, int rc,
const char *ast_type)
{
+ char str[PTL_NALFMT_SIZE];
+
if (rc == -ETIMEDOUT || rc == -EINTR || rc == -ENOTCONN) {
LASSERT(lock->l_export);
if (lock->l_export->exp_libclient) {
- LDLM_DEBUG(lock, "%s AST to liblustre client (nid "
- LPU64") timeout, just cancelling lock",
- ast_type, req->rq_peer.peer_nid);
+ LDLM_DEBUG(lock, "%s AST to liblustre client (nid %s)"
+ " timeout, just cancelling lock", ast_type,
+ ptlrpc_peernid2str(&req->rq_peer, str));
ldlm_lock_cancel(lock);
rc = -ERESTART;
} else {
}
} else if (rc) {
if (rc == -EINVAL)
- LDLM_DEBUG(lock, "client (nid "LPU64") returned %d"
+ LDLM_DEBUG(lock, "client (nid %s) returned %d"
" from %s AST - normal race",
- req->rq_peer.peer_nid,
+ ptlrpc_peernid2str(&req->rq_peer, str),
req->rq_repmsg->status, ast_type);
else
- LDLM_ERROR(lock, "client (nid "LPU64") returned %d "
- "from %s AST", req->rq_peer.peer_nid,
+ LDLM_ERROR(lock, "client (nid %s) returned %d "
+ "from %s AST",
+ ptlrpc_peernid2str(&req->rq_peer, str),
(req->rq_repmsg != NULL) ?
req->rq_repmsg->status : 0, ast_type);
ldlm_lock_cancel(lock);
lock = ldlm_handle2lock(&dlm_req->lock_handle1);
if (!lock) {
CERROR("received cancel for unknown lock cookie "LPX64
- " from client %s nid "LPX64" (%s)\n",
+ " from client %s nid %s\n",
dlm_req->lock_handle1.cookie,
req->rq_export->exp_client_uuid.uuid,
- req->rq_peer.peer_nid,
- portals_nid2str(req->rq_peer.peer_ni->pni_number,
- req->rq_peer.peer_nid, str));
+ ptlrpc_peernid2str(&req->rq_peer, str));
LDLM_DEBUG_NOLOCK("server-side cancel handler stale lock "
"(cookie "LPU64")",
dlm_req->lock_handle1.cookie);
if (req->rq_export == NULL) {
struct ldlm_request *dlm_req;
- CDEBUG(D_RPCTRACE, "operation %d from nid "LPX64" (%s) with bad "
+ CDEBUG(D_RPCTRACE, "operation %d from nid %s with bad "
"export cookie "LPX64" (ptl req %d/rep %d); this is "
"normal if this node rebooted with a lock held\n",
- req->rq_reqmsg->opc, req->rq_peer.peer_nid,
- portals_nid2str(req->rq_peer.peer_ni->pni_number,
- req->rq_peer.peer_nid, str),
+ req->rq_reqmsg->opc,
+ ptlrpc_peernid2str(&req->rq_peer, str),
req->rq_reqmsg->handle.cookie,
req->rq_request_portal, req->rq_reply_portal);
rc = ptlrpc_queue_wait(req);
if (rc == ESTALE) {
- CERROR("client/server (nid "LPU64") out of sync--not "
- "fatal\n",
- req->rq_import->imp_connection->c_peer.peer_nid);
+ char str[PTL_NALFMT_SIZE];
+ CERROR("client/server (nid %s) out of sync"
+ " -- not fatal\n",
+ ptlrpc_peernid2str(&req->rq_import->
+ imp_connection->c_peer, str));
} else if (rc == -ETIMEDOUT) {
ptlrpc_req_finished(req);
GOTO(restart, rc);
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include <signal.h>
#include <sys/types.h>
#include <sys/queue.h>
*/
#undef LIST_HEAD
-#include <portals/api-support.h> /* needed for ptpctl.h */
#include <portals/ptlctl.h> /* needed for parse_dump */
#include <procbridge.h>
#include <sys/socket.h>
#include <arpa/inet.h>
-#include <portals/api-support.h> /* needed for ptpctl.h */
#include <portals/ptlctl.h> /* needed for parse_dump */
if (pfop && *pfop && (*pfop)->ioctl) {
struct file_operations *sfops = filp->f_op;
-
+
rc = (*pfop)->ioctl(inode, filp, cmd, arg);
/* sometimes, file_operations will be changed in ioctl */
struct ptlrpc_reply_state *oldrep;
struct ptlrpc_service *svc;
unsigned long flags;
+ char str[PTL_NALFMT_SIZE];
int i;
/* CAVEAT EMPTOR: spinlock order */
list_del_init (&oldrep->rs_exp_list);
CWARN("Stealing %d locks from rs %p x"LPD64".t"LPD64
- " o%d NID"LPX64"\n",
+ " o%d NID %s\n",
oldrep->rs_nlocks, oldrep,
oldrep->rs_xid, oldrep->rs_transno, oldrep->rs_msg.opc,
- exp->exp_connection->c_peer.peer_nid);
+ ptlrpc_peernid2str(&exp->exp_connection->c_peer, str));
for (i = 0; i < oldrep->rs_nlocks; i++)
ptlrpc_save_lock(req,
obd_count cksum = cksum_pages(rc, page_count, pga);
char str[PTL_NALFMT_SIZE];
- portals_nid2str(peer->peer_ni->pni_number, peer->peer_nid, str);
+ ptlrpc_peernid2str(peer, str);
cksum_counter++;
if (server_cksum != cksum) {
}
if (req->rq_reqmsg->conn_cnt == req->rq_export->exp_conn_cnt) {
CERROR("bulk IO comms error: "
- "evicting %s@%s nid "LPX64" (%s)\n",
+ "evicting %s@%s nid %s\n",
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid,
- req->rq_peer.peer_nid,
- portals_nid2str(req->rq_peer.peer_ni->pni_number,
- req->rq_peer.peer_nid,
- str));
+ ptlrpc_peernid2str(&req->rq_peer, str));
ptlrpc_fail_export(req->rq_export);
} else {
CERROR("ignoring bulk IO comms error: "
- "client reconnected %s@%s nid "LPX64" (%s)\n",
+ "client reconnected %s@%s nid %s\n",
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid,
- req->rq_peer.peer_nid,
- portals_nid2str(req->rq_peer.peer_ni->pni_number,
- req->rq_peer.peer_nid,
- str));
+ ptlrpc_peernid2str(&req->rq_peer, str));
}
}
obd_count client_cksum = body->oa.o_cksum;
obd_count cksum = ost_checksum_bulk(desc);
- portals_nid2str(req->rq_connection->c_peer.peer_ni->pni_number,
- req->rq_connection->c_peer.peer_nid, str);
+ ptlrpc_peernid2str(&req->rq_connection->c_peer, str);
if (client_cksum != cksum) {
CERROR("Bad checksum: client %x, server %x, client NID "
LPX64" (%s)\n", client_cksum, cksum,
}
if (req->rq_reqmsg->conn_cnt == req->rq_export->exp_conn_cnt) {
CERROR("bulk IO comms error: "
- "evicting %s@%s nid "LPX64" (%s)\n",
+ "evicting %s@%s nid %s\n",
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid,
- req->rq_peer.peer_nid,
- portals_nid2str(req->rq_peer.peer_ni->pni_number,
- req->rq_peer.peer_nid,
- str));
+ ptlrpc_peernid2str(&req->rq_peer, str));
ptlrpc_fail_export(req->rq_export);
} else {
CERROR("ignoring bulk IO comms error: "
- "client reconnected %s@%s nid "LPX64" (%s)\n",
+ "client reconnected %s@%s nid %s\n",
req->rq_export->exp_client_uuid.uuid,
req->rq_export->exp_connection->c_remote_uuid.uuid,
- req->rq_peer.peer_nid,
- portals_nid2str(req->rq_peer.peer_ni->pni_number,
- req->rq_peer.peer_nid,
- str));
+ ptlrpc_peernid2str(&req->rq_peer, str));
}
}
RETURN(rc);
AC_HELP_STRING([--with-cray-portals=path],
[path to cray portals]),
[
- CRAY_PORTALS_INCLUDE="-I$with_cray_portals"
- AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
+ if test "$with_cray_portals" != no; then
+ if test -r $with_cray_portals/include/portals/api.h ; then
+ CRAY_PORTALS_INCLUDE="-I$with_cray_portals/include"
+ AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
+ else
+ AC_MSG_ERROR([--with-cray-portals specified badly])
+ fi
+ fi
],[with_cray_portals=no])
AC_MSG_RESULT([$with_cray_portals])
+
AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
+
+# -------- enable tests and utils? -------
if test x$enable_tests = xno ; then
AC_MSG_NOTICE([disabling tests])
enable_tests=no
#define PORTAL_DEBUG
+#ifdef __linux__
+# include <asm/types.h>
+# if defined(__powerpc__) && !defined(__KERNEL__)
+# define __KERNEL__
+# include <asm/timex.h>
+# undef __KERNEL__
+# else
+# include <asm/timex.h>
+# endif
+#else
+# include <sys/types.h>
+typedef u_int32_t __u32;
+typedef u_int64_t __u64;
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+#endif
+
#ifndef offsetof
# define offsetof(typ,memb) ((int)((char *)&(((typ *)0)->memb)))
#endif
-# define DEBUG_SUBSYSTEM S_PORTALS
-# define PORTAL_DEBUG
#include "build_check.h"
#ifndef _PTLCTL_H_
#define _PTLCTL_H_
+#include <portals/types.h>
+#include <linux/kp30.h>
+#include <linux/libcfs.h>
+
#define PORTALS_DEV_ID 0
#define PORTALS_DEV_PATH "/dev/portals"
#define OBD_DEV_ID 1
#include "build_check.h"
-#ifdef __linux__
-# include <asm/types.h>
-# if defined(__powerpc__) && !defined(__KERNEL__)
-# define __KERNEL__
-# include <asm/timex.h>
-# undef __KERNEL__
-# else
-# include <asm/timex.h>
-# endif
-#else
-# include <sys/types.h>
-typedef u_int32_t __u32;
-typedef u_int64_t __u64;
-#endif
-
-#ifdef __KERNEL__
-# include <linux/time.h>
-#else
-# include <sys/time.h>
-# define do_gettimeofday(tv) gettimeofday(tv, NULL);
-#endif
-
+#include <linux/libcfs.h>
#include <portals/errno.h>
/* This implementation uses the same type for API function return codes and
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
int ptl_get_event (ptl_eq_t *eq, ptl_event_t *ev)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
int PtlInit(int *max_interfaces)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#define DEBUG_SUBSYSTEM S_PORTALS
#include <portals/api-support.h>
int ptl_init;
noinst_LIBRARIES = libtcpnal.a
endif
+if !CRAY_PORTALS
pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h
libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h
libtcpnal_a_CPPFLAGS = $(LLCPPFLAGS)
libtcpnal_a_CFLAGS = $(LLCFLAGS)
+endif
\ No newline at end of file
if LIBLUSTRE
noinst_LIBRARIES = libuptlctl.a
-libuptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
+libuptlctl_a_SOURCES = portals.c debug.c l_ioctl.c
libuptlctl_a_CPPFLAGS = $(LLCPPFLAGS)
libuptlctl_a_CFLAGS = $(LLCFLAGS)
endif
-sbin_PROGRAMS = acceptor ptlctl debugctl routerstat wirecheck gmnalnid
+sbin_PROGRAMS = debugctl
+
lib_LIBRARIES = libptlctl.a
+libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
+
+if !CRAY_PORTALS
+sbin_PROGRAMS += acceptor ptlctl routerstat wirecheck gmnalnid
+
acceptor_SOURCES = acceptor.c
wirecheck_SOURCES = wirecheck.c
-libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
-
gmnalnid_SOURCES = gmnalnid.c
ptlctl_SOURCES = ptlctl.c
ptlctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
ptlctl_DEPENDENCIES = libptlctl.a
+routerstat_SOURCES = routerstat.c
+endif
+
debugctl_SOURCES = debugctl.c
debugctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
debugctl_DEPENDENCIES = libptlctl.a
-routerstat_SOURCES = routerstat.c
return 1;
}
-/* Convert human readable size string to and int; "1k" -> 1000 */
-int Parser_size (int *sizep, char *str) {
- int size;
- char mod[32];
-
- switch (sscanf (str, "%d%1[gGmMkK]", &size, mod)) {
- default:
- return (-1);
-
- case 1:
- *sizep = size;
- return (0);
-
- case 2:
- switch (*mod) {
- case 'g':
- case 'G':
- *sizep = size << 30;
- return (0);
-
- case 'm':
- case 'M':
- *sizep = size << 20;
- return (0);
-
- case 'k':
- case 'K':
- *sizep = size << 10;
- return (0);
-
- default:
- *sizep = size;
- return (0);
- }
- }
-}
-
-/* Convert a string boolean to an int; "enable" -> 1 */
-int Parser_bool (int *b, char *str) {
- if (!strcasecmp (str, "no") ||
- !strcasecmp (str, "n") ||
- !strcasecmp (str, "off") ||
- !strcasecmp (str, "down") ||
- !strcasecmp (str, "disable"))
- {
- *b = 0;
- return (0);
- }
-
- if (!strcasecmp (str, "yes") ||
- !strcasecmp (str, "y") ||
- !strcasecmp (str, "on") ||
- !strcasecmp (str, "up") ||
- !strcasecmp (str, "enable"))
- {
- *b = 1;
- return (0);
- }
-
- return (-1);
-}
-
int Parser_quit(int argc, char **argv)
{
argc = argc;
/* Extracts an integer from a string with a base */
int Parser_arg2int(const char *inp, long *result, int base);
-/* Convert human readable size string to and int; "1k" -> 1000 */
-int Parser_size(int *sizep, char *str);
-
-/* Convert a string boolean to an int; "enable" -> 1 */
-int Parser_bool(int *b, char *str);
-
#endif
static cfg_record_cb_t g_record_cb;
+/* Convert a string boolean to an int; "enable" -> 1 */
+int ptl_parse_bool (int *b, char *str) {
+ if (!strcasecmp (str, "no") ||
+ !strcasecmp (str, "n") ||
+ !strcasecmp (str, "off") ||
+ !strcasecmp (str, "down") ||
+ !strcasecmp (str, "disable"))
+ {
+ *b = 0;
+ return (0);
+ }
+
+ if (!strcasecmp (str, "yes") ||
+ !strcasecmp (str, "y") ||
+ !strcasecmp (str, "on") ||
+ !strcasecmp (str, "up") ||
+ !strcasecmp (str, "enable"))
+ {
+ *b = 1;
+ return (0);
+ }
+
+ return (-1);
+}
+
+/* Convert human readable size string to and int; "1k" -> 1000 */
+int ptl_parse_size (int *sizep, char *str) {
+ int size;
+ char mod[32];
+
+ switch (sscanf (str, "%d%1[gGmMkK]", &size, mod)) {
+ default:
+ return (-1);
+
+ case 1:
+ *sizep = size;
+ return (0);
+
+ case 2:
+ switch (*mod) {
+ case 'g':
+ case 'G':
+ *sizep = size << 30;
+ return (0);
+
+ case 'm':
+ case 'M':
+ *sizep = size << 20;
+ return (0);
+
+ case 'k':
+ case 'K':
+ *sizep = size << 10;
+ return (0);
+
+ default:
+ *sizep = size;
+ return (0);
+ }
+ }
+}
+
int
ptl_set_cfg_record_cb(cfg_record_cb_t cb)
{
return (-1);
}
+__u64 ptl_nid2u64(ptl_nid_t nid)
+{
+ switch (sizeof (nid)) {
+ case 8:
+ return (nid);
+ case 4:
+ return ((__u32)nid);
+ default:
+ fprintf(stderr, "Unexpected sizeof(ptl_nid_t) == %d\n", sizeof(nid));
+ abort();
+ /* notreached */
+ return (-1);
+ }
+}
+
char *
ptl_nid2str (char *buffer, ptl_nid_t nid)
{
- __u32 addr = htonl((__u32)nid); /* back to NETWORK byte order */
- struct hostent *he = gethostbyaddr ((const char *)&addr, sizeof (addr), AF_INET);
+ __u64 nid64 = ptl_nid2u64(nid);
+ struct hostent *he;
+
+ if ((nid64 & ~((__u64)((__u32)-1))) != 0) {
+ /* top bits set */
+ he = NULL;
+ } else {
+ __u32 addr = htonl((__u32)nid); /* back to NETWORK byte order */
+
+ he = gethostbyaddr ((const char *)&addr, sizeof (addr), AF_INET);
+ }
if (he != NULL)
strcpy (buffer, he->h_name);
else
- sprintf (buffer, LPX64, nid);
+ sprintf (buffer, LPX64, nid64);
return (buffer);
}
char *nidstr;
struct portals_cfg pcfg;
ptl_nid_t mynid;
-
+
if (argc > 2) {
fprintf(stderr, "usage: %s [NID]\n", argv[0]);
fprintf(stderr, "NID defaults to the primary IP address of the machine.\n");
fprintf(stderr, "setting my NID failed: %s\n",
strerror(errno));
else
- printf("registered my nid "LPX64" (%s)\n", mynid, hostname);
+ printf("registered my nid "LPX64" (%s)\n",
+ ptl_nid2u64(mynid), hostname);
return 0;
}
if (argc > 1)
{
- if (Parser_size (&size, argv[1]) != 0 || size < 0)
+ if (ptl_parse_size (&size, argv[1]) != 0 || size < 0)
{
fprintf (stderr, "Can't parse size %s\n", argv[1]);
return (0);
if (argc > 1)
{
- if (Parser_size (&size, argv[1]) != 0 || size < 0)
+ if (ptl_parse_size (&size, argv[1]) != 0 || size < 0)
{
fprintf (stderr, "Can't parse size %s\n", argv[1]);
return (0);
if (argc > 1)
{
- if (Parser_bool (&enable, argv[1]) != 0)
+ if (ptl_parse_bool (&enable, argv[1]) != 0)
{
fprintf (stderr, "Can't parse boolean %s\n", argv[1]);
return (-1);
rc = pcfg_ioctl(&pcfg);
if (rc != 0)
{
- fprintf (stderr, "NAL_CMD_DEL_ROUTE ("LPX64") failed: %s\n", nid, strerror (errno));
+ fprintf (stderr, "NAL_CMD_DEL_ROUTE ("LPX64") failed: %s\n",
+ ptl_nid2u64(nid), strerror (errno));
return (-1);
}
return (-1);
}
- if (Parser_bool (&enable, argv[2]) != 0) {
+ if (ptl_parse_bool (&enable, argv[2]) != 0) {
fprintf (stderr, "Can't parse boolean %s\n", argv[2]);
return (-1);
}
if (rc != 0)
{
fprintf (stderr, "NAL_CMD_NOTIFY_ROUTER ("LPX64") failed: %s\n",
- nid, strerror (errno));
+ ptl_nid2u64(nid), strerror (errno));
return (-1);
}
static int ptlrpc_send_new_req(struct ptlrpc_request *req)
{
+ char str[PTL_NALFMT_SIZE];
struct obd_import *imp;
unsigned long flags;
int rc;
req->rq_reqmsg->status = current->pid;
CDEBUG(D_RPCTRACE, "Sending RPC pname:cluuid:pid:xid:ni:nid:opc"
- " %s:%s:%d:"LPU64":%s:"LPX64":%d\n", current->comm,
+ " %s:%s:%d:"LPU64":%s:%s:%d\n", current->comm,
imp->imp_obd->obd_uuid.uuid, req->rq_reqmsg->status,
req->rq_xid,
imp->imp_connection->c_peer.peer_ni->pni_name,
- imp->imp_connection->c_peer.peer_nid,
+ ptlrpc_peernid2str(&imp->imp_connection->c_peer, str),
req->rq_reqmsg->opc);
rc = ptl_send_rpc(req);
int ptlrpc_check_set(struct ptlrpc_request_set *set)
{
+ char str[PTL_NALFMT_SIZE];
unsigned long flags;
struct list_head *tmp;
int force_timer_recalc = 0;
}
CDEBUG(D_RPCTRACE, "Completed RPC pname:cluuid:pid:xid:ni:nid:"
- "opc %s:%s:%d:"LPU64":%s:"LPX64":%d\n", current->comm,
+ "opc %s:%s:%d:"LPU64":%s:%s:%d\n", current->comm,
imp->imp_obd->obd_uuid.uuid, req->rq_reqmsg->status,
req->rq_xid,
imp->imp_connection->c_peer.peer_ni->pni_name,
- imp->imp_connection->c_peer.peer_nid,
+ ptlrpc_peernid2str(&imp->imp_connection->c_peer, str),
req->rq_reqmsg->opc);
set->set_remaining--;
int ptlrpc_queue_wait(struct ptlrpc_request *req)
{
+ char str[PTL_NALFMT_SIZE];
int rc = 0;
int brc;
struct l_wait_info lwi;
req->rq_reqmsg->status = current->pid;
LASSERT(imp->imp_obd != NULL);
CDEBUG(D_RPCTRACE, "Sending RPC pname:cluuid:pid:xid:ni:nid:opc "
- "%s:%s:%d:"LPU64":%s:"LPX64":%d\n", current->comm,
+ "%s:%s:%d:"LPU64":%s:%s:%d\n", current->comm,
imp->imp_obd->obd_uuid.uuid,
req->rq_reqmsg->status, req->rq_xid,
imp->imp_connection->c_peer.peer_ni->pni_name,
- imp->imp_connection->c_peer.peer_nid,
+ ptlrpc_peernid2str(&imp->imp_connection->c_peer, str),
req->rq_reqmsg->opc);
/* Mark phase here for a little debug help */
DEBUG_REQ(D_NET, req, "-- done sleeping");
CDEBUG(D_RPCTRACE, "Completed RPC pname:cluuid:pid:xid:ni:nid:opc "
- "%s:%s:%d:"LPU64":%s:"LPX64":%d\n", current->comm,
+ "%s:%s:%d:"LPU64":%s:%s:%d\n", current->comm,
imp->imp_obd->obd_uuid.uuid,
req->rq_reqmsg->status, req->rq_xid,
imp->imp_connection->c_peer.peer_ni->pni_name,
- imp->imp_connection->c_peer.peer_nid,
+ ptlrpc_peernid2str(&imp->imp_connection->c_peer, str),
req->rq_reqmsg->opc);
spin_lock_irqsave(&imp->imp_lock, flags);
void ptlrpc_dump_connections(void)
{
+ char str[PTL_NALFMT_SIZE];
struct list_head *tmp;
struct ptlrpc_connection *c;
ENTRY;
list_for_each(tmp, &conn_list) {
c = list_entry(tmp, struct ptlrpc_connection, c_link);
- CERROR("Connection %p/%s has refcount %d (nid="LPX64" on %s)\n",
+ CERROR("Connection %p/%s has refcount %d (nid=%s on %s)\n",
c, c->c_remote_uuid.uuid, atomic_read(&c->c_refcount),
- c->c_peer.peer_nid, c->c_peer.peer_ni->pni_name);
+ ptlrpc_peernid2str(&c->c_peer, str),
+ c->c_peer.peer_ni->pni_name);
}
EXIT;
}
struct ptlrpc_connection *ptlrpc_get_connection(struct ptlrpc_peer *peer,
struct obd_uuid *uuid)
{
+ char str[PTL_NALFMT_SIZE];
struct list_head *tmp, *pos;
struct ptlrpc_connection *c;
ENTRY;
- CDEBUG(D_INFO, "peer is "LPX64" on %s\n",
- peer->peer_nid, peer->peer_ni->pni_name);
+ CDEBUG(D_INFO, "peer is %s on %s\n",
+ ptlrpc_peernid2str(peer, str), peer->peer_ni->pni_name);
spin_lock(&conn_lock);
list_for_each(tmp, &conn_list) {
int ptlrpc_put_connection(struct ptlrpc_connection *c)
{
+ char str[PTL_NALFMT_SIZE];
int rc = 0;
ENTRY;
RETURN(0);
}
- CDEBUG (D_INFO, "connection=%p refcount %d to "LPX64" on %s\n",
- c, atomic_read(&c->c_refcount) - 1, c->c_peer.peer_nid,
+ CDEBUG (D_INFO, "connection=%p refcount %d to %s on %s\n",
+ c, atomic_read(&c->c_refcount) - 1,
+ ptlrpc_peernid2str(&c->c_peer, str),
c->c_peer.peer_ni->pni_name);
if (atomic_dec_and_test(&c->c_refcount)) {
struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *c)
{
+ char str[PTL_NALFMT_SIZE];
ENTRY;
atomic_inc(&c->c_refcount);
- CDEBUG (D_INFO, "connection=%p refcount %d to "LPX64" on %s\n",
- c, atomic_read(&c->c_refcount), c->c_peer.peer_nid,
+ CDEBUG (D_INFO, "connection=%p refcount %d to %s on %s\n",
+ c, atomic_read(&c->c_refcount),
+ ptlrpc_peernid2str(&c->c_peer, str),
c->c_peer.peer_ni->pni_name);
RETURN(c);
}
void ptlrpc_cleanup_connection(void)
{
+ char str[PTL_NALFMT_SIZE];
struct list_head *tmp, *pos;
struct ptlrpc_connection *c;
}
list_for_each_safe(tmp, pos, &conn_list) {
c = list_entry(tmp, struct ptlrpc_connection, c_link);
- CERROR("Connection %p/%s has refcount %d (nid="LPX64" on %s)\n",
+ CERROR("Connection %p/%s has refcount %d (nid=%s on %s)\n",
c, c->c_remote_uuid.uuid, atomic_read(&c->c_refcount),
- c->c_peer.peer_nid, c->c_peer.peer_ni->pni_name);
+ ptlrpc_peernid2str(&c->c_peer, str),
+ c->c_peer.peer_ni->pni_name);
list_del(&c->c_link);
OBD_FREE(c, sizeof(*c));
}
#include <linux/lustre_net.h>
#include "ptlrpc_internal.h"
+#if !defined(__KERNEL__) && defined(CRAY_PORTALS)
+/* forward ref in events.c */
+static void cray_portals_callback(ptl_event_t *ev);
+#endif
+
+
struct ptlrpc_ni ptlrpc_interfaces[NAL_MAX_NR];
int ptlrpc_ninterfaces;
struct ptlrpc_srv_ni *srv_ni = rqbd->rqbd_srv_ni;
struct ptlrpc_service *service = srv_ni->sni_service;
struct ptlrpc_request *req;
+ char str[PTL_NALFMT_SIZE];
unsigned long flags;
ENTRY;
OBD_ALLOC_GFP(req, sizeof(*req), GFP_ATOMIC);
if (req == NULL) {
CERROR("Can't allocate incoming request descriptor: "
- "Dropping %s RPC from "LPX64"\n",
- service->srv_name, ev->initiator.nid);
+ "Dropping %s RPC from %s\n",
+ service->srv_name,
+ portals_nid2str(srv_ni->sni_ni->pni_number,
+ ev->initiator.nid, str));
return;
}
}
LASSERT (portal != 0);
LASSERT (conn != NULL);
- CDEBUG (D_INFO, "conn=%p ni %s nid "LPX64" (%s) on %s\n",
+ CDEBUG (D_INFO, "conn=%p ni %s nid %s on %s\n",
conn, conn->c_peer.peer_ni->pni_name,
- conn->c_peer.peer_nid,
- portals_nid2str(conn->c_peer.peer_ni->pni_number,
- conn->c_peer.peer_nid, str),
+ ptlrpc_peernid2str(&conn->c_peer, str),
conn->c_peer.peer_ni->pni_name);
remote_id.nid = conn->c_peer.peer_nid,
/* We're going to get an UNLINK event when I unlink below,
* which will complete just like any other failed send, so
* I fall through and return success here! */
- CERROR("PtlPut("LPU64", %d, "LPD64") failed: %d\n",
- remote_id.nid, portal, xid, rc);
+ CERROR("PtlPut(%s, %d, "LPD64") failed: %d\n",
+ ptlrpc_peernid2str(&conn->c_peer, str),
+ portal, xid, rc);
rc2 = PtlMDUnlink(*mdh);
LASSERT (rc2 == PTL_OK);
}
ptl_process_id_t remote_id;
ptl_md_t md;
__u64 xid;
+ char str[PTL_NALFMT_SIZE];
ENTRY;
if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_PTLRPC_BULK_PUT_NET))
remote_id.pid = 0;
CDEBUG(D_NET, "Transferring %u pages %u bytes via portal %d on %s "
- "nid "LPX64" pid %d xid "LPX64"\n", desc->bd_iov_count,
+ "nid %s pid %d xid "LPX64"\n", desc->bd_iov_count,
desc->bd_nob, desc->bd_portal, peer->peer_ni->pni_name,
- remote_id.nid, remote_id.pid, xid);
+ ptlrpc_peernid2str(peer, str), remote_id.pid, xid);
/* Network is about to get at the memory */
desc->bd_network_rw = 1;
/* Can't send, so we unlink the MD bound above. The UNLINK
* event this creates will signal completion with failure,
* so we return SUCCESS here! */
- CERROR("Transfer("LPU64", %d, "LPX64") failed: %d\n",
- remote_id.nid, desc->bd_portal, xid, rc);
+ CERROR("Transfer(%s, %d, "LPX64") failed: %d\n",
+ ptlrpc_peernid2str(peer, str),
+ desc->bd_portal, xid, rc);
rc2 = PtlMDUnlink(desc->bd_md_h);
LASSERT (rc2 == PTL_OK);
}
int ptlrpc_expire_one_request(struct ptlrpc_request *req);
-#if !defined(__KERNEL__) && defined(CRAY_PORTALS)
-/* forward ref in events.c */
-static void cray_portals_callback(ptl_event_t *ev);
-#endif
-
/* pers.c */
void ptlrpc_fill_bulk_md(ptl_md_t *md, struct ptlrpc_bulk_desc *desc);
void ptlrpc_add_bulk_page(struct ptlrpc_bulk_desc *desc, struct page *page,
struct timeval work_end;
long timediff;
int rc;
+ char str[PTL_NALFMT_SIZE];
ENTRY;
spin_lock_irqsave (&svc->srv_lock, flags);
#endif
rc = lustre_unpack_msg (request->rq_reqmsg, request->rq_reqlen);
if (rc != 0) {
- CERROR ("error unpacking request: ptl %d from "LPX64
+ CERROR ("error unpacking request: ptl %d from %s"
" xid "LPU64"\n", svc->srv_req_portal,
- request->rq_peer.peer_nid, request->rq_xid);
+ ptlrpc_peernid2str(&request->rq_peer, str),
+ request->rq_xid);
goto out;
}
rc = -EINVAL;
if (request->rq_reqmsg->type != PTL_RPC_MSG_REQUEST) {
- CERROR("wrong packet type received (type=%u) from "
- LPX64"\n", request->rq_reqmsg->type,
- request->rq_peer.peer_nid);
+ CERROR("wrong packet type received (type=%u) from %s\n",
+ request->rq_reqmsg->type,
+ ptlrpc_peernid2str(&request->rq_peer, str));
goto out;
}
* client's timeout is similar to mine, she'll be timing out this
* REQ anyway (bug 1502) */
if (timediff / 1000000 > (long)obd_timeout) {
- CERROR("Dropping timed-out request from "LPX64
- ": %ld seconds old\n",
- request->rq_peer.peer_nid, timediff / 1000000);
+ CERROR("Dropping timed-out request from %s: %ld seconds old\n",
+ ptlrpc_peernid2str(&request->rq_peer, str),
+ timediff / 1000000);
goto out;
}
}
CDEBUG(D_RPCTRACE, "Handling RPC pname:cluuid+ref:pid:xid:ni:nid:opc "
- "%s:%s+%d:%d:"LPU64":%s:"LPX64":%d\n", current->comm,
+ "%s:%s+%d:%d:"LPU64":%s:%s:%d\n", current->comm,
(request->rq_export ?
(char *)request->rq_export->exp_client_uuid.uuid : "0"),
(request->rq_export ?
atomic_read(&request->rq_export->exp_refcount) : -99),
request->rq_reqmsg->status, request->rq_xid,
request->rq_peer.peer_ni->pni_name,
- request->rq_peer.peer_nid,
+ ptlrpc_peernid2str(&request->rq_peer, str),
request->rq_reqmsg->opc);
rc = svc->srv_handler(request);
CDEBUG(D_RPCTRACE, "Handled RPC pname:cluuid+ref:pid:xid:ni:nid:opc "
- "%s:%s+%d:%d:"LPU64":%s:"LPX64":%d\n", current->comm,
+ "%s:%s+%d:%d:"LPU64":%s:%s:%d\n", current->comm,
(request->rq_export ?
(char *)request->rq_export->exp_client_uuid.uuid : "0"),
(request->rq_export ?
atomic_read(&request->rq_export->exp_refcount) : -99),
request->rq_reqmsg->status, request->rq_xid,
request->rq_peer.peer_ni->pni_name,
- request->rq_peer.peer_nid,
+ ptlrpc_peernid2str(&request->rq_peer, str),
request->rq_reqmsg->opc);
put_conn:
timediff = timeval_sub(&work_end, &work_start);
CDEBUG((timediff / 1000000 > (long)obd_timeout) ? D_ERROR : D_HA,
- "request "LPU64" opc %u from NID "LPX64" processed in %ldus "
+ "request "LPU64" opc %u from NID %s processed in %ldus "
"(%ldus total)\n", request->rq_xid, request->rq_reqmsg->opc,
- request->rq_peer.peer_nid,
+ ptlrpc_peernid2str(&request->rq_peer, str),
timediff, timeval_sub(&work_end, &request->rq_arrival_time));
if (svc->srv_stats != NULL) {
struct obd_device *obd;
int nlocks;
int been_handled;
+ char str[PTL_NALFMT_SIZE];
ENTRY;
spin_lock_irqsave (&svc->srv_lock, flags);
/* If we see this, we should already have seen the warning
* in mds_steal_ack_locks() */
CWARN("All locks stolen from rs %p x"LPD64".t"LPD64
- " o%d NID"LPX64"\n",
+ " o%d NID %s\n",
rs,
rs->rs_xid, rs->rs_transno,
- rs->rs_msg.opc, exp->exp_connection->c_peer.peer_nid);
+ rs->rs_msg.opc,
+ ptlrpc_peernid2str(&exp->exp_connection->c_peer, str));
}
if ((!been_handled && rs->rs_on_net) ||
#include <stdlib.h>
#include <stdio.h>
-#include <portals/api-support.h>
#include <portals/ptlctl.h>
#include "obdctl.h"
#include "parser.h"
#include <getopt.h>
#include <string.h>
#include <mntent.h>
-#include <portals/api-support.h>
#include <portals/ptlctl.h>
#include <liblustre.h>