Skip to content

Fix compiler warnings #1609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0f21a71
ABI Files
nmorey Dec 13, 2019
45b54ea
Documentation: Update testing doc
noaos Dec 24, 2019
c50e82a
tests: Fix exception when running the tests from the tests directory
Kamalheib Dec 22, 2019
2638d9e
vmw_pvrdma: Use QP handle when attempting to flush CQEs
bryantan-vmware Dec 29, 2019
c3ca5e9
tests: Fix exception when no IB device found
Kamalheib Jan 13, 2020
f2efdac
pyverbs: Fix PyverbsRDMAErrno() takes exactly one argument (2 given)
Kamalheib Jan 2, 2020
ed1c222
libhns: Fix for the error code when polling cq
l00436852 Nov 16, 2019
c176393
tests: Fix query GIDs
Kamalheib Jan 28, 2020
b6a2e4c
ibacm: Fix a memory leak in an acm_open_dev() error path
bvanassche Jan 13, 2020
fde23db
tests: Avoid code duplication
Kamalheib Feb 4, 2020
3410c50
ibacm: Fix bug in acm_get_ep()
Hakon-Bugge Jan 28, 2020
9ea8b13
ibacm: Do not open non InfiniBand device
Honggang-LI Feb 6, 2020
70eb4f9
tests: Fix checking page_size_cap
Kamalheib Feb 6, 2020
84c77dd
kernel-boot: Use node GUID instead of system image GUID
Feb 6, 2020
1834156
tests: Use post_recv in the right place
noaos Oct 31, 2019
1ccb52e
vmw_pvrdma: Avoid double unlock on qp->sq.lock
bryantan-vmware Feb 12, 2020
9ae86b1
libhns: Update ibvqp->state in hns_roce_u_v2_modify_qp()
l00436852 Feb 10, 2020
ae52299
libqedr: Fix user context allocation forward compatibility
Feb 12, 2020
baf9973
pyverbs: Remove errno param when raising PyverbsRDMAErrno
EdwardSro Feb 12, 2020
b904402
pyverbs: Fix port_state_to_str function
AmitMatityahu Feb 11, 2020
a0e8da1
infiniband-diags: Fix a CONSTANT_EXPRESSION_RESULT issue
Honggang-LI Feb 20, 2020
e828058
efa: Use the correct barrier between BAR writes on post send flow
gal-pressman Dec 30, 2019
3d91306
ibdiag: Compare CA device names by using the maximum length between them
Feb 23, 2020
2db5fad
libhns: Not process return value of flushing cqe
l00436852 Aug 5, 2019
1ac0868
kernel-boot: don't return 0 when failed to allocate name
Honggang-LI Dec 18, 2019
f03577f
rcopy: fix UNUSED_VALUE
Honggang-LI Feb 17, 2020
67dc1e3
Fix shiftTooManyBitsSigned issues
Honggang-LI Feb 17, 2020
14fcbb9
srp_daemon: check return value of function 'umad_init'
Honggang-LI Feb 17, 2020
46cf1fb
ibdiags: Dump only supported extended port counters
Feb 9, 2020
78b4303
infiniband-diags: Fix two Coverity 'invalidScanfFormatWidth' issues
Honggang-LI Feb 11, 2020
53a24c9
infiniband-diags: Fix memory leak in read_ibdiag_config
Honggang-LI Feb 11, 2020
bcff9ed
infiniband-diags: Fix memory leaks in ibroute.c
Honggang-LI Feb 11, 2020
9af5349
infiniband-diags: Fix memory leak in function rereg_and_test_port
Honggang-LI Feb 11, 2020
6c62820
kernel-boot: correct precision specifier
Honggang-LI Feb 11, 2020
8d16a5f
qedr: Fix USE_AFTER_FREE issues
Honggang-LI Feb 11, 2020
d8878ae
mlx5: Fix postsend actions write length
Feb 24, 2020
e2ce62c
xsrq_pingpong.c: Fix RESOURCE_LEAK issue
Honggang-LI Mar 3, 2020
58fe988
rstream.c: fix RESOURCE_LEAK issues
Honggang-LI Mar 4, 2020
30952c3
iwarp_pm_helper.c: fix RESOURCE_LEAK issue
Honggang-LI Mar 4, 2020
584811e
iwarp_pm_helper.c: fix RESOURCE_LEAK issue
Honggang-LI Mar 4, 2020
ba66d56
Bump to version 27.1
nmorey Apr 14, 2020
09cabef
Fix compiler warnings and improve variable initialization.
google-labs-jules[bot] May 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added ABI/.gitignore
Empty file.
2,761 changes: 2,761 additions & 0 deletions ABI/efa.dump

