MOD_LINK=elf64_ia64
;;
+ x86_64 )
+ AC_MSG_RESULT($host_cpu)
+ KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000 -fno-strength-reduce -fno-asynchronous-unwind-tables'
+ KCPPFLAGS='-D__KERNEL__ -DMODULE'
+ MOD_LINK=elf_x86_64
+;;
+
sparc64 )
AC_MSG_RESULT($host_cpu)
KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs'
#define S_COBD (21 << 24)
#define S_PTLBD (22 << 24)
#define S_LOG (23 << 24)
+#define S_MGMT (24 << 24)
/* If you change these values, please keep portals/linux/utils/debug.c
* up to date! */
#define _P30_TYPES_H_
#ifdef __linux__
-#include <asm/types.h>
-#include <asm/timex.h>
+# include <asm/types.h>
+# include <asm/timex.h>
#else
-#include <sys/types.h>
+# include <sys/types.h>
typedef u_int32_t __u32;
typedef u_int64_t __u64;
-typedef unsigned long long cycles_t;
-static inline cycles_t get_cycles(void) { return 0; }
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL)
#endif
typedef __u64 ptl_nid_t;
typedef ptl_handle_any_t ptl_handle_me_t;
#define PTL_HANDLE_NONE \
-((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
+ ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
#define PTL_EQ_NONE PTL_HANDLE_NONE
static inline int PtlHandleEqual (ptl_handle_any_t h1, ptl_handle_any_t h2)
ptl_handle_me_t unlinked_me;
ptl_md_t mem_desc;
ptl_hdr_data_t hdr_data;
- cycles_t arrival_time;
+ struct timeval arrival_time;
volatile ptl_seq_t sequence;
} ptl_event_t;
-
typedef enum {
PTL_ACK_REQ,
PTL_NOACK_REQ
} ptl_ack_req_t;
-
typedef struct {
volatile ptl_seq_t sequence;
ptl_size_t size;
ptl_eq_t *eq;
} ptl_ni_t;
-
typedef struct {
int max_match_entries; /* max number of match entries */
int max_mem_descriptors; /* max number of memory descriptors */
memset(debug_buf, 0, debug_size);
debug_wrapped = 0;
- printk(KERN_INFO "Portals: allocated %lu byte debug buffer at %p.\n",
- bufsize, debug_buf);
+ //printk(KERN_INFO "Portals: allocated %lu byte debug buffer at %p.\n",
+ //bufsize, debug_buf);
atomic_set(&debug_off_a, debug_off);
notifier_chain_register(&panic_notifier_list, &lustre_panic_notifier);
debug_size = bufsize;
msg->send_ack = 0;
msg->md = md;
- msg->ev.arrival_time = get_cycles();
+ do_gettimeofday(&msg->ev.arrival_time);
md->pending++;
if (md->threshold != PTL_MD_THRESH_INF) {
LASSERT (md->threshold > 0);
#include <stdio.h>
#include <sys/types.h>
+#include <netdb.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#include <netdb.h>
return ((e == NULL) ? "???" : e->name);
}
+static struct hostent *
+ptl_gethostbyname(char * hname) {
+ struct hostent *he;
+ he = gethostbyname(hname);
+ if (!he) {
+ switch(h_errno) {
+ case HOST_NOT_FOUND:
+ case NO_ADDRESS:
+ fprintf(stderr, "Unable to resolve hostname: %s\n",
+ hname);
+ break;
+ default:
+ fprintf(stderr, "gethostbyname error: %s\n",
+ strerror(errno));
+ break;
+ }
+ return NULL;
+ }
+ return he;
+}
+
int
ptl_parse_nid (ptl_nid_t *nidp, char *str)
{
if ((('a' <= str[0] && str[0] <= 'z') ||
('A' <= str[0] && str[0] <= 'Z')) &&
- (he = gethostbyname (str)) != NULL)
+ (he = ptl_gethostbyname (str)) != NULL)
{
__u32 addr = *(__u32 *)he->h_addr;
goto usage;
}
- he = gethostbyname(argv[1]);
- if (!he) {
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ he = ptl_gethostbyname(argv[1]);
+ if (!he)
return -1;
- }
g_port = atol(argv[2]);
PORTAL_IOC_INIT(data);
if (argc == 2) {
- he = gethostbyname(argv[1]);
- if (!he) {
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ he = ptl_gethostbyname(argv[1]);
+ if (!he)
return -1;
- }
data.ioc_nid = ntohl (*(__u32 *)he->h_addr); /* HOST byte order */
PORTAL_IOC_INIT(data);
if (argc == 2) {
- he = gethostbyname(argv[1]);
- if (!he) {
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ he = ptl_gethostbyname(argv[1]);
+ if (!he)
return -1;
- }
data.ioc_nid = ntohl (*(__u32 *)he->h_addr); /* HOST byte order */
MOD_LINK=elf64_ia64
;;
+ x86_64 )
+ AC_MSG_RESULT($host_cpu)
+ KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000 -fno-strength-reduce -fno-asynchronous-unwind-tables'
+ KCPPFLAGS='-D__KERNEL__ -DMODULE'
+ MOD_LINK=elf_x86_64
+;;
+
sparc64 )
AC_MSG_RESULT($host_cpu)
KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs'
#define S_COBD (21 << 24)
#define S_PTLBD (22 << 24)
#define S_LOG (23 << 24)
+#define S_MGMT (24 << 24)
/* If you change these values, please keep portals/linux/utils/debug.c
* up to date! */
#define _P30_TYPES_H_
#ifdef __linux__
-#include <asm/types.h>
-#include <asm/timex.h>
+# include <asm/types.h>
+# include <asm/timex.h>
#else
-#include <sys/types.h>
+# include <sys/types.h>
typedef u_int32_t __u32;
typedef u_int64_t __u64;
-typedef unsigned long long cycles_t;
-static inline cycles_t get_cycles(void) { return 0; }
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL)
#endif
typedef __u64 ptl_nid_t;
typedef ptl_handle_any_t ptl_handle_me_t;
#define PTL_HANDLE_NONE \
-((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
+ ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1})
#define PTL_EQ_NONE PTL_HANDLE_NONE
static inline int PtlHandleEqual (ptl_handle_any_t h1, ptl_handle_any_t h2)
ptl_handle_me_t unlinked_me;
ptl_md_t mem_desc;
ptl_hdr_data_t hdr_data;
- cycles_t arrival_time;
+ struct timeval arrival_time;
volatile ptl_seq_t sequence;
} ptl_event_t;
-
typedef enum {
PTL_ACK_REQ,
PTL_NOACK_REQ
} ptl_ack_req_t;
-
typedef struct {
volatile ptl_seq_t sequence;
ptl_size_t size;
ptl_eq_t *eq;
} ptl_ni_t;
-
typedef struct {
int max_match_entries; /* max number of match entries */
int max_mem_descriptors; /* max number of memory descriptors */
memset(debug_buf, 0, debug_size);
debug_wrapped = 0;
- printk(KERN_INFO "Portals: allocated %lu byte debug buffer at %p.\n",
- bufsize, debug_buf);
+ //printk(KERN_INFO "Portals: allocated %lu byte debug buffer at %p.\n",
+ //bufsize, debug_buf);
atomic_set(&debug_off_a, debug_off);
notifier_chain_register(&panic_notifier_list, &lustre_panic_notifier);
debug_size = bufsize;
msg->send_ack = 0;
msg->md = md;
- msg->ev.arrival_time = get_cycles();
+ do_gettimeofday(&msg->ev.arrival_time);
md->pending++;
if (md->threshold != PTL_MD_THRESH_INF) {
LASSERT (md->threshold > 0);
#include <stdio.h>
#include <sys/types.h>
+#include <netdb.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#include <netdb.h>
return ((e == NULL) ? "???" : e->name);
}
+static struct hostent *
+ptl_gethostbyname(char * hname) {
+ struct hostent *he;
+ he = gethostbyname(hname);
+ if (!he) {
+ switch(h_errno) {
+ case HOST_NOT_FOUND:
+ case NO_ADDRESS:
+ fprintf(stderr, "Unable to resolve hostname: %s\n",
+ hname);
+ break;
+ default:
+ fprintf(stderr, "gethostbyname error: %s\n",
+ strerror(errno));
+ break;
+ }
+ return NULL;
+ }
+ return he;
+}
+
int
ptl_parse_nid (ptl_nid_t *nidp, char *str)
{
if ((('a' <= str[0] && str[0] <= 'z') ||
('A' <= str[0] && str[0] <= 'Z')) &&
- (he = gethostbyname (str)) != NULL)
+ (he = ptl_gethostbyname (str)) != NULL)
{
__u32 addr = *(__u32 *)he->h_addr;
goto usage;
}
- he = gethostbyname(argv[1]);
- if (!he) {
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ he = ptl_gethostbyname(argv[1]);
+ if (!he)
return -1;
- }
g_port = atol(argv[2]);
PORTAL_IOC_INIT(data);
if (argc == 2) {
- he = gethostbyname(argv[1]);
- if (!he) {
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ he = ptl_gethostbyname(argv[1]);
+ if (!he)
return -1;
- }
data.ioc_nid = ntohl (*(__u32 *)he->h_addr); /* HOST byte order */
PORTAL_IOC_INIT(data);
if (argc == 2) {
- he = gethostbyname(argv[1]);
- if (!he) {
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ he = ptl_gethostbyname(argv[1]);
+ if (!he)
return -1;
- }
data.ioc_nid = ntohl (*(__u32 *)he->h_addr); /* HOST byte order */