Whamcloud - gitweb
b=4645
authorlsy <lsy>
Tue, 2 Nov 2004 03:37:11 +0000 (03:37 +0000)
committerlsy <lsy>
Tue, 2 Nov 2004 03:37:11 +0000 (03:37 +0000)
r=adilger

print NAL number in %x format (4645)

13 files changed:
lustre/ChangeLog
lustre/obdclass/lustre_peer.c
lustre/obdclass/obd_config.c
lustre/portals/libcfs/module.c
lustre/portals/portals/api-ni.c
lustre/portals/portals/module.c
lustre/portals/router/router.c
lustre/portals/tests/ping_cli.c
lustre/portals/tests/ping_srv.c
lustre/portals/tests/sping_cli.c
lustre/portals/tests/sping_srv.c
lustre/ptlrpc/events.c
lustre/utils/llmount.c

index c898563..dc192d1 100644 (file)
@@ -27,6 +27,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - add software watchdogs to catch hung threads quickly (4941)
        - make lustrefs init script start after nfs is mounted
        - fix CWARN/ERROR duplication (4930)
+       - print NAL number in %x format (4645)
 
 2004-10-07  Cluster File Systems, Inc. <info@clusterfs.com>
        * version 1.2.7
index 4489671..9b1ec40 100644 (file)
@@ -103,7 +103,7 @@ int class_add_uuid(char *uuid, __u64 nid, __u32 nal)
                 return -ENOMEM;
         }
 
-        CDEBUG(D_INFO, "add uuid %s "LPX64" %u\n", uuid, nid, nal);
+        CDEBUG(D_INFO, "add uuid %s "LPX64" %x\n", uuid, nid, nal);
         memcpy(data->uuid, uuid, nob);
         data->nid = nid;
         data->nal = nal;