Large diffs are not rendered by default.

7,681 changes: 7,681 additions & 0 deletions ABI/ibmad.dump

Large diffs are not rendered by default.

1,187 changes: 1,187 additions & 0 deletions ABI/ibnetdisc.dump

Large diffs are not rendered by default.

1,412 changes: 1,412 additions & 0 deletions ABI/ibumad.dump

Large diffs are not rendered by default.

18,441 changes: 18,441 additions & 0 deletions ABI/ibverbs.dump

Large diffs are not rendered by default.

3,284 changes: 3,284 additions & 0 deletions ABI/mlx4.dump

Large diffs are not rendered by default.

10,571 changes: 10,571 additions & 0 deletions ABI/mlx5.dump

Large diffs are not rendered by default.

5,889 changes: 5,889 additions & 0 deletions ABI/rdmacm.dump

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ if(POLICY CMP0056)
cmake_policy(SET CMP0056 NEW)
endif()

if(POLICY CMP0148)
cmake_policy(SET CMP0148 NEW)
endif()

set(PACKAGE_NAME "RDMA")

# See Documentation/versioning.md
set(PACKAGE_VERSION "27.0")
set(PACKAGE_VERSION "27.1")
# When this is changed the values in these files need changing too:
# debian/control
# debian/libibverbs1.symbols
Expand Down Expand Up @@ -186,17 +190,19 @@ RDMA_BuildType()
include_directories(${BUILD_INCLUDE})

# Look for Python. We prefer some variant of python 3 if the system has it.
FIND_PACKAGE(PythonInterp 3 QUIET)
if (PythonInterp_FOUND)
find_package(Python COMPONENTS Interpreter Development QUIET)
if (Python_FOUND)
# pyverbs can only use python3:
if (NO_PYVERBS)
set(CYTHON_EXECUTABLE "")
else()
FIND_PACKAGE(cython)
find_package(Cython)
endif()
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
else()
# But we still must have python (be it 2) for the build process:
FIND_PACKAGE(PythonInterp REQUIRED)
find_package(Python COMPONENTS Interpreter REQUIRED)
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
set(CYTHON_EXECUTABLE "")
endif()

Expand Down Expand Up @@ -405,8 +411,9 @@ if (CYTHON_EXECUTABLE)
# find a matching -devel installation but will happily return a non-matching
# one too. We need them both to match exactly to guarantee cython does the
# right thing.
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
EXACT REQUIRED)
if (NOT Python_Development_FOUND)
message(WARNING "Python Development libraries not found. Cython modules may fail to build.")
endif()

# Get a default installation path
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
Expand Down
13 changes: 9 additions & 4 deletions Documentation/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,21 @@ valid RDMA resources for proper functioning.
- traffic() runs <num> iterations of send/recv between 2 players.

## How to run rdma-core's tests
#### Developers
The tests can be executed from ./build/bin:
./build.sh
./build/bin/run_tests.py
#### Users
The tests are not a Python package, as such they can be found under
/usr/share/doc/rdma-core-{version}/tests.
In order to run all tests:
```
cd /usr/share/doc/rdma-core-26.0/tests
python3 run_tests.py
python /usr/share/doc/rdma-core-<version>/tests/run_tests.py
```
#### Execution output
Output will be something like:
```
$ python3 run_tests.py
$ ./build/bin/run_tests.py
..........................................ss...............
----------------------------------------------------------------------
Ran 59 tests in 13.268s
Expand All @@ -70,7 +75,7 @@ that failed.

Tests can also be executed in verbose mode:
```
$ python3 run_tests.py -v
$ python3 /usr/share/doc/rdma-core-26.0/tests/run_tests.py -v
test_create_ah (test_addr.AHTest) ... ok
test_create_ah_roce (test_addr.AHTest) ... ok
test_destroy_ah (test_addr.AHTest) ... ok
Expand Down
4 changes: 2 additions & 2 deletions Documentation/udev.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ directory.
* NAME_PCI - read PCI location and topology as a source for stable names,
which won't change in any software event (reset, PCI probe e.t.c.).
Example: "ibp0s12f4".
* NAME_GUID - read system image GUID information in similar manner to
* NAME_GUID - read node GUID information in similar manner to
net MAC naming policy. Example "rocex525400c0fe123455".
* NAME_ONBOARD - read Firmware/BIOS provided index numbers for on-board devices.
Example: "ibo3".
Expand All @@ -188,7 +188,7 @@ Type of names:

