aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4
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/cxgb4
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/cxgb4')
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 77b0eef2aad9..97a876a0f20b 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -315,23 +315,10 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
315 __be16 peer_port, u8 tos) 315 __be16 peer_port, u8 tos)
316{ 316{
317 struct rtable *rt; 317 struct rtable *rt;
318 struct flowi fl = { 318
319 .oif = 0, 319 rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip,
320 .nl_u = { 320 peer_port, local_port, IPPROTO_TCP,
321 .ip4_u = { 321 tos, 0);
322 .daddr = peer_ip,
323 .saddr = local_ip,
324 .tos = tos}
325 },
326 .proto = IPPROTO_TCP,
327 .uli_u = {
328 .ports = {
329 .sport = local_port,
330 .dport = peer_port}
331 }
332 };
333
334 rt = ip_route_output_flow(&init_net, &fl, NULL);
335 if (IS_ERR(rt)) 322 if (IS_ERR(rt))
336 return NULL; 323 return NULL;
337 return rt; 324 return rt;