aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtrdma
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-10-31 03:54:56 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:54:56 -0400
commit21454aaad30651ba0dcc16fe5271bc12ee21f132 (patch)
treeeb525494d6f80a0e855840bc588ae1f422348b04 /net/sunrpc/xprtrdma
parent14d5e834f6b36667c7da56374645f99b6cf30814 (diff)
net: replace NIPQUAD() in net/*/
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_transport.c12
-rw-r--r--net/sunrpc/xprtrdma/transport.c14
-rw-r--r--net/sunrpc/xprtrdma/verbs.c14
3 files changed, 19 insertions, 21 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 6fb493cbd29f..f8500f018f8a 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -1048,21 +1048,21 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
1048 1048
1049 dprintk("svcrdma: new connection %p accepted with the following " 1049 dprintk("svcrdma: new connection %p accepted with the following "
1050 "attributes:\n" 1050 "attributes:\n"
1051 " local_ip : %d.%d.%d.%d\n" 1051 " local_ip : %pI4\n"
1052 " local_port : %d\n" 1052 " local_port : %d\n"
1053 " remote_ip : %d.%d.%d.%d\n" 1053 " remote_ip : %pI4\n"
1054 " remote_port : %d\n" 1054 " remote_port : %d\n"
1055 " max_sge : %d\n" 1055 " max_sge : %d\n"
1056 " sq_depth : %d\n" 1056 " sq_depth : %d\n"
1057 " max_requests : %d\n" 1057 " max_requests : %d\n"
1058 " ord : %d\n", 1058 " ord : %d\n",
1059 newxprt, 1059 newxprt,
1060 NIPQUAD(((struct sockaddr_in *)&newxprt->sc_cm_id-> 1060 &((struct sockaddr_in *)&newxprt->sc_cm_id->
1061 route.addr.src_addr)->sin_addr.s_addr), 1061 route.addr.src_addr)->sin_addr.s_addr,
1062 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> 1062 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
1063 route.addr.src_addr)->sin_port), 1063 route.addr.src_addr)->sin_port),
1064 NIPQUAD(((struct sockaddr_in *)&newxprt->sc_cm_id-> 1064 &((struct sockaddr_in *)&newxprt->sc_cm_id->
1065 route.addr.dst_addr)->sin_addr.s_addr), 1065 route.addr.dst_addr)->sin_addr.s_addr,
1066 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> 1066 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
1067 route.addr.dst_addr)->sin_port), 1067 route.addr.dst_addr)->sin_port),
1068 newxprt->sc_max_sge, 1068 newxprt->sc_max_sge,
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 9839c3d94145..1dd6123070e9 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -174,7 +174,7 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
174 174
175 buf = kzalloc(20, GFP_KERNEL); 175 buf = kzalloc(20, GFP_KERNEL);
176 if (buf) 176 if (buf)
177 snprintf(buf, 20, NIPQUAD_FMT, NIPQUAD(addr->sin_addr.s_addr)); 177 snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr);
178 xprt->address_strings[RPC_DISPLAY_ADDR] = buf; 178 xprt->address_strings[RPC_DISPLAY_ADDR] = buf;
179 179
180 buf = kzalloc(8, GFP_KERNEL); 180 buf = kzalloc(8, GFP_KERNEL);
@@ -186,8 +186,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
186 186
187 buf = kzalloc(48, GFP_KERNEL); 187 buf = kzalloc(48, GFP_KERNEL);
188 if (buf) 188 if (buf)
189 snprintf(buf, 48, "addr="NIPQUAD_FMT" port=%u proto=%s", 189 snprintf(buf, 48, "addr=%pI4 port=%u proto=%s",
190 NIPQUAD(addr->sin_addr.s_addr), 190 &addr->sin_addr.s_addr,
191 ntohs(addr->sin_port), "rdma"); 191 ntohs(addr->sin_port), "rdma");
192 xprt->address_strings[RPC_DISPLAY_ALL] = buf; 192 xprt->address_strings[RPC_DISPLAY_ALL] = buf;
193 193
@@ -204,8 +204,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
204 204
205 buf = kzalloc(30, GFP_KERNEL); 205 buf = kzalloc(30, GFP_KERNEL);
206 if (buf) 206 if (buf)
207 snprintf(buf, 30, NIPQUAD_FMT".%u.%u", 207 snprintf(buf, 30, "%pI4.%u.%u",
208 NIPQUAD(addr->sin_addr.s_addr), 208 &addr->sin_addr.s_addr,
209 ntohs(addr->sin_port) >> 8, 209 ntohs(addr->sin_port) >> 8,
210 ntohs(addr->sin_port) & 0xff); 210 ntohs(addr->sin_port) & 0xff);
211 xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; 211 xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf;
@@ -369,8 +369,8 @@ xprt_setup_rdma(struct xprt_create *args)
369 if (ntohs(sin->sin_port) != 0) 369 if (ntohs(sin->sin_port) != 0)
370 xprt_set_bound(xprt); 370 xprt_set_bound(xprt);
371 371
372 dprintk("RPC: %s: %u.%u.%u.%u:%u\n", __func__, 372 dprintk("RPC: %s: %pI4:%u\n",
373 NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port)); 373 __func__, &sin->sin_addr.s_addr, ntohs(sin->sin_port));
374 374
375 /* Set max requests */ 375 /* Set max requests */
376 cdata.max_requests = xprt->max_reqs; 376 cdata.max_requests = xprt->max_reqs;
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index a5fef5e6c323..78f7f728ef10 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -323,12 +323,11 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event)
323 case RDMA_CM_EVENT_DEVICE_REMOVAL: 323 case RDMA_CM_EVENT_DEVICE_REMOVAL:
324 connstate = -ENODEV; 324 connstate = -ENODEV;
325connected: 325connected:
326 dprintk("RPC: %s: %s: %u.%u.%u.%u:%u" 326 dprintk("RPC: %s: %s: %pI4:%u (ep 0x%p event 0x%x)\n",
327 " (ep 0x%p event 0x%x)\n",
328 __func__, 327 __func__,
329 (event->event <= 11) ? conn[event->event] : 328 (event->event <= 11) ? conn[event->event] :
330 "unknown connection error", 329 "unknown connection error",
331 NIPQUAD(addr->sin_addr.s_addr), 330 &addr->sin_addr.s_addr,
332 ntohs(addr->sin_port), 331 ntohs(addr->sin_port),
333 ep, event->event); 332 ep, event->event);
334 atomic_set(&rpcx_to_rdmax(ep->rep_xprt)->rx_buf.rb_credits, 1); 333 atomic_set(&rpcx_to_rdmax(ep->rep_xprt)->rx_buf.rb_credits, 1);
@@ -348,18 +347,17 @@ connected:
348 if (connstate == 1) { 347 if (connstate == 1) {
349 int ird = attr.max_dest_rd_atomic; 348 int ird = attr.max_dest_rd_atomic;
350 int tird = ep->rep_remote_cma.responder_resources; 349 int tird = ep->rep_remote_cma.responder_resources;
351 printk(KERN_INFO "rpcrdma: connection to %u.%u.%u.%u:%u " 350 printk(KERN_INFO "rpcrdma: connection to %pI4:%u "
352 "on %s, memreg %d slots %d ird %d%s\n", 351 "on %s, memreg %d slots %d ird %d%s\n",
353 NIPQUAD(addr->sin_addr.s_addr), 352 &addr->sin_addr.s_addr,
354 ntohs(addr->sin_port), 353 ntohs(addr->sin_port),
355 ia->ri_id->device->name, 354 ia->ri_id->device->name,
356 ia->ri_memreg_strategy, 355 ia->ri_memreg_strategy,
357 xprt->rx_buf.rb_max_requests, 356 xprt->rx_buf.rb_max_requests,
358 ird, ird < 4 && ird < tird / 2 ? " (low!)" : ""); 357 ird, ird < 4 && ird < tird / 2 ? " (low!)" : "");
359 } else if (connstate < 0) { 358 } else if (connstate < 0) {
360 printk(KERN_INFO "rpcrdma: connection to %u.%u.%u.%u:%u " 359 printk(KERN_INFO "rpcrdma: connection to %pI4:%u closed (%d)\n",
361 "closed (%d)\n", 360 &addr->sin_addr.s_addr,
362 NIPQUAD(addr->sin_addr.s_addr),
363 ntohs(addr->sin_port), 361 ntohs(addr->sin_port),
364 connstate); 362 connstate);
365 } 363 }