* o<index> - on-board device index number
* s<slot>[f<function>] - hotplug slot index number
* x<GUID> - System image GUID
* x<GUID> - Node GUID
* [P<domain>]p<bus>s<slot>[f<function>] - PCI geographical location

Notes:
Expand Down
2 changes: 1 addition & 1 deletion buildlib/centos6.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: rdma-core
Version: 27.0
Version: 27.1
Release: 1%{?dist}
Summary: RDMA core userspace libraries and daemons

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
rdma-core (27.1-1) unstable; urgency=low

* New upstream release.

-- Nicolas Morey-Chaisemartin <[email protected]> Tue, 14 Apr 2020 10:28:20 +0200

rdma-core (27.0-1) unstable; urgency=medium

* New upstream release.
Expand Down
48 changes: 27 additions & 21 deletions ibacm/src/acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ static struct acmc_ep *acm_get_ep(int index, uint8_t port_num)
list_for_each(&dev->port[i].ep_list, ep, entry) {
if (index == inx)
return ep;
++inx;
}
}
}
Expand Down Expand Up @@ -2604,7 +2605,7 @@ static void acm_open_dev(struct ibv_device *ibdev)
struct ibv_context *verbs;
size_t size;
int i, ret;
unsigned int opened_ib_port_cnt = 0;
bool has_ib_port = false;

acm_log(1, "%s\n", ibdev->name);
verbs = ibv_open_device(ibdev);
Expand All @@ -2619,6 +2620,27 @@ static void acm_open_dev(struct ibv_device *ibdev)
goto err1;
}

for (i = 0; i < attr.phys_port_cnt; i++) {
ret = ibv_query_port(verbs, i + 1, &port_attr);
if (ret) {
acm_log(0, "ERROR - ibv_query_port (%s, %d) return (%d)\n",
ibdev->name, i + 1, ret);
continue;
}

if (port_attr.link_layer == IBV_LINK_LAYER_INFINIBAND) {
acm_log(1, "%s port %d is an InfiniBand port\n", ibdev->name, i + 1);
has_ib_port = true;
} else {
acm_log(1, "%s port %d is not an InfiniBand port\n", ibdev->name, i + 1);
}
}

if (!has_ib_port) {
acm_log(1, "%s does not support InfiniBand.\n", ibdev->name);
goto err1;
}

size = sizeof(*dev) + sizeof(struct acmc_port) * attr.phys_port_cnt;
dev = (struct acmc_device *) calloc(1, size);
if (!dev)
Expand All @@ -2630,29 +2652,13 @@ static void acm_open_dev(struct ibv_device *ibdev)
list_head_init(&dev->prov_dev_context_list);

for (i = 0; i < dev->port_cnt; i++) {
acm_log(1, "%s port %d\n", ibdev->name, i + 1);
ret = ibv_query_port(dev->device.verbs, i + 1, &port_attr);
if (ret) {
acm_log(0, "ERROR - ibv_query_port (%d)\n", ret);
continue;
}
if (port_attr.link_layer != IBV_LINK_LAYER_INFINIBAND) {
acm_log(1, "not an InfiniBand port\n");
continue;
}

acm_open_port(&dev->port[i], dev, i + 1);
opened_ib_port_cnt++;
}

if (opened_ib_port_cnt) {
list_add(&dev_list, &dev->entry);
acm_log(1, "%d InfiniBand %s opened for %s\n",
opened_ib_port_cnt,
opened_ib_port_cnt == 1 ? "port" : "ports",
ibdev->name);
return;
}
list_add(&dev_list, &dev->entry);

acm_log(1, "%s opened\n", ibdev->name);
return;

