aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb3
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 00:00:52 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 18:08:42 -0500
commit78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch)
tree9dccc5c16bf269d53d8499064ec95a998e84c646 /drivers/infiniband/hw/cxgb3
parent1561747ddf9d28185548687b11aae7074d6129c4 (diff)
ipv4: Create and use route lookup helpers.
The idea here is this minimizes the number of places one has to edit in order to make changes to how flows are defined and used. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/cxgb3')
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index e0ccbc53fbcc..3216bcad7e82 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -338,23 +338,10 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
338 __be16 peer_port, u8 tos) 338 __be16 peer_port, u8 tos)
339{ 339{
340 struct rtable *rt; 340 struct rtable *rt;
341 struct flowi fl = { 341
342 .oif = 0, 342 rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip,
343 .nl_u = { 343 peer_port, local_port, IPPROTO_TCP,
344 .ip4_u = { 344 tos, 0);
345 .daddr = peer_ip,
346 .saddr = local_ip,
347 .tos = tos}
348 },
349 .proto = IPPROTO_TCP,
350 .uli_u = {
351 .ports = {
352 .sport = local_port,
353 .dport = peer_port}
354 }
355 };
356
357 rt = ip_route_output_flow(&init_net, &fl, NULL);
358 if (IS_ERR(rt)) 345 if (IS_ERR(rt))
359 return NULL; 346 return NULL;
360 return rt; 347 return rt;