index afed455..60510a0 100644 (file)
@@ -435,7 +435,7 @@ int class_process_config(struct lustre_cfg *lcfg)
         }
         case LCFG_ADD_UUID: {
                 CDEBUG(D_IOCTL, "adding mapping from uuid %s to nid "LPX64
-                       " (%s), nal %d\n", lcfg->lcfg_inlbuf1, lcfg->lcfg_nid,
+                       " (%s), nal %x\n", lcfg->lcfg_inlbuf1, lcfg->lcfg_nid,
                        portals_nid2str(lcfg->lcfg_nal, lcfg->lcfg_nid, str),
                        lcfg->lcfg_nal);
 
@@ -662,10 +662,10 @@ int class_config_dump_handler(struct llog_handle * handle,
 
                 CDEBUG(D_INFO, "pcfg command: %d\n", pcfg->pcfg_command);
                 if (pcfg->pcfg_nal)
-                        CDEBUG(D_INFO, "         nal: %d\n",
+                        CDEBUG(D_INFO, "         nal: %x\n",
                                pcfg->pcfg_nal);
                 if (pcfg->pcfg_gw_nal)
-                        CDEBUG(D_INFO, "      gw_nal: %d\n",
+                        CDEBUG(D_INFO, "      gw_nal: %x\n",
                                pcfg->pcfg_gw_nal);
                 if (pcfg->pcfg_nid)
                         CDEBUG(D_INFO, "         nid: "LPX64"\n",
index a2422e3..c627622 100644 (file)
@@ -266,7 +266,7 @@ libcfs_nal_cmd_register(int nal, nal_cmd_handler_fn *handler, void *private)
         int                     i;
         int                     rc;
 
-        CDEBUG(D_IOCTL, "Register NAL %d, handler: %p\n", nal, handler);
+        CDEBUG(D_IOCTL, "Register NAL %x, handler: %p\n", nal, handler);
 
         down(&nal_cmd_sem);
 
@@ -302,7 +302,7 @@ libcfs_nal_cmd_unregister(int nal)
 {
         struct nal_cmd_handler *cmd;
 
-        CDEBUG(D_IOCTL, "Unregister NAL %d\n", nal);
+        CDEBUG(D_IOCTL, "Unregister NAL %x\n", nal);
 
         down(&nal_cmd_sem);
         cmd = libcfs_find_nal_cmd_handler(nal);
@@ -324,11 +324,11 @@ libcfs_nal_cmd(struct portals_cfg *pcfg)
         down(&nal_cmd_sem);
         cmd = libcfs_find_nal_cmd_handler(nal);
         if (cmd != NULL) {
-                CDEBUG(D_IOCTL, "calling handler nal: %d, cmd: %d\n", nal, 
+                CDEBUG(D_IOCTL, "calling handler nal: %x, cmd: %d\n", nal, 
                        pcfg->pcfg_command);
                 rc = cmd->nch_handler(pcfg, cmd->nch_private);
         } else {
-                CERROR("invalid nal: %d, cmd: %d\n", nal, pcfg->pcfg_command);
+                CERROR("invalid nal: %x, cmd: %d\n", nal, pcfg->pcfg_command);
         }
         up(&nal_cmd_sem);
 
@@ -464,7 +464,7 @@ static int libcfs_ioctl(struct inode *inode, struct file *file,
                         break;
                 }
 
-                CDEBUG (D_IOCTL, "nal command nal %d cmd %d\n", pcfg.pcfg_nal,
+                CDEBUG (D_IOCTL, "nal command nal %x cmd %d\n", pcfg.pcfg_nal,
                         pcfg.pcfg_command);
                 err = libcfs_nal_cmd(&pcfg);
 
index 72d3b41..7e92256 100644 (file)
@@ -165,7 +165,7 @@ void PtlFini(void)
                                 continue;
                         
                         if (nal->nal_refct != 0) {
-                                CWARN("NAL %d has outstanding refcount %d\n",
+                                CWARN("NAL %x has outstanding refcount %d\n",
                                       i, nal->nal_refct);
                                 nal->nal_ni_fini(nal);
                         }
@@ -212,11 +212,11 @@ int PtlNIInit(ptl_interface_t interface, ptl_pid_t requested_pid,
         nal->nal_handle.nal_idx = (NI_HANDLE_MAGIC & ~NI_HANDLE_MASK) | interface;
         nal->nal_handle.cookie = 0;
         
-        CDEBUG(D_OTHER, "Starting up NAL (%d) refs %d\n", interface, nal->nal_refct);
+        CDEBUG(D_OTHER, "Starting up NAL (%x) refs %d\n", interface, nal->nal_refct);
         rc = nal->nal_ni_init(nal, requested_pid, desired_limits, actual_limits);
 
         if (rc != PTL_OK) {
-                CERROR("Error %d starting up NAL %d, refs %d\n", rc,
+                CERROR("Error %d starting up NAL %x, refs %d\n", rc,
                        interface, nal->nal_refct);
                 GOTO(out, rc);
         }
index 61ef372..c1303b7 100644 (file)
@@ -81,7 +81,7 @@ static int kportal_ioctl(struct portal_ioctl_data *data,
                 ptl_handle_ni_t    nih;
                 ptl_process_id_t   pid;
 
-                CDEBUG (D_IOCTL, "Getting nid for nal [%d]\n", data->ioc_nal);
+                CDEBUG (D_IOCTL, "Getting nid for nal [%x]\n", data->ioc_nal);
 
                 err = PtlNIInit(data->ioc_nal, LUSTRE_SRV_PTL_PID, NULL,
                                 NULL, &nih);
index 448ab1f..7edc5f6 100644 (file)
@@ -56,7 +56,7 @@ kpr_register_nal (kpr_nal_interface_t *nalif, void **argp)
        struct list_head  *e;
        kpr_nal_entry_t   *ne;
 
-        CDEBUG (D_NET, "Registering NAL %d\n", nalif->kprni_nalid);
+        CDEBUG (D_NET, "Registering NAL %x\n", nalif->kprni_nalid);
 
        PORTAL_ALLOC (ne, sizeof (*ne));
        if (ne == NULL)
@@ -76,7 +76,7 @@ kpr_register_nal (kpr_nal_interface_t *nalif, void **argp)
                {
                        write_unlock_irqrestore (&kpr_rwlock, flags);
 
-                       CERROR ("Attempt to register same NAL %d twice\n", ne->kpne_interface.kprni_nalid);
+                       CERROR ("Attempt to register same NAL %x twice\n", ne->kpne_interface.kprni_nalid);
 
                        PORTAL_FREE (ne, sizeof (*ne));
                        return (-EEXIST);
@@ -126,7 +126,7 @@ kpr_upcall (int gw_nalid, ptl_nid_t gw_nid, int alive, time_t when)
         kpr_upcall_t  *u = kmalloc (sizeof (kpr_upcall_t), GFP_ATOMIC);
 
         if (u == NULL) {
-                CERROR ("Upcall out of memory: nal %d nid "LPX64" (%s) %s\n",
+                CERROR ("Upcall out of memory: nal %x nid "LPX64" (%s) %s\n",
                         gw_nalid, gw_nid,
                         portals_nid2str(gw_nalid, gw_nid, str),
                         alive ? "up" : "down");
@@ -155,14 +155,14 @@ kpr_do_notify (int byNal, int gateway_nalid, ptl_nid_t gateway_nid,
        struct list_head    *n;
         char                 str[PTL_NALFMT_SIZE];
 
-        CDEBUG (D_NET, "%s notifying [%d] "LPX64": %s\n", 
+        CDEBUG (D_NET, "%s notifying [%x] "LPX64": %s\n", 
                 byNal ? "NAL" : "userspace", 
                 gateway_nalid, gateway_nid, alive ? "up" : "down");
 
         /* can't do predictions... */
         do_gettimeofday (&now);
         if (when > now.tv_sec) {
-                CWARN ("Ignoring prediction from %s of [%d] "LPX64" %s "
+                CWARN ("Ignoring prediction from %s of [%x] "LPX64" %s "
                        "%ld seconds in the future\n", 
                        byNal ? "NAL" : "userspace", 
                        gateway_nalid, gateway_nid, 
@@ -252,7 +252,7 @@ kpr_do_notify (int byNal, int gateway_nalid, ptl_nid_t gateway_nid,
         
         if (byNal) {
                 /* It wasn't userland that notified me... */
-                CWARN ("Upcall: NAL %d NID "LPX64" (%s) is %s\n",
+                CWARN ("Upcall: NAL %x NID "LPX64" (%s) is %s\n",
                        gateway_nalid, gateway_nid,
                        portals_nid2str(gateway_nalid, gateway_nid, str),
                        alive ? "alive" : "dead");
@@ -278,7 +278,7 @@ kpr_shutdown_nal (void *arg)
        unsigned long    flags;
        kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg;
 
-        CDEBUG (D_NET, "Shutting down NAL %d\n", ne->kpne_interface.kprni_nalid);
+        CDEBUG (D_NET, "Shutting down NAL %x\n", ne->kpne_interface.kprni_nalid);
 
        LASSERT (!ne->kpne_shutdown);
        LASSERT (!in_interrupt());
@@ -294,7 +294,7 @@ kpr_deregister_nal (void *arg)
        unsigned long     flags;
        kpr_nal_entry_t  *ne = (kpr_nal_entry_t *)arg;
 
-        CDEBUG (D_NET, "Deregister NAL %d\n", ne->kpne_interface.kprni_nalid);
+        CDEBUG (D_NET, "Deregister NAL %x\n", ne->kpne_interface.kprni_nalid);
 
        LASSERT (ne->kpne_shutdown);            /* caller must have issued shutdown already */
        LASSERT (!in_interrupt());
@@ -306,7 +306,7 @@ kpr_deregister_nal (void *arg)
         /* Wait until all outstanding messages/notifications have completed */
        while (atomic_read (&ne->kpne_refcount) != 0)
        {
-               CDEBUG (D_NET, "Waiting for refcount on NAL %d to reach zero (%d)\n",
+               CDEBUG (D_NET, "Waiting for refcount on NAL %x to reach zero (%d)\n",
                        ne->kpne_interface.kprni_nalid, atomic_read (&ne->kpne_refcount));
 
                set_current_state (TASK_UNINTERRUPTIBLE);
@@ -367,7 +367,7 @@ kpr_lookup_target (void *arg, ptl_nid_t target_nid, int nob,
         /* Caller wants to know if 'target_nid' can be reached via a gateway
          * ON HER OWN NETWORK */
 
-        CDEBUG (D_NET, "lookup "LPX64" from NAL %d\n", target_nid, 
+        CDEBUG (D_NET, "lookup "LPX64" from NAL %x\n", target_nid, 
                 ne->kpne_interface.kprni_nalid);
         LASSERT (!in_interrupt());
 
@@ -411,7 +411,7 @@ kpr_lookup_target (void *arg, ptl_nid_t target_nid, int nob,
 
         /* NB can't deref 're' now; it might have been removed! */
 
-        CDEBUG (D_NET, "lookup "LPX64" from NAL %d: %d ("LPX64")\n",
+        CDEBUG (D_NET, "lookup "LPX64" from NAL %x: %d ("LPX64")\n",
                 target_nid, ne->kpne_interface.kprni_nalid, rc,
                 (rc == 0) ? *gateway_nidp : (ptl_nid_t)0);
        return (rc);
@@ -449,7 +449,7 @@ kpr_forward_packet (void *arg, kpr_fwd_desc_t *fwd)
         kpr_nal_entry_t     *tmp_ne;
         int                  rc;
 
-        CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %d\n", fwd,
+        CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %x\n", fwd,
                 target_nid, src_ne->kpne_interface.kprni_nalid);
 
         LASSERT (nob == lib_kiov_nob (fwd->kprfd_niov, fwd->kprfd_kiov));
@@ -509,8 +509,8 @@ kpr_forward_packet (void *arg, kpr_fwd_desc_t *fwd)
 
                 read_unlock (&kpr_rwlock);
 
-                CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %d: "
-                        "to "LPX64" on NAL %d\n", 
+                CDEBUG (D_NET, "forward [%p] "LPX64" from NAL %x: "
+                        "to "LPX64" on NAL %x\n", 
                         fwd, target_nid, src_ne->kpne_interface.kprni_nalid,
                         fwd->kprfd_gateway_nid, dst_ne->kpne_interface.kprni_nalid);
 
@@ -522,7 +522,7 @@ kpr_forward_packet (void *arg, kpr_fwd_desc_t *fwd)
  out:
         kpr_fwd_errors++;
 
-        CDEBUG (D_NET, "Failed to forward [%p] "LPX64" from NAL %d: %d\n", 
+        CDEBUG (D_NET, "Failed to forward [%p] "LPX64" from NAL %x: %d\n", 
                 fwd, target_nid, src_ne->kpne_interface.kprni_nalid, rc);
 
        (fwd->kprfd_callback)(fwd->kprfd_callback_arg, rc);
@@ -536,14 +536,14 @@ kpr_complete_packet (void *arg, kpr_fwd_desc_t *fwd, int error)
        kpr_nal_entry_t *dst_ne = (kpr_nal_entry_t *)arg;
        kpr_nal_entry_t *src_ne = (kpr_nal_entry_t *)fwd->kprfd_router_arg;
 
-        CDEBUG (D_NET, "complete(1) [%p] from NAL %d to NAL %d: %d\n", fwd,
+        CDEBUG (D_NET, "complete(1) [%p] from NAL %x to NAL %x: %d\n", fwd,
                 src_ne->kpne_interface.kprni_nalid, dst_ne->kpne_interface.kprni_nalid, error);
 
        atomic_dec (&dst_ne->kpne_refcount);    /* CAVEAT EMPTOR dst_ne can disappear now!!! */
 
        (fwd->kprfd_callback)(fwd->kprfd_callback_arg, error);
 
-        CDEBUG (D_NET, "complete(2) [%p] from NAL %d: %d\n", fwd,
+        CDEBUG (D_NET, "complete(2) [%p] from NAL %x: %d\n", fwd,
                 src_ne->kpne_interface.kprni_nalid, error);
 
         atomic_dec (&kpr_queue_depth);
@@ -560,7 +560,7 @@ kpr_add_route (int gateway_nalid, ptl_nid_t gateway_nid,
         kpr_gateway_entry_t *ge;
         int                  dup = 0;
 
-        CDEBUG(D_NET, "Add route: %d "LPX64" : "LPX64" - "LPX64"\n",
+        CDEBUG(D_NET, "Add route: %x "LPX64" : "LPX64" - "LPX64"\n",
                gateway_nalid, gateway_nid, lo_nid, hi_nid);
 
         if (gateway_nalid == PTL_NID_ANY ||
@@ -645,7 +645,7 @@ kpr_del_route (int gw_nalid, ptl_nid_t gw_nid,
         struct list_head  *e;
         struct list_head  *n;
 
-        CDEBUG(D_NET, "Del route [%d] "LPX64" : "LPX64" - "LPX64"\n",
+        CDEBUG(D_NET, "Del route [%x] "LPX64" : "LPX64" - "LPX64"\n",
                gw_nalid, gw_nid, lo, hi);
 
         LASSERT(!in_interrupt());
@@ -731,7 +731,7 @@ kpr_nal_cmd(struct portals_cfg *pcfg, void * private)
                 break;
                 
         case NAL_CMD_ADD_ROUTE:
-                CDEBUG(D_IOCTL, "Adding route: [%d] "LPU64" : "LPU64" - "LPU64"\n",
+                CDEBUG(D_IOCTL, "Adding route: [%x] "LPU64" : "LPU64" - "LPU64"\n",
                        pcfg->pcfg_nal, pcfg->pcfg_nid, 
                        pcfg->pcfg_nid2, pcfg->pcfg_nid3);
                 err = kpr_add_route(pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
@@ -739,7 +739,7 @@ kpr_nal_cmd(struct portals_cfg *pcfg, void * private)
                 break;
 
         case NAL_CMD_DEL_ROUTE:
-                CDEBUG (D_IOCTL, "Removing routes via [%d] "LPU64" : "LPU64" - "LPU64"\n",
+                CDEBUG (D_IOCTL, "Removing routes via [%x] "LPU64" : "LPU64" - "LPU64"\n",
                         pcfg->pcfg_gw_nal, pcfg->pcfg_nid, 
                         pcfg->pcfg_nid2, pcfg->pcfg_nid3);
                 err = kpr_del_route (pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
@@ -747,7 +747,7 @@ kpr_nal_cmd(struct portals_cfg *pcfg, void * private)
                 break;
 
         case NAL_CMD_NOTIFY_ROUTER: {
-                CDEBUG (D_IOCTL, "Notifying peer [%d] "LPU64" %s @ %ld\n",
+                CDEBUG (D_IOCTL, "Notifying peer [%x] "LPU64" %s @ %ld\n",
                         pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
                         pcfg->pcfg_flags ? "Enabling" : "Disabling",
                         (time_t)pcfg->pcfg_nid3);
index 7a3f8a0..e9a8481 100644 (file)
@@ -114,7 +114,7 @@ pingcli_start(struct portal_ioctl_data *args)
         client->tsk = current;
         client->args = args;
         CDEBUG (D_OTHER, "pingcli_setup args: nid "LPX64" (%s),  \
-                        nal %d, size %u, count: %u, timeout: %u\n",
+                        nal %x, size %u, count: %u, timeout: %u\n",
                         args->ioc_nid,
                         portals_nid2str(args->ioc_nal, args->ioc_nid, str),
                         args->ioc_nal, args->ioc_size,
@@ -142,7 +142,7 @@ pingcli_start(struct portal_ioctl_data *args)
         rc = PtlNIInit(args->ioc_nal, 0, NULL, NULL, &nih);
         if (rc != PTL_OK || rc != PTL_IFACE_DUP)
         {
-                CERROR ("NAL %d not loaded\n", args->ioc_nal);
+                CERROR ("NAL %x not loaded\n", args->ioc_nal);
                 pingcli_shutdown (nih, 4);
                 return (NULL);
         }
index dec806a..49e82af 100644 (file)
@@ -206,7 +206,7 @@ static struct pingsrv_data *pingsrv_setup(void)
        /* Aquire and initialize the proper nal for portals. */
         rc = PtlNIInit(nal, 0, NULL, NULL, &server->ni);
         if (!(rc == PTL_OK || rc == PTL_IFACE_DUP)) {
-                CDEBUG (D_OTHER, "NAL %d not loaded\n", nal);
+                CDEBUG (D_OTHER, "NAL %x not loaded\n", nal);
                 return pingsrv_shutdown (4);
         }
 
index 730ba00..d9970e7 100644 (file)
@@ -110,7 +110,7 @@ pingcli_start(struct portal_ioctl_data *args)
         client->args = args;
 
         CDEBUG (D_OTHER, "pingcli_setup args: nid "LPX64" (%s),  \
-                        nal %d, size %u, count: %u, timeout: %u\n",
+                        nal %x, size %u, count: %u, timeout: %u\n",
                         args->ioc_nid,
                         portals_nid2str(args->ioc_nid, args->ioc_nal, str),
                         args->ioc_nal, args->ioc_size,
@@ -138,7 +138,7 @@ pingcli_start(struct portal_ioctl_data *args)
         rc = PtlNIInit(args->ioc_nal, 0, NULL, NULL, &nih);
         if (rc != PTL_OK && rc != PTL_IFACE_DUP)
         {
-                CERROR ("NAL %d not loaded.\n", args->ioc_nal);
+                CERROR ("NAL %x not loaded.\n", args->ioc_nal);
                 pingcli_shutdown (nih, 4);
                 return (NULL);
         }
index f2382d1..069423d 100644 (file)
@@ -195,7 +195,7 @@ static struct pingsrv_data *pingsrv_setup(void)
 
         rc = PtlNIInit(nal, 0, NULL, NULL, &server->ni);
         if (rc != PTL_OK && rc != PTL_IFACE_DUP) {
-                CDEBUG (D_OTHER, "Nal %d not loaded.\n", nal);
+                CDEBUG (D_OTHER, "Nal %x not loaded.\n", nal);
                 return pingsrv_shutdown (4);
         }
 
index a2e5bc2..b357c77 100644 (file)
@@ -369,7 +369,7 @@ int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, struct ptlrpc_peer *peer)
                 }
         }
 
-        CERROR("Can't find ptlrpc interface for NAL %d, NID %s\n",
+        CERROR("Can't find ptlrpc interface for NAL %x, NID %s\n",
                peer_nal, portals_nid2str(peer_nal, peer_nid, str));
         return (-ENOENT);
 }
@@ -443,7 +443,7 @@ int ptlrpc_ni_init(int number, char *name, struct ptlrpc_ni *pni)
         CDEBUG(D_NET, "My pid is: %x\n", ptl_get_pid());
         
         PtlSnprintHandle(str, sizeof(str), nih);
-        CDEBUG (D_NET, "init %d %s: %s\n", number, name, str);
+        CDEBUG (D_NET, "init %x %s: %s\n", number, name, str);
 
         pni->pni_name = name;
         pni->pni_number = number;
index 4440997..60e81a5 100644 (file)
@@ -127,7 +127,7 @@ print_options(struct lustre_mount_data *lmd)
         printf("profile:         %s\n", lmd->lmd_profile);
         printf("server_nid:      "LPX64"\n", lmd->lmd_server_nid);
         printf("local_nid:       "LPX64"\n", lmd->lmd_local_nid);
-        printf("nal:             %d\n", lmd->lmd_nal);
+        printf("nal:             %x\n", lmd->lmd_nal);
         printf("server_ipaddr:   0x%x\n", lmd->lmd_server_ipaddr);
         printf("port:            %d\n", lmd->lmd_port);