svn commit: r331777 - stable/11/sys/ofed/drivers/infiniband/core
Hans Petter Selasky
hselasky at FreeBSD.org
Fri Mar 30 18:27:25 UTC 2018
Author: hselasky
Date: Fri Mar 30 18:27:24 2018
New Revision: 331777
URL: https://svnweb.freebsd.org/changeset/base/331777
Log:
MFC r330494:
Select RoCEv2 by default in ibcore.
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c
==============================================================================
--- stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Mar 30 18:26:29 2018 (r331776)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Fri Mar 30 18:27:24 2018 (r331777)
@@ -4137,7 +4137,6 @@ static void cma_add_one(struct ib_device *device)
struct cma_device *cma_dev;
struct rdma_id_private *id_priv;
unsigned int i;
- unsigned long supported_gids = 0;
cma_dev = kmalloc(sizeof *cma_dev, GFP_KERNEL);
if (!cma_dev)
@@ -4154,10 +4153,23 @@ static void cma_add_one(struct ib_device *device)
return;
}
for (i = rdma_start_port(device); i <= rdma_end_port(device); i++) {
+ unsigned long supported_gids;
+ unsigned int default_gid_type;
+
supported_gids = roce_gid_type_mask_support(device, i);
- WARN_ON(!supported_gids);
+
+ if (WARN_ON(!supported_gids)) {
+ /* set something valid */
+ default_gid_type = 0;
+ } else if (test_bit(IB_GID_TYPE_ROCE_UDP_ENCAP, &supported_gids)) {
+ /* prefer RoCEv2, if supported */
+ default_gid_type = IB_GID_TYPE_ROCE_UDP_ENCAP;
+ } else {
+ default_gid_type = find_first_bit(&supported_gids,
+ BITS_PER_LONG);
+ }
cma_dev->default_gid_type[i - rdma_start_port(device)] =
- find_first_bit(&supported_gids, BITS_PER_LONG);
+ default_gid_type;
}
init_completion(&cma_dev->comp);
More information about the svn-src-all
mailing list