err1:
ibv_close_device(verbs);
Expand Down
2 changes: 2 additions & 0 deletions infiniband-diags/ibdiag_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ static void read_ibdiag_config(const char *file)
ibd_sakey = strtoull(val_str, NULL, 0);
} else if (strncmp(name, "nd_format",
strlen("nd_format")) == 0) {
if (ibd_nd_format)
free(ibd_nd_format);
ibd_nd_format = strdup(val_str);
}
}
Expand Down
2 changes: 1 addition & 1 deletion infiniband-diags/ibportstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static void set_port_info(ib_portid_t * dest, uint8_t * data, int portnum,

mod = portnum;
if (espeed_cap)
mod |= 1<<31;
mod |= (1U)<<31;
if (!smp_set_via(data, dest, IB_ATTR_PORT_INFO, mod, 0, srcport))
IBEXIT("smp set portinfo failed");

Expand Down
2 changes: 2 additions & 0 deletions infiniband-diags/ibroute.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ static const char *dump_multicast_tables(ib_portid_t *portid, unsigned startlid,
fprintf(stderr, "SubnGet() failed"
"; MAD status 0x%x AM 0x%x\n",
status, mod);
free(mapnd);
return NULL;
}
}
Expand Down Expand Up @@ -365,6 +366,7 @@ static const char *dump_unicast_tables(ib_portid_t *portid, int startlid,
fprintf(stderr, "SubnGet() failed"
"; MAD status 0x%x AM 0x%x\n",
status, block);
free(mapnd);
return NULL;
}
i = block * IB_SMP_DATA_SIZE;
Expand Down
3 changes: 1 addition & 2 deletions infiniband-diags/ibstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ int main(int argc, char *argv[])

if (argc) {
for (node = device_list; node; node = node->next)
if (!strncmp(node->ca_name, argv[0],
strlen(node->ca_name)))
if (!strcmp(node->ca_name, argv[0]))
break;
if (!node)
IBPANIC("'%s' IB device can't be found", argv[0]);
Expand Down
8 changes: 6 additions & 2 deletions infiniband-diags/ibtracert.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,17 @@ static Node *find_mcpath(ib_portid_t * from, int mlid)

if (get_node(node, port, from) < 0) {
IBWARN("can't reach node %s", portid2str(from));
free(node);
free(port);
return NULL;
}

node->upnode = NULL; /* root */
if ((r = new_node(node, port, from, 0)) > 0) {
if (node->type != IB_NODE_SWITCH) {
IBWARN("ibtracert from CA to CA is unsupported");
free(node);
free(port);
return NULL; /* ibtracert from host to itself is unsupported */
}

Expand Down Expand Up @@ -855,8 +859,8 @@ static int get_route(char *srcid, char *dstid) {

int main(int argc, char **argv)
{
char dstbuf[20];
char srcbuf[20];
char dstbuf[21];
char srcbuf[21];
char portsbuf[80];
char *p_first;
int len, i;
Expand Down
1 change: 1 addition & 0 deletions infiniband-diags/mcm_rereg_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ static int rereg_and_test_port(const char *guid_file, int port, int agent,
f = fopen(guid_file, "r");
if (!f) {
err("cannot open %s: %s\n", guid_file, strerror(errno));
free(list);
return -1;
}

Expand Down
29 changes: 26 additions & 3 deletions infiniband-diags/perfquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,29 @@ static void aggregate_perfcounters_ext(__be16 cap_mask, uint32_t cap_mask2)
}
}

static void dump_perfcounters_ext(char *buf, int size, __be16 cap_mask,
uint32_t cap_mask2)
{
size_t offset, tmp_offset;

mad_dump_fields(buf, size, pc, sizeof(pc), IB_PC_EXT_FIRST_F,
IB_PC_EXT_XMT_UPKTS_F);
offset = strlen(buf);

if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
mad_dump_fields(buf + offset, size - offset, pc, sizeof(pc),
IB_PC_EXT_XMT_UPKTS_F, IB_PC_EXT_LAST_F);
tmp_offset = strlen(buf + offset);
offset += tmp_offset;
}

if (htonl(cap_mask2) & IB_PM_IS_ADDL_PORT_CTRS_EXT_SUP) {
mad_dump_fields(buf + offset, size - offset, pc, sizeof(pc),
IB_PC_EXT_COUNTER_SELECT2_F,
IB_PC_EXT_ERR_LAST_F);
}
}

static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
__be16 cap_mask, uint32_t cap_mask2)
{
Expand Down Expand Up @@ -368,7 +391,7 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
&perf_count_ext.QP1Dropped);
}

mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
dump_perfcounters_ext(buf, sizeof(buf), cap_mask, cap_mask2);

printf("# Port extended counters: %s port %d (CapMask: 0x%02X CapMask2: 0x%07X)\n%s",
portid2str(portid), ALL_PORTS, ntohs(cap_mask), cap_mask2, buf);
Expand Down Expand Up @@ -415,8 +438,8 @@ static void dump_perfcounters(int extended, int timeout, __be16 cap_mask,
if (aggregate)
aggregate_perfcounters_ext(cap_mask, cap_mask2);
else
mad_dump_perfcounters_ext(buf, sizeof buf, pc,
sizeof pc);
dump_perfcounters_ext(buf, sizeof(buf), cap_mask,
cap_mask2);
}

if (!aggregate) {
Expand Down
12 changes: 8 additions & 4 deletions infiniband-diags/saquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ static int query_path_records(const struct query_cmd *q, struct sa_handle * h,
ib_path_rec_t pr;
__be64 comp_mask = 0;
uint32_t flow = 0;
__be16 qos_class = 0;
int qos_class = 0;
uint8_t reversible = 0;

memset(&pr, 0, sizeof(pr));
Expand All @@ -1059,9 +1059,13 @@ static int query_path_records(const struct query_cmd *q, struct sa_handle * h,
pr.num_path |= reversible << 7;
CHECK_AND_SET_VAL(p->pkey, 16, 0, pr.pkey, PR, PKEY);
CHECK_AND_SET_VAL(p->sl, 16, -1, pr.qos_class_sl, PR, SL);
CHECK_AND_SET_VAL((p->qos_class << 4), 16, -1, qos_class, PR, QOS_CLASS);
pr.qos_class_sl = (pr.qos_class_sl & htobe16(IB_PATH_REC_SL_MASK)) |
qos_class;

if (p->qos_class != -1) {
qos_class = p->qos_class;
comp_mask |= IB_PR_COMPMASK_QOS_CLASS;
}
ib_path_rec_set_qos_class(&pr, qos_class);

CHECK_AND_SET_VAL_AND_SEL(p->mtu, pr.mtu, PR, MTU, SELEC);
CHECK_AND_SET_VAL_AND_SEL(p->rate, pr.rate, PR, RATE, SELEC);
CHECK_AND_SET_VAL_AND_SEL(p->pkt_life, pr.pkt_life, PR, PKTLIFETIME,
Expand Down
2 changes: 1 addition & 1 deletion infiniband-diags/smpquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static const char *port_info(ib_portid_t *dest, char **argv, int argc)
portnum = strtol(argv[0], NULL, 0);
orig_portnum = portnum;
if (extended_speeds)
portnum |= 1 << 31;
portnum |= (1U) << 31;

if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
return "port info query failed";
Expand Down
9 changes: 4 additions & 5 deletions iwpmd/iwarp_pm_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ iwpm_mapped_port *reopen_iwpm_mapped_port(struct sockaddr_storage *local_addr,
__u32 flags)
{
iwpm_mapped_port *iwpm_port;
int new_sd;
int new_sd = -1;
const char *str_err = "";
int ret = check_iwpm_ip_addr(local_addr);
if (ret) {
Expand All @@ -400,10 +400,7 @@ iwpm_mapped_port *reopen_iwpm_mapped_port(struct sockaddr_storage *local_addr,
str_err = "Different local and mapped sockaddr families";
goto reopen_mapped_port_error;
}
/* get a tcp port from the host net stack */
if (flags & IWPM_FLAGS_NO_PORT_MAP) {
new_sd = -1;
} else {
if (!(flags & IWPM_FLAGS_NO_PORT_MAP)) {
if (get_iwpm_tcp_port(local_addr->ss_family, htobe16(1), mapped_addr, &new_sd))
goto reopen_mapped_port_error;
}
Expand All @@ -413,6 +410,8 @@ iwpm_mapped_port *reopen_iwpm_mapped_port(struct sockaddr_storage *local_addr,
reopen_mapped_port_error:
iwpm_debug(IWARP_PM_ALL_DBG, "reopen_iwpm_mapped_port: Could not make port mapping (%s).\n",
str_err);
if (new_sd >= 0)
close(new_sd);
return NULL;
}

Expand Down
Loading