commit a05699c6bc10f463ac4220be9d8573e71d73ca63
Author: Doug Ledford <dledford(a)redhat.com>
Date: Wed Jul 31 19:50:33 2013 -0400
Forward port rhel6.5 fixes
Signed-off-by: Doug Ledford <dledford(a)redhat.com>
libibverbs-1.1.7-arg-fixes.patch | 252 ++++++++++++++++++++++++++++++++++++++
libibverbs.spec | 7 +-
2 files changed, 258 insertions(+), 1 deletions(-)
---
diff --git a/libibverbs-1.1.7-arg-fixes.patch b/libibverbs-1.1.7-arg-fixes.patch
new file mode 100644
index 0000000..63fd828
--- /dev/null
+++ b/libibverbs-1.1.7-arg-fixes.patch
@@ -0,0 +1,252 @@
+diff -up libibverbs-1.1.7/examples/rc_pingpong.c.fixes
libibverbs-1.1.7/examples/rc_pingpong.c
+--- libibverbs-1.1.7/examples/rc_pingpong.c.fixes 2013-05-06 14:50:50.000000000 -0400
++++ libibverbs-1.1.7/examples/rc_pingpong.c 2013-07-31 18:43:50.242511781 -0400
+@@ -544,12 +544,12 @@ int main(int argc, char *argv[])
+ struct timeval start, end;
+ char *ib_devname = NULL;
+ char *servername = NULL;
+- int port = 18515;
++ unsigned int port = 18515;
+ int ib_port = 1;
+- int size = 4096;
++ unsigned int size = 4096;
+ enum ibv_mtu mtu = IBV_MTU_1024;
+- int rx_depth = 500;
+- int iters = 1000;
++ unsigned int rx_depth = 500;
++ unsigned int iters = 1000;
+ int use_event = 0;
+ int routs;
+ int rcnt, scnt;
+@@ -584,8 +584,8 @@ int main(int argc, char *argv[])
+
+ switch (c) {
+ case 'p':
+- port = strtol(optarg, NULL, 0);
+- if (port < 0 || port > 65535) {
++ port = strtoul(optarg, NULL, 0);
++ if (port > 65535) {
+ usage(argv[0]);
+ return 1;
+ }
+@@ -597,14 +597,14 @@ int main(int argc, char *argv[])
+
+ case 'i':
+ ib_port = strtol(optarg, NULL, 0);
+- if (ib_port < 0) {
++ if (ib_port < 1) {
+ usage(argv[0]);
+ return 1;
+ }
+ break;
+
+ case 's':
+- size = strtol(optarg, NULL, 0);
++ size = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'm':
+@@ -616,11 +616,11 @@ int main(int argc, char *argv[])
+ break;
+
+ case 'r':
+- rx_depth = strtol(optarg, NULL, 0);
++ rx_depth = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'n':
+- iters = strtol(optarg, NULL, 0);
++ iters = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'l':
+diff -up libibverbs-1.1.7/examples/srq_pingpong.c.fixes
libibverbs-1.1.7/examples/srq_pingpong.c
+--- libibverbs-1.1.7/examples/srq_pingpong.c.fixes 2013-05-06 14:50:50.000000000 -0400
++++ libibverbs-1.1.7/examples/srq_pingpong.c 2013-07-31 18:46:47.915952519 -0400
+@@ -617,13 +617,13 @@ int main(int argc, char *argv[])
+ struct timeval start, end;
+ char *ib_devname = NULL;
+ char *servername = NULL;
+- int port = 18515;
++ unsigned int port = 18515;
+ int ib_port = 1;
+- int size = 4096;
++ unsigned int size = 4096;
+ enum ibv_mtu mtu = IBV_MTU_1024;
+- int num_qp = 16;
+- int rx_depth = 500;
+- int iters = 1000;
++ unsigned int num_qp = 16;
++ unsigned int rx_depth = 500;
++ unsigned int iters = 1000;
+ int use_event = 0;
+ int routs;
+ int rcnt, scnt;
+@@ -661,8 +661,8 @@ int main(int argc, char *argv[])
+
+ switch (c) {
+ case 'p':
+- port = strtol(optarg, NULL, 0);
+- if (port < 0 || port > 65535) {
++ port = strtoul(optarg, NULL, 0);
++ if (port > 65535) {
+ usage(argv[0]);
+ return 1;
+ }
+@@ -674,14 +674,18 @@ int main(int argc, char *argv[])
+
+ case 'i':
+ ib_port = strtol(optarg, NULL, 0);
+- if (ib_port < 0) {
++ if (ib_port < 1) {
+ usage(argv[0]);
+ return 1;
+ }
+ break;
+
+ case 's':
+- size = strtol(optarg, NULL, 0);
++ size = strtoul(optarg, NULL, 0);
++ if (size < 1) {
++ usage(argv[0]);
++ return 1;
++ }
+ break;
+
+ case 'm':
+@@ -693,15 +697,15 @@ int main(int argc, char *argv[])
+ break;
+
+ case 'q':
+- num_qp = strtol(optarg, NULL, 0);
++ num_qp = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'r':
+- rx_depth = strtol(optarg, NULL, 0);
++ rx_depth = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'n':
+- iters = strtol(optarg, NULL, 0);
++ iters = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'l':
+diff -up libibverbs-1.1.7/examples/uc_pingpong.c.fixes
libibverbs-1.1.7/examples/uc_pingpong.c
+--- libibverbs-1.1.7/examples/uc_pingpong.c.fixes 2013-07-31 18:49:48.611367303 -0400
++++ libibverbs-1.1.7/examples/uc_pingpong.c 2013-07-31 18:56:13.271986648 -0400
+@@ -532,12 +532,12 @@ int main(int argc, char *argv[])
+ struct timeval start, end;
+ char *ib_devname = NULL;
+ char *servername = NULL;
+- int port = 18515;
++ unsigned int port = 18515;
+ int ib_port = 1;
+- int size = 4096;
++ unsigned int size = 4096;
+ enum ibv_mtu mtu = IBV_MTU_1024;
+- int rx_depth = 500;
+- int iters = 1000;
++ unsigned int rx_depth = 500;
++ unsigned int iters = 1000;
+ int use_event = 0;
+ int routs;
+ int rcnt, scnt;
+@@ -572,8 +572,8 @@ int main(int argc, char *argv[])
+
+ switch (c) {
+ case 'p':
+- port = strtol(optarg, NULL, 0);
+- if (port < 0 || port > 65535) {
++ port = strtoul(optarg, NULL, 0);
++ if (port > 65535) {
+ usage(argv[0]);
+ return 1;
+ }
+@@ -585,14 +585,14 @@ int main(int argc, char *argv[])
+
+ case 'i':
+ ib_port = strtol(optarg, NULL, 0);
+- if (ib_port < 0) {
++ if (ib_port < 1) {
+ usage(argv[0]);
+ return 1;
+ }
+ break;
+
+ case 's':
+- size = strtol(optarg, NULL, 0);
++ size = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'm':
+@@ -604,11 +604,11 @@ int main(int argc, char *argv[])
+ break;
+
+ case 'r':
+- rx_depth = strtol(optarg, NULL, 0);
++ rx_depth = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'n':
+- iters = strtol(optarg, NULL, 0);
++ iters = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'l':
+diff -up libibverbs-1.1.7/examples/ud_pingpong.c.fixes
libibverbs-1.1.7/examples/ud_pingpong.c
+--- libibverbs-1.1.7/examples/ud_pingpong.c.fixes 2013-07-31 18:49:53.987320166 -0400
++++ libibverbs-1.1.7/examples/ud_pingpong.c 2013-07-31 18:55:26.609398792 -0400
+@@ -555,11 +555,11 @@ int main(int argc, char *argv[])
+ struct timeval start, end;
+ char *ib_devname = NULL;
+ char *servername = NULL;
+- int port = 18515;
++ unsigned int port = 18515;
+ int ib_port = 1;
+- int size = 2048;
+- int rx_depth = 500;
+- int iters = 1000;
++ unsigned int size = 2048;
++ unsigned int rx_depth = 500;
++ unsigned int iters = 1000;
+ int use_event = 0;
+ int routs;
+ int rcnt, scnt;
+@@ -594,7 +594,7 @@ int main(int argc, char *argv[])
+ switch (c) {
+ case 'p':
+ port = strtol(optarg, NULL, 0);
+- if (port < 0 || port > 65535) {
++ if (port > 65535) {
+ usage(argv[0]);
+ return 1;
+ }
+@@ -606,22 +606,22 @@ int main(int argc, char *argv[])
+
+ case 'i':
+ ib_port = strtol(optarg, NULL, 0);
+- if (ib_port < 0) {
++ if (ib_port < 1) {
+ usage(argv[0]);
+ return 1;
+ }
+ break;
+
+ case 's':
+- size = strtol(optarg, NULL, 0);
++ size = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'r':
+- rx_depth = strtol(optarg, NULL, 0);
++ rx_depth = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'n':
+- iters = strtol(optarg, NULL, 0);
++ iters = strtoul(optarg, NULL, 0);
+ break;
+
+ case 'l':
diff --git a/libibverbs.spec b/libibverbs.spec
index 6bc8ca5..2617885 100644
--- a/libibverbs.spec
+++ b/libibverbs.spec
@@ -1,11 +1,12 @@
Name: libibverbs
Version: 1.1.7
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A library for direct userspace use of RDMA (InfiniBand/iWARP) hardware
Group: System Environment/Libraries
License: GPLv2 or BSD
Url:
http://www.openfabrics.org/
Source:
http://www.openfabrics.org/downloads/verbs/libibverbs-%{version}.tar.gz
+Patch0: libibverbs-1.1.7-arg-fixes.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%ifnarch ia64 %{sparc} %{arm} aarch64
BuildRequires: valgrind-devel
@@ -52,6 +53,7 @@ displays information about RDMA devices.
%prep
%setup -q
+%patch0 -p1 -b .fixes
%build
%ifnarch ia64 %{sparc} %{arm} aarch64
@@ -98,6 +100,9 @@ rm -rf %{buildroot}
%{_mandir}/man1/*
%changelog
+* Wed Jul 31 2013 Doug Ledford <dledford(a)redhat.com> - 1.1.7-3
+- Misc fixes to arg processing
+
* Wed Jul 17 2013 Doug Ledford <dledford(a)redhat.com> - 1.1.7-2
- Add -fno-strict-aliasing to CFLAGS
- Fix date mismatch on old changelog entry