Whamcloud - gitweb
* started getting tcpnal working with portals newconfig
authoreeb <eeb>
Tue, 28 Jun 2005 16:13:16 +0000 (16:13 +0000)
committereeb <eeb>
Tue, 28 Jun 2005 16:13:16 +0000 (16:13 +0000)
22 files changed:
lnet/include/libcfs/linux/kp30.h
lnet/include/libcfs/user-lock.h
lnet/include/libcfs/user-prim.h
lnet/include/libcfs/user-time.h
lnet/include/lnet/kpr.h [deleted file]
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-p30.h
lnet/include/lnet/lib-types.h
lnet/klnds/socklnd/socklnd.c
lnet/lnet/api-ni.c
lnet/lnet/config.c
lnet/lnet/module.c
lnet/lnet/router.c
lnet/lnet/router.h
lnet/ulnds/procapi.c
lnet/ulnds/procbridge.h
lnet/ulnds/socklnd/procapi.c
lnet/ulnds/socklnd/procbridge.h
lnet/ulnds/socklnd/tcplnd.c
lnet/ulnds/tcplnd.c
lnet/utils/portals.c
lnet/utils/wirecheck.c

index b92b83b..e495cf7 100644 (file)
@@ -177,6 +177,10 @@ do {                                                                    \
 # include <unistd.h>
 # include <time.h>
 # include <limits.h>
+# include <errno.h>
+# include <sys/ioctl.h>                         /* for _IOWR */
+
+# define CFS_MODULE_PARM(name, t, type, perm, desc)
 
 #endif /* End of !__KERNEL__ */
 
index e57200f..a4ced3d 100644 (file)
@@ -67,8 +67,10 @@ void spin_lock_bh_init(spinlock_t *lock);
 void spin_lock_bh(spinlock_t *lock);
 void spin_unlock_bh(spinlock_t *lock);
 
-#define spin_lock_irqsave(l, flags) ({ spin_lock(l); (void)flags; })
-#define spin_unlock_irqrestore(l, flags)  ({ spin_unlock(l); (void)flags; })
+static inline void 
+spin_lock_irqsave(spinlock_t *l, unsigned long f) { spin_lock(l); }
+static inline void 
+spin_unlock_irqrestore(spinlock_t *l, unsigned long f) { spin_unlock(l); }
 
 /*
  * Semaphore
@@ -149,11 +151,15 @@ typedef struct rw_semaphore rwlock_t;
 #define write_lock(l)          down_write(l)
 #define write_unlock(l)                up_write(l)
 
-#define write_lock_irqsave(l, f)       write_lock(l)
-#define write_unlock_irqrestore(l, f)  write_unlock(l)
+static inline void
+write_lock_irqsave(rwlock_t *l, unsigned long f) { write_lock(l); }
+static inline void
+write_unlock_irqrestore(rwlock_t *l, unsigned long f) { write_unlock(l); }
 
-#define read_lock_irqsave(l, f)                read_lock(l)
-#define read_unlock_irqrestore(l, f)   read_unlock(l)
+static inline void 
+read_lock_irqsave(rwlock_t *l, unsigned long f) { read_lock(l); }
+static inline void
+read_unlock_irqrestore(rwlock_t *l, unsigned long f) { read_unlock(l); }
 
 /* !__KERNEL__ */
 #endif
index 6c3410b..40b15b5 100644 (file)
@@ -154,6 +154,16 @@ int  cfs_timer_is_armed(struct cfs_timer *t);
 cfs_time_t cfs_timer_deadline(struct cfs_timer *t);
 #endif
 
+#define in_interrupt()    (0)
+
+static inline void cfs_pause(cfs_duration_t d)
+{
+        struct timespec s;
+        
+        cfs_duration_nsec(d, &s);
+        nanosleep(&s, NULL);
+}
+
 typedef void cfs_psdev_t;
 
 static inline int cfs_psdev_register(cfs_psdev_t *foo)
index 7abc9e8..1a5807f 100644 (file)
@@ -98,6 +98,11 @@ static inline cfs_duration_t cfs_time_seconds(int seconds)
         return seconds;
 }
 
