aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cma.c
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2016-01-04 10:49:54 +0200
committerDoug Ledford <dledford@redhat.com>2016-01-19 15:26:56 -0500
commitc3efe7500add077f79d37b18e9c66df6621409b6 (patch)
treec58ce0d2c62daabae7a900fd48ea1a45614a1dd0 /drivers/infiniband/core/cma.c
parentIB/core: Rename rdma_addr_find_dmac_by_grh (diff)
downloadlinux-dev-c3efe7500add077f79d37b18e9c66df6621409b6.tar.xz
linux-dev-c3efe7500add077f79d37b18e9c66df6621409b6.zip
IB/core: Use hop-limit from IP stack for RoCE
Previously, IPV6_DEFAULT_HOPLIMIT was used as the hop limit value for RoCE. Fixing that by taking ip4_dst_hoplimit and ip6_dst_hoplimit as hop limit values. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/cma.c')
-rw-r--r--drivers/infiniband/core/cma.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index a811594b0b59..bbcfa76c2b62 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2424,7 +2424,6 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
{
struct rdma_route *route = &id_priv->id.route;
struct rdma_addr *addr = &route->addr;
- enum ib_gid_type network_gid_type;
struct cma_work *work;
int ret;
struct net_device *ndev = NULL;
@@ -2478,14 +2477,13 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
&route->path_rec->dgid);
/* Use the hint from IP Stack to select GID Type */
- network_gid_type = ib_network_to_gid_type(addr->dev_addr.network);
- if (addr->dev_addr.network != RDMA_NETWORK_IB) {
- route->path_rec->gid_type = network_gid_type;
+ if (route->path_rec->gid_type < ib_network_to_gid_type(addr->dev_addr.network))
+ route->path_rec->gid_type = ib_network_to_gid_type(addr->dev_addr.network);
+ if (((struct sockaddr *)&id_priv->id.route.addr.dst_addr)->sa_family != AF_IB)
/* TODO: get the hoplimit from the inet/inet6 device */
- route->path_rec->hop_limit = IPV6_DEFAULT_HOPLIMIT;
- } else {
+ route->path_rec->hop_limit = addr->dev_addr.hoplimit;
+ else
route->path_rec->hop_limit = 1;
- }
route->path_rec->reversible = 1;
route->path_rec->pkey = cpu_to_be16(0xffff);
route->path_rec->mtu_selector = IB_SA_EQ;