+static inline time_t cfs_time_current_sec(void)
+{
+        return cfs_time_seconds(cfs_time_current());
+}
+
 static inline int cfs_time_before(cfs_time_t t1, cfs_time_t t2)
 {
         return t1 < t2;
diff --git a/lnet/include/lnet/kpr.h b/lnet/include/lnet/kpr.h
deleted file mode 100644 (file)
index bba2047..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- */
-#ifndef __PORTALS_KPR_H__
-#define __PORTALS_KPR_H__
-
-# include <portals/lib-types.h> /* for ptl_hdr_t */
-
-
-#endif /* _KPR_H */
index eb9225e..eb77d14 100644 (file)
@@ -52,7 +52,7 @@ static inline int ptl_md_exhausted (ptl_libmd_t *md)
 #define PTL_UNLOCK(flags)                                               \
         pthread_mutex_unlock(&ptl_apini.apini_mutex)
 #define PTL_MUTEX_DOWN(m) pthread_mutex_lock(m)
-#define PTL_MUTEX_UP(m)   pthread_mutex_up(m)
+#define PTL_MUTEX_UP(m)   pthread_mutex_unlock(m)
 #endif
 
 #ifdef PTL_USE_LIB_FREELIST
@@ -394,21 +394,39 @@ kpr_fwd_init (kpr_fwd_desc_t *fwd, ptl_nid_t nid, ptl_hdr_t *hdr,
 /******************************************************************************/
 
 static inline void
+ptl_ni_addref_locked(ptl_ni_t *ni) 
+{
+        LASSERT (ni->ni_refcount > 0);
+        ni->ni_refcount++;
+}
+
+static inline void
 ptl_ni_addref(ptl_ni_t *ni) 
 {
-        LASSERT (atomic_read(&ni->ni_refcount) > 0);
-        atomic_inc(&ni->ni_refcount);
+        unsigned long flags;
+        
+        PTL_LOCK(flags);
+        ptl_ni_addref_locked(ni);
+        PTL_UNLOCK(flags);
 }
 
-extern void ptl_queue_zombie_ni (ptl_ni_t *ni);
+static inline void
+ptl_ni_decref_locked(ptl_ni_t *ni)
+{
+        LASSERT (ni->ni_refcount > 0);
+        ni->ni_refcount--;
+        if (ni->ni_refcount == 0)
+                list_add_tail(&ni->ni_list, &ptl_apini.apini_zombie_nis);
+}
 
 static inline void
 ptl_ni_decref(ptl_ni_t *ni)
 {
-        /* CAVEAT EMPTOR! must NOT be holding PTL_LOCK() (deadlock) */
-        LASSERT (atomic_read(&ni->ni_refcount) > 0);
-        if (atomic_dec_and_test(&ni->ni_refcount))
-                ptl_queue_zombie_ni(ni);
+        unsigned long flags;
+        
+        PTL_LOCK(flags);
+        ptl_ni_decref_locked(ni);
+        PTL_UNLOCK(flags);
 }
 
 extern ptl_nal_t ptl_lonal;
@@ -461,6 +479,7 @@ extern void ptl_register_nal(ptl_nal_t *nal);
 extern void ptl_unregister_nal(ptl_nal_t *nal);
 extern ptl_err_t ptl_set_ip_niaddr (ptl_ni_t *ni);
 
+#ifdef __KERNEL__
 extern ptl_err_t ptl_connect(struct socket **sockp, ptl_nid_t peer_nid,
                              __u32 local_ip, __u32 peer_ip, int peer_port);
 extern void ptl_connect_console_error(int rc, ptl_nid_t peer_nid,
@@ -471,6 +490,7 @@ extern int ptl_count_acceptor_nis(ptl_ni_t **first_ni);
 extern ptl_err_t ptl_accept(struct socket *sock, __u32 magic, int choose_ni);
 extern int       ptl_acceptor_timeout(void);
 extern int       ptl_acceptor_port(void);
+#endif
 extern ptl_err_t ptl_acceptor_start(void);
 extern void      ptl_acceptor_stop(void);
 
index eb9225e..eb77d14 100644 (file)
@@ -52,7 +52,7 @@ static inline int ptl_md_exhausted (ptl_libmd_t *md)
 #define PTL_UNLOCK(flags)                                               \
         pthread_mutex_unlock(&ptl_apini.apini_mutex)
 #define PTL_MUTEX_DOWN(m) pthread_mutex_lock(m)
-#define PTL_MUTEX_UP(m)   pthread_mutex_up(m)
+#define PTL_MUTEX_UP(m)   pthread_mutex_unlock(m)
 #endif
 
 #ifdef PTL_USE_LIB_FREELIST
@@ -394,21 +394,39 @@ kpr_fwd_init (kpr_fwd_desc_t *fwd, ptl_nid_t nid, ptl_hdr_t *hdr,
 /******************************************************************************/
 
 static inline void
+ptl_ni_addref_locked(ptl_ni_t *ni) 
+{
+        LASSERT (ni->ni_refcount > 0);
+        ni->ni_refcount++;
+}
+
+static inline void
 ptl_ni_addref(ptl_ni_t *ni) 
 {
-        LASSERT (atomic_read(&ni->ni_refcount) > 0);
-        atomic_inc(&ni->ni_refcount);
+        unsigned long flags;
+        
+        PTL_LOCK(flags);
+        ptl_ni_addref_locked(ni);
+        PTL_UNLOCK(flags);
 }
 
-extern void ptl_queue_zombie_ni (ptl_ni_t *ni);
+static inline void
+ptl_ni_decref_locked(ptl_ni_t *ni)
+{
+        LASSERT (ni->ni_refcount > 0);
+        ni->ni_refcount--;
+        if (ni->ni_refcount == 0)
+                list_add_tail(&ni->ni_list, &ptl_apini.apini_zombie_nis);
+}
 
 static inline void
 ptl_ni_decref(ptl_ni_t *ni)
 {
-        /* CAVEAT EMPTOR! must NOT be holding PTL_LOCK() (deadlock) */
-        LASSERT (atomic_read(&ni->ni_refcount) > 0);
-        if (atomic_dec_and_test(&ni->ni_refcount))
-                ptl_queue_zombie_ni(ni);
+        unsigned long flags;
+        
+        PTL_LOCK(flags);
+        ptl_ni_decref_locked(ni);
+        PTL_UNLOCK(flags);
 }
 
 extern ptl_nal_t ptl_lonal;
@@ -461,6 +479,7 @@ extern void ptl_register_nal(ptl_nal_t *nal);
 extern void ptl_unregister_nal(ptl_nal_t *nal);
 extern ptl_err_t ptl_set_ip_niaddr (ptl_ni_t *ni);
 
+#ifdef __KERNEL__
 extern ptl_err_t ptl_connect(struct socket **sockp, ptl_nid_t peer_nid,
                              __u32 local_ip, __u32 peer_ip, int peer_port);
 extern void ptl_connect_console_error(int rc, ptl_nid_t peer_nid,
@@ -471,6 +490,7 @@ extern int ptl_count_acceptor_nis(ptl_ni_t **first_ni);
 extern ptl_err_t ptl_accept(struct socket *sock, __u32 magic, int choose_ni);
 extern int       ptl_acceptor_timeout(void);
 extern int       ptl_acceptor_port(void);
+#endif
 extern ptl_err_t ptl_acceptor_start(void);
 extern void      ptl_acceptor_stop(void);
 
index 477f78f..3f6c5e3 100644 (file)
@@ -266,7 +266,7 @@ typedef struct ptl_nal
 {
         /* fields managed by portals */
         struct list_head  nal_list;             /* stash in the NAL table */
-        atomic_t          nal_refcount;         /* # active instances */
+        int               nal_refcount;         /* # active instances */
 
         /* fields initialised by the NAL */
         unsigned int      nal_type;
@@ -338,7 +338,7 @@ typedef struct ptl_ni {
         void             *ni_data;              /* instance-specific data */
         ptl_nal_t        *ni_nal;               /* procedural interface */
         int               ni_shutdown;          /* shutting down? */
-        atomic_t          ni_refcount;          /* reference count */
+        int               ni_refcount;          /* reference count */
         char             *ni_interfaces[PTL_MAX_INTERFACES]; /* equivalent interfaces to use */
 } ptl_ni_t;
 
index aa400af..7fcdc58 100644 (file)
@@ -1043,7 +1043,7 @@ ksocknal_create_conn (ksock_route_t *route, struct socket *sock, int type)
                 /* lose extra ref from ptl_net2ni NB we wait for all the peers
                  * to be deleted before ni teardown can complete; i.e. ni can't
                  * disappear until all its peer table entries has gone so
-                 * there's no to account the peer's refs on ni. */
+                 * there's no need to account the peer's refs on ni. */
                 ptl_ni_decref(ni);
 
                 if (rc != 0)
index 8b1f294..6714c6c 100644 (file)
@@ -149,7 +149,8 @@ ptl_register_nal (ptl_nal_t *nal)
         LASSERT (ptl_find_nal_by_type(nal->nal_type) == NULL);
         
         list_add (&nal->nal_list, &ptl_apini.apini_nals);
-        atomic_set(&nal->nal_refcount, 0);
+        nal->nal_refcount = 0;
+
         if (nal->nal_type != LONAL)
                 LCONSOLE(0, "%s NAL registered\n",
                          libcfs_nal2str(nal->nal_type));
@@ -164,7 +165,7 @@ ptl_unregister_nal (ptl_nal_t *nal)
 
         LASSERT (ptl_apini.apini_init);
         LASSERT (ptl_find_nal_by_type(nal->nal_type) == nal);
-        LASSERT (atomic_read(&nal->nal_refcount) == 0);
+        LASSERT (nal->nal_refcount == 0);
         
         list_del (&nal->nal_list);
         if (nal->nal_type != LONAL)
@@ -548,7 +549,7 @@ ptl_net2ni (__u32 net)
                 ni = list_entry(tmp, ptl_ni_t, ni_list);
 
                 if (PTL_NIDNET(ni->ni_nid) == net) {
-                        ptl_ni_addref(ni);
+                        ptl_ni_addref_locked(ni);
                         PTL_UNLOCK(flags);
                         return ni;
                 }
@@ -565,6 +566,7 @@ ptl_count_acceptor_nis (ptl_ni_t **first_ni)
          * *first_ni so the acceptor can pass it connections "blind" to retain
          * binary compatibility. */
         int                count = 0;
+#ifdef __KERNEL__
         unsigned long      flags;
         struct list_head  *tmp;
         ptl_ni_t          *ni;
@@ -576,7 +578,7 @@ ptl_count_acceptor_nis (ptl_ni_t **first_ni)
                 if (ni->ni_nal->nal_accept != NULL) {
                         /* This NAL uses the acceptor */
                         if (count == 0 && first_ni != NULL) {
-                                ptl_ni_addref(ni);
+                                ptl_ni_addref_locked(ni);
                                 *first_ni = ni;
                         }
                         count++;
@@ -584,7 +586,7 @@ ptl_count_acceptor_nis (ptl_ni_t **first_ni)
         }
         
         PTL_UNLOCK(flags);
-        
+#endif
         return count;
 }
 
@@ -608,19 +610,6 @@ ptl_islocalnid (ptl_nid_t nid)
 }
 
 void
-ptl_queue_zombie_ni (ptl_ni_t *ni)
-{
-        unsigned long flags;
-
-        LASSERT (atomic_read(&ni->ni_refcount) == 0);
-        LASSERT (ptl_apini.apini_init);
-        
-        PTL_LOCK(flags);
-        list_add_tail(&ni->ni_list, &ptl_apini.apini_zombie_nis);
-        PTL_UNLOCK(flags);
-}
-
-void
 ptl_shutdown_nalnis (void)
 {
         int                i;
@@ -645,11 +634,8 @@ ptl_shutdown_nalnis (void)
 
                 ni->ni_shutdown = 1;
                 ptl_apini.apini_nzombie_nis++;
-                PTL_UNLOCK(flags);
 
-                ptl_ni_decref(ni); /* drop apini's ref (shutdown on last ref) */
-
-                PTL_LOCK(flags);
+                ptl_ni_decref_locked(ni); /* drop apini's ref (shutdown on last ref) */
         }
 
         /* Now wait for the NI's I just nuked to show up on apini_zombie_nis
@@ -663,19 +649,18 @@ ptl_shutdown_nalnis (void)
                         if ((i & (-i)) == i)
                                 CDEBUG(D_WARNING,"Waiting for %d zombie NIs\n",
                                        ptl_apini.apini_nzombie_nis);
-                        set_current_state(TASK_UNINTERRUPTIBLE);
-                        schedule_timeout(cfs_time_seconds(1));
+                        cfs_pause(cfs_time_seconds(1));
                         PTL_LOCK(flags);
                 }
 
                 ni = list_entry(ptl_apini.apini_zombie_nis.next,
                                 ptl_ni_t, ni_list);
                 list_del(&ni->ni_list);
+                ni->ni_nal->nal_refcount--;
 
                 PTL_UNLOCK(flags);
 
                 LASSERT (!in_interrupt());
-                atomic_dec(&ni->ni_nal->nal_refcount);
                 (ni->ni_nal->nal_shutdown)(ni);
 
                 /* can't deref nal anymore now; it might have unregistered
@@ -727,9 +712,9 @@ ptl_startup_nalnis (void)
                         nal = ptl_find_nal_by_type(nal_type);
                         if (nal != NULL) 
                                 break;
-                        
-                        PTL_MUTEX_UP(&ptl_apini.apini_nal_mutex);
 
+                        PTL_MUTEX_UP(&ptl_apini.apini_nal_mutex);
+#ifdef __KERNEL
                         if (retry) {
                                 CERROR("Can't load NAL %s, module %s\n",
                                        libcfs_nal2str(nal_type),
@@ -738,12 +723,20 @@ ptl_startup_nalnis (void)
                         }
 
                         request_module(libcfs_nal2modname(nal_type));
-
+#else
+                        CERROR("NAL %s not supported\n",
+                               libcfs_nal2str(nal_type));
+                        goto failed;
+#endif
                         PTL_MUTEX_DOWN(&ptl_apini.apini_nal_mutex);
                 }
 
-                atomic_set(&ni->ni_refcount, 1);
-                atomic_inc(&nal->nal_refcount);
+                ni->ni_refcount = 1;
+
+                PTL_LOCK(flags);
+                nal->nal_refcount++;
+                PTL_UNLOCK(flags);
+                
                 ni->ni_nal = nal;
 
                 rc = (nal->nal_startup)(ni);
@@ -753,7 +746,9 @@ ptl_startup_nalnis (void)
                 if (rc != PTL_OK) {
                         CERROR("Error %d starting up NI %s\n",
                                rc, libcfs_nal2str(nal->nal_type));
-                        atomic_dec(&nal->nal_refcount);
+                        PTL_LOCK(flags);
+                        nal->nal_refcount--;
+                        PTL_UNLOCK(flags);
                         goto failed;
                 }
 
@@ -805,8 +800,8 @@ PtlInit(int *max_interfaces)
 #else
         pthread_mutex_init(&ptl_apini.apini_mutex, NULL);
         pthread_cond_init(&ptl_apini.apini_cond, NULL);
-        pthread_mutex_init(&ptl_apini.apini_nal_mutex);
-        pthread_mutex_init(&ptl_apini.apini_api_mutex);
+        pthread_mutex_init(&ptl_apini.apini_nal_mutex, NULL);
+        pthread_mutex_init(&ptl_apini.apini_api_mutex, NULL);
 #endif
 
         ptl_apini.apini_init = 1;
index 0706bc0..2ce8a18 100644 (file)
@@ -30,6 +30,7 @@ typedef struct {                                /* tmp struct for parsing routes
 
 static int ptl_tbnob = 0;                      /* track text buf allocation */
 #define PTL_MAX_TEXTBUF_NOB     (64<<10)       /* bound allocation */
+#define PTL_SINGLE_TEXTBUF_NOB  (4<<10)
 
 void 
 ptl_syntax(char *name, char *str, int offset, int width)
@@ -187,7 +188,7 @@ ptl_parse_networks(struct list_head *nilist, char *networks)
         ptl_ni_t *ni = NULL;
         __u32     net;
 
-       if (strlen(networks) > PAGE_SIZE) {
+       if (strlen(networks) > PTL_SINGLE_TEXTBUF_NOB) {
                /* _WAY_ conservative */
                CERROR("Can't parse networks; string too long\n");
                return PTL_FAIL;
@@ -344,7 +345,7 @@ ptl_new_text_buf (int str_len)
        int             nob;
 
        nob = offsetof(ptl_text_buf_t, ptb_text[str_len + 1]);
-       if (nob > PAGE_SIZE) {
+       if (nob > PTL_SINGLE_TEXTBUF_NOB) {
                /* _way_ conservative for "route net gateway..." */
                CERROR("text buffer too big\n");
                return NULL;
@@ -566,7 +567,7 @@ int
 ptl_parse_route (char *str)
 {
        /* static scratch buffer OK (single threaded) */
-       static char       cmd[PAGE_SIZE];
+       static char       cmd[PTL_SINGLE_TEXTBUF_NOB];
 
        struct list_head  nets;
        struct list_head  gateways;
index 6b895f3..18e9ed2 100644 (file)
@@ -150,7 +150,6 @@ EXPORT_SYMBOL(ptl_finalize);
 EXPORT_SYMBOL(ptl_parse);
 EXPORT_SYMBOL(ptl_create_reply_msg);
 EXPORT_SYMBOL(ptl_net2ni);
-EXPORT_SYMBOL(ptl_queue_zombie_ni);
 
 MODULE_AUTHOR("Peter J. Braam <braam@clusterfs.com>");
 MODULE_DESCRIPTION("Portals v3.1");
index edd9669..52e5c5e 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "router.h"
 
+#ifdef __KERNEL__
+
 kpr_state_t kpr_state;
 
 static int forwarding = 0;
@@ -753,9 +755,8 @@ kpr_ctl(unsigned int cmd, void *arg)
 void
 kpr_finalise (void)
 {
-#ifdef __KERNEL__
         kpr_proc_fini();
-#endif
+
         while (!list_empty (&kpr_state.kpr_nets)) {
                 kpr_net_entry_t *ne = list_entry(kpr_state.kpr_nets.next,
                                                  kpr_net_entry_t, kpne_list);
@@ -805,10 +806,8 @@ kpr_initialise (void)
         if (rc != PTL_OK)
                 kpr_finalise();
 
-#ifdef __KERNEL__
         if (rc == PTL_OK)
                 kpr_proc_init();
-#endif
 
         return (rc == PTL_OK) ? 0 : -EINVAL;
 }
@@ -818,3 +817,56 @@ EXPORT_SYMBOL(kpr_lookup);
 EXPORT_SYMBOL(kpr_fwd_start);
 EXPORT_SYMBOL(kpr_fwd_done);
 EXPORT_SYMBOL(kpr_notify);
+
+#else
+
+ptl_nid_t
+kpr_lookup (ptl_ni_t **nip, ptl_nid_t target_nid, int nob)
+{
+        ptl_ni_t            *ni = *nip;
+        ptl_ni_t            *gwni;
+        __u32                target_net = PTL_NIDNET(target_nid);
+
+        if (ni == NULL) {                       /* ni not determined yet */
+                gwni = ptl_net2ni(target_net);  /* is it a local network? */
+                if (gwni != NULL) {
+                        *nip = gwni;
+                        return target_nid;
+                }
+        } else {                                /* ni already determined */
+                if (target_net == PTL_NIDNET(ni->ni_nid)) {
+                        ptl_ni_addref(ni);      /* extra ref so caller can drop blindly */
+                        return target_nid;
+                }
+        }
+
+        CERROR("Nid %s is not on a local network\n", 
+               libcfs_nid2str(target_nid));
+
+        return PTL_NID_ANY;
+}
+
+int
+kpr_add_route (__u32 net, ptl_nid_t gateway_nid)
+{
+        return -EOPNOTSUPP;
+}
+
+int 
+kpr_ctl(unsigned int cmd, void *arg)
+{
+        return -EINVAL;
+}
+
+void
+kpr_finalise (void)
+{
+}
+
+int
+kpr_initialise (void)
+{
+        return 0;
+}
+
+#endif
index 1688462..75df342 100644 (file)
 # define EXPORT_SYMTAB
 #endif
 
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/errno.h>
-#include <linux/proc_fs.h>
-#include <linux/init.h>
-
 #define DEBUG_SUBSYSTEM S_PTLROUTER
 
-#include <libcfs/kp30.h>
-#include <portals/kpr.h>
-#include <portals/p30.h>
 #include <portals/lib-p30.h>
 
+#ifdef __KERNEL__
+
 typedef struct
 {
         struct list_head        kpge_list;
@@ -90,5 +80,6 @@ extern kpr_state_t  kpr_state;
 
 extern void kpr_proc_init (void);
 extern void kpr_proc_fini (void);
+#endif /* __KERNEL__ */
 
 #endif /* _KPLROUTER_H */
index e404fe4..0538920 100644 (file)
@@ -59,17 +59,6 @@ void procbridge_wakeup_nal(procbridge p)
     syscall(SYS_write, p->notifier[0], buf, sizeof(buf));
 }
 
-/* forward decl */
-extern ptl_err_t procbridge_startup (ptl_ni_t *, char **);
-extern void procbridge_shutdown (ptl_ni_t *);
-extern ptl_err_t tcpnal_send(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
-                             ptl_hdr_t *hdr, int type, ptl_nid_t nid, ptl_pid_t pid,
-                             unsigned int niov, struct iovec *iov, 
-                             size_t offset, size_t len);
-extern ptl_err_t tcpnal_recv(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
-                             unsigned int niov, struct iovec *iov,
-                             size_t offset, size_t mlen, size_t rlen);
-
 ptl_nal_t tcpnal_nal = {
         .nal_type      = SOCKNAL,
         .nal_startup   = procbridge_startup,
index 72e0e39..f2de984 100644 (file)
@@ -42,4 +42,18 @@ extern void *nal_thread(void *);
 extern void set_address(bridge t,ptl_pid_t pidrequest);
 extern void procbridge_wakeup_nal(procbridge p);
 
+extern ptl_err_t procbridge_startup (ptl_ni_t *);
+extern void procbridge_shutdown (ptl_ni_t *);
+
+extern ptl_err_t tcpnal_send(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
+                             ptl_hdr_t *hdr, int type, ptl_process_id_t target,
+                             int routing, unsigned int niov, struct iovec *iov,
+                             size_t offset, size_t len);
+ptl_err_t tcpnal_recv(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
+                      unsigned int niov, struct iovec *iov,
+                      size_t offset, size_t mlen, size_t rlen);
+
+
+
+
 #endif
index e404fe4..0538920 100644 (file)
@@ -59,17 +59,6 @@ void procbridge_wakeup_nal(procbridge p)
     syscall(SYS_write, p->notifier[0], buf, sizeof(buf));
 }
 
-/* forward decl */
-extern ptl_err_t procbridge_startup (ptl_ni_t *, char **);
-extern void procbridge_shutdown (ptl_ni_t *);
-extern ptl_err_t tcpnal_send(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
-                             ptl_hdr_t *hdr, int type, ptl_nid_t nid, ptl_pid_t pid,
-                             unsigned int niov, struct iovec *iov, 
-                             size_t offset, size_t len);
-extern ptl_err_t tcpnal_recv(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
-                             unsigned int niov, struct iovec *iov,
-                             size_t offset, size_t mlen, size_t rlen);
-
 ptl_nal_t tcpnal_nal = {
         .nal_type      = SOCKNAL,
         .nal_startup   = procbridge_startup,
index 72e0e39..f2de984 100644 (file)
@@ -42,4 +42,18 @@ extern void *nal_thread(void *);
 extern void set_address(bridge t,ptl_pid_t pidrequest);
 extern void procbridge_wakeup_nal(procbridge p);
 
+extern ptl_err_t procbridge_startup (ptl_ni_t *);
+extern void procbridge_shutdown (ptl_ni_t *);
+
+extern ptl_err_t tcpnal_send(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
+                             ptl_hdr_t *hdr, int type, ptl_process_id_t target,
+                             int routing, unsigned int niov, struct iovec *iov,
+                             size_t offset, size_t len);
+ptl_err_t tcpnal_recv(ptl_ni_t *ni, void *private, ptl_msg_t *cookie,
+                      unsigned int niov, struct iovec *iov,
+                      size_t offset, size_t mlen, size_t rlen);
+
+
+
+
 #endif
index 813e134..8573a3d 100644 (file)
 #include <netinet/in.h>
 #include <pqtimer.h>
 #include <dispatch.h>
-#include <bridge.h>
-#include <ipmap.h>
+#include <procbridge.h>
 #include <connection.h>
-#include <pthread.h>
 #include <errno.h>
 #ifndef __CYGWIN__
 #include <syscall.h>
index 813e134..8573a3d 100644 (file)
 #include <netinet/in.h>
 #include <pqtimer.h>
 #include <dispatch.h>
-#include <bridge.h>
-#include <ipmap.h>
+#include <procbridge.h>
 #include <connection.h>
-#include <pthread.h>
 #include <errno.h>
 #ifndef __CYGWIN__
 #include <syscall.h>
index 4543da9..0bd7f8e 100644 (file)
@@ -831,8 +831,8 @@ jt_ptl_print_active_txs (int argc, char **argv)
                         "%s, %s, state %d\n",
                         data.ioc_u32[0],
                         data.ioc_count,
-                        data.ioc_nid,
-                        data.ioc_u64[0],
+                        libcfs_nid2str(data.ioc_nid),
+                        libcfs_nid2str(data.ioc_u64[0]),
                         data.ioc_u32[1],
                         (data.ioc_flags & 1) ? "delayed" : "immediate",
                         (data.ioc_flags & 2) ? "nblk"    : "normal",
index bab9cb7..9cb4c4f 100644 (file)
@@ -4,15 +4,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <portals/api-support.h>
-
-/* This ghastly hack to allows me to include lib-types.h It doesn't affect any
- * assertions generated here (but fails-safe if it ever does) */
-typedef struct {
-        int     counter;
-} atomic_t;
-
-#include <portals/lib-types.h>
+#include <portals/lib-p30.h>
 
 #include <string.h>