* [PATCH 2/9] Remove HAVE_VALGRIND_MEMCHECK_H/INCLUDE_VALGRIND
From: Jason Gunthorpe @ 2016-09-29 20:47 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Sean Hefty, Hal Rosenstock, Doug Ledford, Yishai Hadas,
Vladimir Sokolovsky, Bart Van Assche
In-Reply-To: <1475182076-5411-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
The cmake build system guarantees that valgrind/memcheck.h is present.
If the system does not have it, or valgrind is disabled, then it is
replaced with a dummy header full of empty stubs.
Thus all the copy&paste boiler plate is consolidated into buildlib.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
buildlib/config.h.in | 4 ----
libibcm/src/cm.c | 11 +----------
libibumad/src/umad.c | 14 +-------------
libibverbs/src/ibverbs.h | 14 +-------------
libmlx4/src/mlx4.h | 18 +-----------------
libmlx5/src/mlx5.h | 18 +-----------------
libmthca/src/mthca.h | 18 +-----------------
librdmacm/src/cma.h | 11 +----------
srp_daemon/srp_daemon/srp_daemon.h | 5 -----
9 files changed, 7 insertions(+), 106 deletions(-)
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 0a87457e6d7a..a02be9cfb0f7 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -21,10 +21,6 @@
// FIXME: Remove this, The cmake version hard-requires new style CLOEXEC support
#define STREAM_CLOEXEC "e"
-// FIXME: Remove this, cmake always provides a valgrind/memcheck.h
-#define HAVE_VALGRIND_MEMCHECK_H 1
-#define INCLUDE_VALGRIND 1
-
#define IBV_CONFIG_DIR "@CONFIG_DIR@"
#define RS_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma/rsocket"
#define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf"
diff --git a/libibcm/src/cm.c b/libibcm/src/cm.c
index ebe36bef89e6..f775923aa73c 100644
--- a/libibcm/src/cm.c
+++ b/libibcm/src/cm.c
@@ -49,16 +49,7 @@
#include <infiniband/driver.h>
#include <infiniband/marshall.h>
-#ifdef INCLUDE_VALGRIND
-# include <valgrind/memcheck.h>
-# ifndef VALGRIND_MAKE_MEM_DEFINED
-# warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined"
-# endif
-#endif
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr,len)
-#endif
+#include <valgrind/memcheck.h>
#define PFX "libibcm: "
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
index 176d112e125b..0c969f1eb8ad 100644
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -52,19 +52,7 @@
#define IB_OPENIB_OUI (0x001405)
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-
-# include <valgrind/memcheck.h>
-
-# ifndef VALGRIND_MAKE_MEM_DEFINED
-# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_DEFINED not available"
-# endif
-
-#endif /* HAVE_VALGRIND_MEMCHECK_H */
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr,len)
-#endif
+#include <valgrind/memcheck.h>
typedef struct ib_user_mad_reg_req {
uint32_t id;
diff --git a/libibverbs/src/ibverbs.h b/libibverbs/src/ibverbs.h
index 062a490915b0..7892af4ad247 100644
--- a/libibverbs/src/ibverbs.h
+++ b/libibverbs/src/ibverbs.h
@@ -38,19 +38,7 @@
#include <infiniband/driver.h>
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-
-# include <valgrind/memcheck.h>
-
-# ifndef VALGRIND_MAKE_MEM_DEFINED
-# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_DEFINED not available"
-# endif
-
-#endif /* HAVE_VALGRIND_MEMCHECK_H */
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr, len) 0
-#endif
+#include <valgrind/memcheck.h>
#define HIDDEN __attribute__((visibility ("hidden")))
diff --git a/libmlx4/src/mlx4.h b/libmlx4/src/mlx4.h
index feea3386f9a7..4551141d2007 100644
--- a/libmlx4/src/mlx4.h
+++ b/libmlx4/src/mlx4.h
@@ -47,23 +47,7 @@
#define uninitialized_var(x) x = x
#endif
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-
-# include <valgrind/memcheck.h>
-
-# if !defined(VALGRIND_MAKE_MEM_DEFINED) || !defined(VALGRIND_MAKE_MEM_UNDEFINED)
-# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_(UN)DEFINED not available"
-# endif
-
-#endif /* HAVE_VALGRIND_MEMCHECK_H */
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr,len)
-#endif
-
-#ifndef VALGRIND_MAKE_MEM_UNDEFINED
-# define VALGRIND_MAKE_MEM_UNDEFINED(addr,len)
-#endif
+#include <valgrind/memcheck.h>
#ifndef rmb
# define rmb() mb()
diff --git a/libmlx5/src/mlx5.h b/libmlx5/src/mlx5.h
index 6c4e83002028..aa8b6feceb4e 100644
--- a/libmlx5/src/mlx5.h
+++ b/libmlx5/src/mlx5.h
@@ -52,23 +52,7 @@
#define uninitialized_var(x) x = x
#endif
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-
-# include <valgrind/memcheck.h>
-
-# if !defined(VALGRIND_MAKE_MEM_DEFINED) || !defined(VALGRIND_MAKE_MEM_UNDEFINED)
-# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_(UN)DEFINED not available"
-# endif
-
-#endif /* HAVE_VALGRIND_MEMCHECK_H */
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr, len)
-#endif
-
-#ifndef VALGRIND_MAKE_MEM_UNDEFINED
-# define VALGRIND_MAKE_MEM_UNDEFINED(addr, len)
-#endif
+#include <valgrind/memcheck.h>
#ifndef rmb
# define rmb() mb()
diff --git a/libmthca/src/mthca.h b/libmthca/src/mthca.h
index bd1e7a2b1dc0..18d52291343f 100644
--- a/libmthca/src/mthca.h
+++ b/libmthca/src/mthca.h
@@ -39,23 +39,7 @@
#include <infiniband/driver.h>
#include <infiniband/arch.h>
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-
-# include <valgrind/memcheck.h>
-
-# if !defined(VALGRIND_MAKE_MEM_DEFINED) || !defined(VALGRIND_MAKE_MEM_UNDEFINED)
-# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_(UN)DEFINED not available"
-# endif
-
-#endif /* HAVE_VALGRIND_MEMCHECK_H */
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr,len)
-#endif
-
-#ifndef VALGRIND_MAKE_MEM_UNDEFINED
-# define VALGRIND_MAKE_MEM_UNDEFINED(addr,len)
-#endif
+#include <valgrind/memcheck.h>
#ifndef rmb
# define rmb() mb()
diff --git a/librdmacm/src/cma.h b/librdmacm/src/cma.h
index d6005538227f..16a55a67af9e 100644
--- a/librdmacm/src/cma.h
+++ b/librdmacm/src/cma.h
@@ -47,16 +47,7 @@
#include <ccan/minmax.h>
-#ifdef INCLUDE_VALGRIND
-# include <valgrind/memcheck.h>
-# ifndef VALGRIND_MAKE_MEM_DEFINED
-# warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined"
-# endif
-#endif
-
-#ifndef VALGRIND_MAKE_MEM_DEFINED
-# define VALGRIND_MAKE_MEM_DEFINED(addr,len)
-#endif
+#include <valgrind/memcheck.h>
#define PFX "librdmacm: "
diff --git a/srp_daemon/srp_daemon/srp_daemon.h b/srp_daemon/srp_daemon/srp_daemon.h
index 6d1575519bc3..d6a2d8a84728 100644
--- a/srp_daemon/srp_daemon/srp_daemon.h
+++ b/srp_daemon/srp_daemon/srp_daemon.h
@@ -408,12 +408,7 @@ typedef struct {
char filler[MAD_BLOCK_SIZE];
} srp_ib_user_mad_t;
-#if defined(HAVE_VALGRIND_DRD_H) && defined(ENABLE_VALGRIND)
#include <valgrind/drd.h>
-#endif
-#ifndef ANNOTATE_BENIGN_RACE_SIZED
-#define ANNOTATE_BENIGN_RACE_SIZED(a, b, c) do { } while(0)
-#endif
#define pr_human(arg...) \
do { \
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH 1/9] Remove HAVE_CONFIG_H
From: Jason Gunthorpe @ 2016-09-29 20:47 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Steve Wise, Mike Marciniszyn, Dennis Dalessandro,
Tatyana Nikolova, Sean Hefty, Hal Rosenstock, Doug Ledford,
Yishai Hadas, Vladimir Sokolovsky, Devesh Sharma, Moni Shoua,
open list:HF1 USERSPACE PROVIDER for hf1.ko
In-Reply-To: <1475182076-5411-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
The cmake build system guarantees this header exists, we do not need
the define or the test.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 2 --
ibacm/prov/acmp/src/acmp.c | 4 +---
ibacm/src/acm.c | 4 +---
ibacm/src/acme.c | 4 +---
ibacm/src/libacm.c | 4 +---
libcxgb3/src/cq.c | 4 +---
libcxgb3/src/iwch.c | 4 +---
libcxgb3/src/qp.c | 4 +---
libcxgb3/src/verbs.c | 4 +---
libcxgb4/src/cq.c | 4 +---
libcxgb4/src/dev.c | 4 +---
libcxgb4/src/qp.c | 4 +---
libcxgb4/src/verbs.c | 4 +---
libhfi1verbs/src/hfiverbs.c | 4 +---
libhfi1verbs/src/verbs.c | 4 +---
libi40iw/src/i40iw_umain.c | 2 --
libi40iw/src/i40iw_uverbs.c | 2 --
libibcm/src/cm.c | 4 +---
libibumad/src/sysfs.c | 4 +---
libibumad/src/umad.c | 4 +---
libibumad/tests/umad_reg2_compat.c | 4 +---
libibumad/tests/umad_register2.c | 4 +---
libibverbs/examples/asyncwatch.c | 4 +---
libibverbs/examples/device_list.c | 4 +---
libibverbs/examples/devinfo.c | 4 +---
libibverbs/examples/rc_pingpong.c | 4 +---
libibverbs/examples/srq_pingpong.c | 4 +---
libibverbs/examples/uc_pingpong.c | 4 +---
libibverbs/examples/ud_pingpong.c | 4 +---
libibverbs/examples/xsrq_pingpong.c | 4 +---
libibverbs/src/cmd.c | 4 +---
libibverbs/src/compat-1_0.c | 4 +---
libibverbs/src/device.c | 4 +---
libibverbs/src/init.c | 4 +---
libibverbs/src/marshall.c | 4 +---
libibverbs/src/memory.c | 4 +---
libibverbs/src/sysfs.c | 4 +---
libibverbs/src/verbs.c | 4 +---
libipathverbs/src/ipathverbs.c | 4 +---
libipathverbs/src/verbs.c | 4 +---
libmlx4/src/buf.c | 4 +---
libmlx4/src/cq.c | 4 +---
libmlx4/src/dbrec.c | 4 +---
libmlx4/src/mlx4.c | 4 +---
libmlx4/src/qp.c | 4 +---
libmlx4/src/srq.c | 4 +---
libmlx4/src/verbs.c | 4 +---
libmlx5/src/buf.c | 4 +---
libmlx5/src/cq.c | 5 +----
libmlx5/src/dbrec.c | 4 +---
libmlx5/src/mlx5.c | 4 +---
libmlx5/src/qp.c | 5 +----
libmlx5/src/srq.c | 4 +---
libmlx5/src/verbs.c | 4 +---
libmthca/src/ah.c | 4 +---
libmthca/src/buf.c | 4 +---
libmthca/src/cq.c | 4 +---
libmthca/src/memfree.c | 4 +---
libmthca/src/mthca.c | 4 +---
libmthca/src/qp.c | 4 +---
libmthca/src/srq.c | 4 +---
libmthca/src/verbs.c | 4 +---
libnes/src/nes_umain.c | 2 --
libnes/src/nes_uverbs.c | 2 --
libocrdma/src/ocrdma_main.c | 2 --
libocrdma/src/ocrdma_verbs.c | 2 --
librdmacm/src/acm.c | 4 +---
librdmacm/src/addrinfo.c | 4 +---
librdmacm/src/cma.c | 4 +---
librdmacm/src/cma.h | 4 +---
librdmacm/src/indexer.c | 4 +---
librdmacm/src/indexer.h | 4 +---
librdmacm/src/preload.c | 4 +---
librdmacm/src/rsocket.c | 4 +---
librxe/src/rxe.c | 4 +---
75 files changed, 68 insertions(+), 220 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e9e13262899..a6fc092d7994 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,8 +93,6 @@ endif()
# Setup the basic C compiler
RDMA_BuildType()
include_directories(${BUILD_INCLUDE})
-# FIXME: Eliminate HAVE_CONFIG_H, we always have it.
-add_definitions(-DHAVE_CONFIG_H)
# Require GNU99 mode
RDMA_EnableCStd()
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index 75231bfef04f..ed68bd706f76 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -28,9 +28,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdarg.h>
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 41429e1db4d7..146fbff61857 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -28,9 +28,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdarg.h>
diff --git a/ibacm/src/acme.c b/ibacm/src/acme.c
index 4b5fe684c8e2..e96d36ff9fc0 100644
--- a/ibacm/src/acme.c
+++ b/ibacm/src/acme.c
@@ -28,9 +28,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/ibacm/src/libacm.c b/ibacm/src/libacm.c
index 3ad1db1d307b..def5b2cf5892 100644
--- a/ibacm/src/libacm.c
+++ b/ibacm/src/libacm.c
@@ -28,9 +28,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <osd.h>
#include "libacm.h"
diff --git a/libcxgb3/src/cq.c b/libcxgb3/src/cq.c
index a6393d7b4fe3..1510d1e78631 100644
--- a/libcxgb3/src/cq.c
+++ b/libcxgb3/src/cq.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <netinet/in.h>
diff --git a/libcxgb3/src/iwch.c b/libcxgb3/src/iwch.c
index dd0d3711f2e2..aa9b10879d7a 100644
--- a/libcxgb3/src/iwch.c
+++ b/libcxgb3/src/iwch.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libcxgb3/src/qp.c b/libcxgb3/src/qp.c
index 7dd3c7e342a7..30dd898f6e87 100644
--- a/libcxgb3/src/qp.c
+++ b/libcxgb3/src/qp.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libcxgb3/src/verbs.c b/libcxgb3/src/verbs.c
index a2b737f2a192..0cb78d753d41 100644
--- a/libcxgb3/src/verbs.c
+++ b/libcxgb3/src/verbs.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/libcxgb4/src/cq.c b/libcxgb4/src/cq.c
index a33d48488967..1ed7dfdb88d4 100644
--- a/libcxgb4/src/cq.c
+++ b/libcxgb4/src/cq.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <syslog.h>
diff --git a/libcxgb4/src/dev.c b/libcxgb4/src/dev.c
index 8c3ecddc6a14..316fc0569f48 100644
--- a/libcxgb4/src/dev.c
+++ b/libcxgb4/src/dev.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libcxgb4/src/qp.c b/libcxgb4/src/qp.c
index 5444137c44bd..3c6d021095fc 100644
--- a/libcxgb4/src/qp.c
+++ b/libcxgb4/src/qp.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <assert.h>
#include <stdlib.h>
diff --git a/libcxgb4/src/verbs.c b/libcxgb4/src/verbs.c
index aed547dc8ab1..70d250f30701 100644
--- a/libcxgb4/src/verbs.c
+++ b/libcxgb4/src/verbs.c
@@ -29,9 +29,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/libhfi1verbs/src/hfiverbs.c b/libhfi1verbs/src/hfiverbs.c
index ced438d1a70b..d2b7dd450992 100644
--- a/libhfi1verbs/src/hfiverbs.c
+++ b/libhfi1verbs/src/hfiverbs.c
@@ -55,9 +55,7 @@
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libhfi1verbs/src/verbs.c b/libhfi1verbs/src/verbs.c
index e245ad9e5b4f..20d4352094af 100644
--- a/libhfi1verbs/src/verbs.c
+++ b/libhfi1verbs/src/verbs.c
@@ -55,9 +55,7 @@
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libi40iw/src/i40iw_umain.c b/libi40iw/src/i40iw_umain.c
index ef694a025075..1756e65ee6be 100644
--- a/libi40iw/src/i40iw_umain.c
+++ b/libi40iw/src/i40iw_umain.c
@@ -32,9 +32,7 @@
*
*******************************************************************************/
-#if HAVE_CONFIG_H
#include <config.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
diff --git a/libi40iw/src/i40iw_uverbs.c b/libi40iw/src/i40iw_uverbs.c
index 8369e10f61ee..3a6799a9b50f 100644
--- a/libi40iw/src/i40iw_uverbs.c
+++ b/libi40iw/src/i40iw_uverbs.c
@@ -32,9 +32,7 @@
*
*******************************************************************************/
-#if HAVE_CONFIG_H
#include <config.h>
-#endif
#include <stdlib.h>
#include <stdio.h>
diff --git a/libibcm/src/cm.c b/libibcm/src/cm.c
index f5318f01fb61..ebe36bef89e6 100644
--- a/libibcm/src/cm.c
+++ b/libibcm/src/cm.c
@@ -33,9 +33,7 @@
* $Id$
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <string.h>
diff --git a/libibumad/src/sysfs.c b/libibumad/src/sysfs.c
index 5d9460851897..d10f312285ea 100644
--- a/libibumad/src/sysfs.c
+++ b/libibumad/src/sysfs.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <inttypes.h>
#include <string.h>
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
index a7879d385466..176d112e125b 100644
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -32,9 +32,7 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <sys/poll.h>
#include <unistd.h>
diff --git a/libibumad/tests/umad_reg2_compat.c b/libibumad/tests/umad_reg2_compat.c
index 9c239ee4bfae..264882ccc0c1 100644
--- a/libibumad/tests/umad_reg2_compat.c
+++ b/libibumad/tests/umad_reg2_compat.c
@@ -31,9 +31,7 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <string.h>
#include <stdio.h>
diff --git a/libibumad/tests/umad_register2.c b/libibumad/tests/umad_register2.c
index ed7e816bb63c..7a9b655ae794 100644
--- a/libibumad/tests/umad_register2.c
+++ b/libibumad/tests/umad_register2.c
@@ -31,9 +31,7 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <string.h>
#include <stdio.h>
diff --git a/libibverbs/examples/asyncwatch.c b/libibverbs/examples/asyncwatch.c
index c78994d24bed..7af13bf936ec 100644
--- a/libibverbs/examples/asyncwatch.c
+++ b/libibverbs/examples/asyncwatch.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <endian.h>
diff --git a/libibverbs/examples/device_list.c b/libibverbs/examples/device_list.c
index 70c3af51b6c3..13f40ad63007 100644
--- a/libibverbs/examples/device_list.c
+++ b/libibverbs/examples/device_list.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c
index e814bacdf7aa..5fd1affa455d 100644
--- a/libibverbs/examples/devinfo.c
+++ b/libibverbs/examples/devinfo.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libibverbs/examples/rc_pingpong.c b/libibverbs/examples/rc_pingpong.c
index 5aa3417c6e23..c92e551c00e6 100644
--- a/libibverbs/examples/rc_pingpong.c
+++ b/libibverbs/examples/rc_pingpong.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
index f17972580b57..863ff10dd0f4 100644
--- a/libibverbs/examples/srq_pingpong.c
+++ b/libibverbs/examples/srq_pingpong.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libibverbs/examples/uc_pingpong.c b/libibverbs/examples/uc_pingpong.c
index 7d982d36a5ef..2b105b947cf3 100644
--- a/libibverbs/examples/uc_pingpong.c
+++ b/libibverbs/examples/uc_pingpong.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libibverbs/examples/ud_pingpong.c b/libibverbs/examples/ud_pingpong.c
index deefb9b81013..d0cd73cc0fae 100644
--- a/libibverbs/examples/ud_pingpong.c
+++ b/libibverbs/examples/ud_pingpong.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libibverbs/examples/xsrq_pingpong.c b/libibverbs/examples/xsrq_pingpong.c
index 903548ed6824..c22893e0e721 100644
--- a/libibverbs/examples/xsrq_pingpong.c
+++ b/libibverbs/examples/xsrq_pingpong.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <fcntl.h>
diff --git a/libibverbs/src/cmd.c b/libibverbs/src/cmd.c
index 11f65095b784..06a017b0c9b8 100644
--- a/libibverbs/src/cmd.c
+++ b/libibverbs/src/cmd.c
@@ -32,9 +32,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/libibverbs/src/compat-1_0.c b/libibverbs/src/compat-1_0.c
index 6b1961d19ede..b286fd73eb01 100644
--- a/libibverbs/src/compat-1_0.c
+++ b/libibverbs/src/compat-1_0.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <string.h>
#include <stddef.h>
diff --git a/libibverbs/src/device.c b/libibverbs/src/device.c
index cfdf7cfd337c..b4864e3e384b 100644
--- a/libibverbs/src/device.c
+++ b/libibverbs/src/device.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <netinet/in.h>
diff --git a/libibverbs/src/init.c b/libibverbs/src/init.c
index 7ae0fc87d332..779756938a32 100644
--- a/libibverbs/src/init.c
+++ b/libibverbs/src/init.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <string.h>
diff --git a/libibverbs/src/marshall.c b/libibverbs/src/marshall.c
index 577b4b1ec2f9..a33048404d35 100644
--- a/libibverbs/src/marshall.c
+++ b/libibverbs/src/marshall.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <string.h>
diff --git a/libibverbs/src/memory.c b/libibverbs/src/memory.c
index 89509c6e356f..8e728c4f61fc 100644
--- a/libibverbs/src/memory.c
+++ b/libibverbs/src/memory.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <errno.h>
#include <sys/mman.h>
diff --git a/libibverbs/src/sysfs.c b/libibverbs/src/sysfs.c
index 2e68da4bc97f..d463241ade08 100644
--- a/libibverbs/src/sysfs.c
+++ b/libibverbs/src/sysfs.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libibverbs/src/verbs.c b/libibverbs/src/verbs.c
index debb6f687111..b470ba043658 100644
--- a/libibverbs/src/verbs.c
+++ b/libibverbs/src/verbs.c
@@ -32,9 +32,7 @@
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <netinet/in.h>
diff --git a/libipathverbs/src/ipathverbs.c b/libipathverbs/src/ipathverbs.c
index 2ae1689a1131..9a19d0ab98ae 100644
--- a/libipathverbs/src/ipathverbs.c
+++ b/libipathverbs/src/ipathverbs.c
@@ -35,9 +35,7 @@
* product whatsoever.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libipathverbs/src/verbs.c b/libipathverbs/src/verbs.c
index 578a38af3428..12ca35f32189 100644
--- a/libipathverbs/src/verbs.c
+++ b/libipathverbs/src/verbs.c
@@ -35,9 +35,7 @@
* product whatsoever.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmlx4/src/buf.c b/libmlx4/src/buf.c
index c06b3fded82c..9b41e7f62525 100644
--- a/libmlx4/src/buf.c
+++ b/libmlx4/src/buf.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/libmlx4/src/cq.c b/libmlx4/src/cq.c
index 2edbec8e327d..23cc3ed69dc8 100644
--- a/libmlx4/src/cq.c
+++ b/libmlx4/src/cq.c
@@ -32,9 +32,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmlx4/src/dbrec.c b/libmlx4/src/dbrec.c
index 21ff93664df4..26d696fb94ae 100644
--- a/libmlx4/src/dbrec.c
+++ b/libmlx4/src/dbrec.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmlx4/src/mlx4.c b/libmlx4/src/mlx4.c
index 1757ca325447..326ead4136f8 100644
--- a/libmlx4/src/mlx4.c
+++ b/libmlx4/src/mlx4.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmlx4/src/qp.c b/libmlx4/src/qp.c
index 1b730bfea4b8..4b5acd71108e 100644
--- a/libmlx4/src/qp.c
+++ b/libmlx4/src/qp.c
@@ -32,9 +32,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmlx4/src/srq.c b/libmlx4/src/srq.c
index 28bc2d41cdce..c0e028671828 100644
--- a/libmlx4/src/srq.c
+++ b/libmlx4/src/srq.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmlx4/src/verbs.c b/libmlx4/src/verbs.c
index 5cc82cf38763..50a44340639b 100644
--- a/libmlx4/src/verbs.c
+++ b/libmlx4/src/verbs.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/libmlx5/src/buf.c b/libmlx5/src/buf.c
index 1a681c6a3eaf..7e06095d0352 100644
--- a/libmlx5/src/buf.c
+++ b/libmlx5/src/buf.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <signal.h>
#include <sys/ipc.h>
diff --git a/libmlx5/src/cq.c b/libmlx5/src/cq.c
index 5ad076c40d91..2a53c897706f 100644
--- a/libmlx5/src/cq.c
+++ b/libmlx5/src/cq.c
@@ -30,10 +30,7 @@
* SOFTWARE.
*/
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmlx5/src/dbrec.c b/libmlx5/src/dbrec.c
index dbc0e650b6f4..3af81124ed95 100644
--- a/libmlx5/src/dbrec.c
+++ b/libmlx5/src/dbrec.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmlx5/src/mlx5.c b/libmlx5/src/mlx5.c
index 058b52fcd5f6..121a833062f1 100644
--- a/libmlx5/src/mlx5.c
+++ b/libmlx5/src/mlx5.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmlx5/src/qp.c b/libmlx5/src/qp.c
index 9363fddc3f3c..04abe1588d6e 100644
--- a/libmlx5/src/qp.c
+++ b/libmlx5/src/qp.c
@@ -30,10 +30,7 @@
* SOFTWARE.
*/
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmlx5/src/srq.c b/libmlx5/src/srq.c
index 24979bfb69ab..a06afa3a5931 100644
--- a/libmlx5/src/srq.c
+++ b/libmlx5/src/srq.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmlx5/src/verbs.c b/libmlx5/src/verbs.c
index 4be602be8025..58673f4433fd 100644
--- a/libmlx5/src/verbs.c
+++ b/libmlx5/src/verbs.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/libmthca/src/ah.c b/libmthca/src/ah.c
index d7494d57f960..e83d66527839 100644
--- a/libmthca/src/ah.c
+++ b/libmthca/src/ah.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmthca/src/buf.c b/libmthca/src/buf.c
index 074a5f8dc710..78e7b89c4db5 100644
--- a/libmthca/src/buf.c
+++ b/libmthca/src/buf.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <sys/mman.h>
diff --git a/libmthca/src/cq.c b/libmthca/src/cq.c
index 8b4a6a862d1a..d71d430c6e28 100644
--- a/libmthca/src/cq.c
+++ b/libmthca/src/cq.c
@@ -32,9 +32,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmthca/src/memfree.c b/libmthca/src/memfree.c
index 87de4c0f5899..77a80e24b95f 100644
--- a/libmthca/src/memfree.c
+++ b/libmthca/src/memfree.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmthca/src/mthca.c b/libmthca/src/mthca.c
index e33bf7ff8559..d6bda2d29d66 100644
--- a/libmthca/src/mthca.c
+++ b/libmthca/src/mthca.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libmthca/src/qp.c b/libmthca/src/qp.c
index 84dd206d9125..715ca65e9bd6 100644
--- a/libmthca/src/qp.c
+++ b/libmthca/src/qp.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmthca/src/srq.c b/libmthca/src/srq.c
index 97a0c743f5f7..ff6f532733f4 100644
--- a/libmthca/src/srq.c
+++ b/libmthca/src/srq.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <netinet/in.h>
diff --git a/libmthca/src/verbs.c b/libmthca/src/verbs.c
index b6782c9865eb..b3bce82affae 100644
--- a/libmthca/src/verbs.c
+++ b/libmthca/src/verbs.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/libnes/src/nes_umain.c b/libnes/src/nes_umain.c
index 16ce3f13c702..b4e0bc136160 100644
--- a/libnes/src/nes_umain.c
+++ b/libnes/src/nes_umain.c
@@ -31,9 +31,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
#include <config.h>
-#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
diff --git a/libnes/src/nes_uverbs.c b/libnes/src/nes_uverbs.c
index 983d87a80b8b..7c2454e7f55a 100644
--- a/libnes/src/nes_uverbs.c
+++ b/libnes/src/nes_uverbs.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
#include <config.h>
-#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <stdio.h>
diff --git a/libocrdma/src/ocrdma_main.c b/libocrdma/src/ocrdma_main.c
index 064ecb318c4c..f3830d9fc5d3 100644
--- a/libocrdma/src/ocrdma_main.c
+++ b/libocrdma/src/ocrdma_main.c
@@ -32,9 +32,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if HAVE_CONFIG_H
#include <config.h>
-#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
diff --git a/libocrdma/src/ocrdma_verbs.c b/libocrdma/src/ocrdma_verbs.c
index 628e4bf18b43..6d58cb219fe1 100644
--- a/libocrdma/src/ocrdma_verbs.c
+++ b/libocrdma/src/ocrdma_verbs.c
@@ -32,9 +32,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if HAVE_CONFIG_H
#include <config.h>
-#endif /* HAVE_CONFIG_H */
#include <assert.h>
#include <stdlib.h>
diff --git a/librdmacm/src/acm.c b/librdmacm/src/acm.c
index 823381aac367..ad6706b2592e 100644
--- a/librdmacm/src/acm.c
+++ b/librdmacm/src/acm.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <inttypes.h>
diff --git a/librdmacm/src/addrinfo.c b/librdmacm/src/addrinfo.c
index 046b8be11be1..2f4e674e1ebb 100644
--- a/librdmacm/src/addrinfo.c
+++ b/librdmacm/src/addrinfo.c
@@ -32,9 +32,7 @@
* $Id: cm.c 3453 2005-09-15 21:43:21Z sean.hefty $
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/librdmacm/src/cma.c b/librdmacm/src/cma.c
index a89e663bcaab..77f6fea38c6b 100644
--- a/librdmacm/src/cma.c
+++ b/librdmacm/src/cma.c
@@ -30,9 +30,7 @@
* SOFTWARE.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <string.h>
diff --git a/librdmacm/src/cma.h b/librdmacm/src/cma.h
index ce428deba849..d6005538227f 100644
--- a/librdmacm/src/cma.h
+++ b/librdmacm/src/cma.h
@@ -34,9 +34,7 @@
#if !defined(CMA_H)
#define CMA_H
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/librdmacm/src/indexer.c b/librdmacm/src/indexer.c
index be2e69c895c2..00be7d04cc93 100644
--- a/librdmacm/src/indexer.c
+++ b/librdmacm/src/indexer.c
@@ -31,9 +31,7 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <errno.h>
#include <sys/types.h>
diff --git a/librdmacm/src/indexer.h b/librdmacm/src/indexer.h
index 0c5f3882673f..2d1e46ecabd4 100644
--- a/librdmacm/src/indexer.h
+++ b/librdmacm/src/indexer.h
@@ -34,9 +34,7 @@
#if !defined(INDEXER_H)
#define INDEXER_H
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <sys/types.h>
diff --git a/librdmacm/src/preload.c b/librdmacm/src/preload.c
index 2a90f79b226c..cf258bf8eb3a 100644
--- a/librdmacm/src/preload.c
+++ b/librdmacm/src/preload.c
@@ -31,9 +31,7 @@
*
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/librdmacm/src/rsocket.c b/librdmacm/src/rsocket.c
index 488d44fb3654..7e7a38ee82b6 100644
--- a/librdmacm/src/rsocket.c
+++ b/librdmacm/src/rsocket.c
@@ -31,9 +31,7 @@
*
*/
#define _GNU_SOURCE
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/librxe/src/rxe.c b/librxe/src/rxe.c
index 7164f6627171..6bd04d696c41 100644
--- a/librxe/src/rxe.c
+++ b/librxe/src/rxe.c
@@ -37,9 +37,7 @@
* product whatsoever.
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH rdma-core 0/9] Dead Code Removal
From: Jason Gunthorpe @ 2016-09-29 20:47 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
This removes various #ifdef type stuff that no longer makes any sense.
cmake is arranged in a way that avoids alot of the ifdefs around header files.
The BYTE_ORDER patch is more substantial and consolidates everything around
glibc's endian.h
See
https://github.com/linux-rdma/rdma-core/pull/10
Jason Gunthorpe (9):
Remove HAVE_CONFIG_H
Remove HAVE_VALGRIND_MEMCHECK_H/INCLUDE_VALGRIND
Remove HAVE_IBV_*
Do not use IBV_CMD_(REG_MR|RESIZE_CQ)_HAS_RESP_PARAMS
Remove HAVE_SYMVER_SUPPORT
Remove old compat definitions of wmb/rmb/etc
Remove old MADV_DONTFORK/DOFORK compat
Remove most checks of __BYTE_ORDER
nes: Remove code guarded by HAVE_DECL_IBV_QPT_RAW_ETH
CMakeLists.txt | 2 -
buildlib/config.h.in | 13 --
ibacm/linux/osd.h | 8 +-
ibacm/prov/acmp/src/acmp.c | 4 +-
ibacm/src/acm.c | 4 +-
ibacm/src/acme.c | 4 +-
ibacm/src/libacm.c | 4 +-
libcxgb3/src/cq.c | 4 +-
libcxgb3/src/cxio_wr.h | 10 +-
libcxgb3/src/iwch.c | 4 +-
libcxgb3/src/qp.c | 4 +-
libcxgb3/src/verbs.c | 4 +-
libcxgb4/src/cq.c | 4 +-
libcxgb4/src/dev.c | 4 +-
libcxgb4/src/qp.c | 4 +-
libcxgb4/src/t4.h | 11 +-
libcxgb4/src/verbs.c | 4 +-
libhfi1verbs/src/hfiverbs.c | 22 +--
libhfi1verbs/src/verbs.c | 19 +-
libi40iw/src/i40iw_umain.c | 2 -
libi40iw/src/i40iw_umain.h | 18 +-
libi40iw/src/i40iw_uverbs.c | 28 ---
libibcm/src/cm.c | 15 +-
libibumad/src/sysfs.c | 12 +-
libibumad/src/umad.c | 18 +-
libibumad/tests/umad_reg2_compat.c | 4 +-
libibumad/tests/umad_register2.c | 4 +-
libibverbs/examples/asyncwatch.c | 4 +-
libibverbs/examples/device_list.c | 4 +-
libibverbs/examples/devinfo.c | 4 +-
libibverbs/examples/rc_pingpong.c | 4 +-
libibverbs/examples/srq_pingpong.c | 4 +-
libibverbs/examples/uc_pingpong.c | 4 +-
libibverbs/examples/ud_pingpong.c | 4 +-
libibverbs/examples/xsrq_pingpong.c | 4 +-
libibverbs/include/infiniband/arch.h | 15 +-
libibverbs/src/cmd.c | 4 +-
libibverbs/src/compat-1_0.c | 4 +-
libibverbs/src/device.c | 4 +-
libibverbs/src/ibverbs.h | 25 +--
libibverbs/src/init.c | 4 +-
libibverbs/src/marshall.c | 4 +-
libibverbs/src/memory.c | 15 +-
libibverbs/src/sysfs.c | 4 +-
libibverbs/src/verbs.c | 4 +-
libipathverbs/src/ipathverbs.c | 22 +--
libipathverbs/src/verbs.c | 20 +-
libmlx4/src/buf.c | 4 +-
libmlx4/src/cq.c | 4 +-
libmlx4/src/dbrec.c | 4 +-
libmlx4/src/mlx4.c | 4 +-
libmlx4/src/mlx4.h | 42 +---
libmlx4/src/qp.c | 4 +-
libmlx4/src/srq.c | 4 +-
libmlx4/src/verbs.c | 4 +-
libmlx5/src/buf.c | 23 +--
libmlx5/src/cq.c | 5 +-
libmlx5/src/dbrec.c | 4 +-
libmlx5/src/mlx5.c | 8 +-
libmlx5/src/mlx5.h | 40 +---
libmlx5/src/qp.c | 5 +-
libmlx5/src/srq.c | 4 +-
libmlx5/src/verbs.c | 24 +--
libmthca/src/ah.c | 4 +-
libmthca/src/buf.c | 23 +--
libmthca/src/cq.c | 4 +-
libmthca/src/memfree.c | 4 +-
libmthca/src/mthca.c | 62 +-----
libmthca/src/mthca.h | 26 +--
libmthca/src/qp.c | 4 +-
libmthca/src/srq.c | 4 +-
libmthca/src/verbs.c | 30 +--
libnes/src/nes_umain.c | 2 -
libnes/src/nes_umain.h | 17 +-
libnes/src/nes_uverbs.c | 359 -----------------------------------
libocrdma/src/ocrdma_main.c | 2 -
libocrdma/src/ocrdma_verbs.c | 34 +---
librdmacm/examples/common.h | 11 +-
librdmacm/src/acm.c | 4 +-
librdmacm/src/addrinfo.c | 4 +-
librdmacm/src/cma.c | 4 +-
librdmacm/src/cma.h | 24 +--
librdmacm/src/indexer.c | 4 +-
librdmacm/src/indexer.h | 4 +-
librdmacm/src/preload.c | 4 +-
librdmacm/src/rsocket.c | 4 +-
librxe/src/rxe.c | 34 +---
srp_daemon/srp_daemon/srp_daemon.h | 22 +--
88 files changed, 124 insertions(+), 1144 deletions(-)
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* PROBLEM: nvmet rxe : Kernel oops when running nvmf IO over rdma_rxe
From: Stephen Bates @ 2016-09-29 20:10 UTC (permalink / raw)
To: linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, hch-jcswGhMUV9g,
sagi-NQWnxTmZq1alnMjI0IkVqw, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w
Cc: Stephen Bates
Hi All
So I thought I would try and run NVMe over Fabrics over
Soft-RoCE. Both were adding to 4.8 so what could possibly go wrong
;-). I am getting a pretty consistent kernel oops so I though I would
post this so people could take a look.
Cheers
Stephen
Problem
-------
Kernel panics when attempting to run NVMe over Fabrics I/O over
soft-RoCE.
Interestingly nvme discover and connect seem to go well. In some cases
I even seem to be able to issue some IO against the /dev/nvme0n1
device on the host. However pretty quick I get a kernel oops on the
target as shown below.
My testing of soft-roce itself using userspace tools like ib_write_bw
seem to be passing. So I am thinking the interaction between the
kernel space interface for RXE and NVMf are not playing well
together.
Suspect Modules
---------------
nvmet, rdma_rxe
Steps to Reproduce
------------------
1. Monolithic 4.8-rc8 kernel. I can provide a .config if people want
it.
2. Boot up two QEMU instances connected together via a e1000 vNIC and
a QEMU socket connection.
3. Bind rdma_rxe to the relevant ethernet ports on each VM using the
rxe_cfg user-space tool.
4. Setup NVMf target namespace on the target. I did this was a short
shell script.
5. Do nvme discover and connect on host (I used nvme-cli for this).
6. Try and issue IO on the NVMe block device created on the host.
Some of this is recorded in my qemu-minimal Github repo which you can
find here:
https://github.com/sbates130272/qemu-minimal
Oops Trace
-----------
I am including a couple of lines before the oops because I suspect
they might be relevant. addr2line decodes the last addrss in the call
trace as
ida_simple_remove(&nvmet_rdma_queue_ida, queue->idx);
[ 272.511262] nvmet: creating controller 1 for NQN
nqn.2014-08.org.nvmexpress:NVMf:uuid:1fa5a811-6324-42bb-aab0-3e1fa4d14b90.
[ 272.758552] nvmet: adding queue 1 to ctrl 1.
[ 313.308896] nvmet_rdma: freeing queue 1
[ 313.310315] nvmet_rdma: freeing queue 0
[ 313.313056] general protection fault: 0000 [#1] SMP
[ 313.313672] Modules linked in:
[ 313.314015] CPU: 0 PID: 420 Comm: kworker/0:1 Not tainted 4.8.0-rc8
#50
[ 313.314015] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org
04/01/2014
[ 313.314015] Workqueue: events nvmet_rdma_release_queue_work
[ 313.314015] task: ffff88007c728000 task.stack: ffff88007c750000
[ 313.314015] RIP: 0010:[<ffffffff81453500>] [<ffffffff81453500>]
nvmet_rdma_free_rsps+0x80/0x110
[ 313.314015] RSP: 0018:ffff88007c753db8 EFLAGS: 00010282
[ 313.314015] RAX: dead000000000200 RBX: ffff8800795c1320 RCX:
00000001810000e9
[ 313.314015] RDX: dead000000000100 RSI: ffffea0001f07f80 RDI:
0000000040000000
[ 313.314015] RBP: ffff88007c753de0 R08: 000000007c1feb01 R09:
00000001810000e9
[ 313.314015] R10: ffffea0001f07f00 R11: ffffea0001f25800 R12:
0000000000001320
[ 313.314015] R13: 0000000000008800 R14: ffff88007c2c6a00 R15:
ffff88007b93e400
[ 313.314015] FS: 0000000000000000(0000) GS:ffff88007fc00000(0000)
knlGS:0000000000000000
[ 313.314015] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 313.314015] CR2: 00007f13ddc13005 CR3: 000000007c1d4000 CR4:
00000000000006f0
[ 313.314015] Stack:
[ 313.314015] ffff88007c2c6a00 0000000000000002 ffff88007c1adc00
ffff88007fc1b500
[ 313.314015] ffff88007c2c6ac8 ffff88007c753df8 ffffffff814537b9
ffff88007b93e400
[ 313.314015] ffff88007c753e20 ffffffff81453820 ffff88007d3bfd80
ffff88007fc17040
[ 313.314015] Call Trace:
[ 313.314015] [<ffffffff814537b9>] nvmet_rdma_free_queue+0x49/0x90
[ 313.314015] [<ffffffff81453820>]
nvmet_rdma_release_queue_work+0x20/0x50
[ 313.314015] [<ffffffff8106d856>] process_one_work+0x146/0x410
[ 313.314015] [<ffffffff8106deb1>] worker_thread+0x61/0x490
[ 313.314015] [<ffffffff8106de50>] ? rescuer_thread+0x330/0x330
[ 313.314015] [<ffffffff8106de50>] ? rescuer_thread+0x330/0x330
[ 313.314015] [<ffffffff81072c06>] kthread+0xd6/0xf0
[ 313.314015] [<ffffffff8173ae8f>] ret_from_fork+0x1f/0x40
[ 313.314015] [<ffffffff81072b30>] ? kthread_park+0x50/0x50
[ 313.314015] Code: c4 20 02 00 00 e8 b1 b2 d1 ff 4d 39 ec 0f 84 82
00 00 00 4c 89 e3 49 03 9e a0 00 00 00 48 8b 83 18 02 00 00 48 8b 93
10 02 00 00 <48> 89 42 08 48 89 10 48 b8 00 01 00 00 00 00 ad de 48 89
83 10
[ 313.314015] RIP [<ffffffff81453500>]
nvmet_rdma_free_rsps+0x80/0x110
[ 313.314015] RSP <ffff88007c753db8>
ver_linux
---------
Linux cgy1-donard 4.6.0+3-00004-ga573b70 #118 SMP Fri Jun 3 15:21:30
MDT 2016 x86_64 GNU/Linux
GNU C 4.9.2
GNU Make 4.0
Binutils 2.25
Util-linux 2.25.2
Mount 2.25.2
Linux C Library 2.19
Dynamic linker (ldd) 2.19
Procps 3.3.9
Kbd 1.15.5
Console-tools 1.15.5
Sh-utils 8.23
Udev 215
Modules Loaded ablk_helper acpi_cpufreq aesni_intel
aes_x86_64 ahci ansi_cprng auth_rpcgss autofs4 binfmt_misc bridge
br_netfilter btrfs button configfs coretemp crc32c_intel cryptd cxgb4
dca dm_mod drbg edac_core ehci_hcd ehci_pci evdev ext4 fscache fuse
gf128mul ghash_clmulni_intel glue_helper grace hid hid_generic hmac
i2c_algo_bit i2c_core i2c_i801 ib_addr ib_cm ib_core ib_ipoib ib_mad
ib_sa ib_umad ib_uverbs igb ioatdma ipmi_devintf ipmi_msghandler
ipmi_poweroff ipmi_si ipmi_watchdog iptable_filter iptable_nat
ip_tables ipt_MASQUERADE irqbypass isci iTCO_vendor_support iTCO_wdt
iw_cm iw_cxgb4 jbd2 joydev kvm kvm_intel libahci libata libnvdimm
libsas llc lockd loop lpc_ich lrw mbcache md_mod mfd_core mlx4_core
mlx4_ib mlx5_core mlx5_ib msr nd_btt nd_e820 nd_pmem nf_conntrack
nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat nf_nat_ipv4
nf_nat_masquerade_ipv4 nfs nfs_acl nfsd nvme nvme_core ohci_hcd
oid_registry overlay pcspkr pps_core processor psmouse ptp raid6_pq
rdma_cm rdma_ucm sb_edac scsi_mod scsi_transport_sas sd_mod serio_raw
sg sha256_generic shpchp stp sunrpc tpm tpm_tis tun uhci_hcd
usb_common usbcore usbhid wmi x86_pkg_temp_thermal xhci_hcd xor
x_tables xt_addrtype xt_conntrack
Cheers
Stephen
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 05/13] Have cmake run man pages through text substitution
From: ira.weiny @ 2016-09-29 18:37 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20160926182154.GA27094-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On Mon, Sep 26, 2016 at 12:21:54PM -0600, Jason Gunthorpe wrote:
> On Mon, Sep 26, 2016 at 06:17:03PM +0000, Weiny, Ira wrote:
>
> > > rst2man is incredibly widely distributed: it comes with python-docutils which
> > > is widely included in every distribution. I have no idea why people would
> > > complain to you on that point. If something comes in-box in all the distros
> > > then it is fair game to depend upon, IMHO.
> >
> > I thought so to. But python-docutils is in the "optional" section of RH.
>
> I mean it is available via 'yum' with no special repositories. I do
> not expect software to build out of the box on any arbitary distro
> install. I expect builders to install the required set of
> packages. This is why the exect package set is documented in the
> README.md
FWIW, I'm supportive of that. Just saying what my experience was.
Ira
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH for-next 0/8] Bug Fixes and Code Improvement in HNS driver
From: Salil Mehta @ 2016-09-29 17:16 UTC (permalink / raw)
To: Doug Ledford
Cc: Huwei (Xavier), oulijun, Zhuangyuzeng (Yisen),
mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linuxarm
In-Reply-To: <57EBDA43.3010708-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Hi Salil,
>
> I've chatted with Dave Miller about this series. Here's where we
> stand.
>
> First, the review feedback from Dave:
>
> ---
>
> In patch #7, their comments are mis-formatted and these
> hns guys do this a lot.
>
> /*fix hardware broadcast/multicast packets queue loopback */
>
> They seem to have a hard time putting an initial space in the comment,
> and properly capitalizing and punctuating their sentences.
>
> Also in that new function, they need to order local variables from
> longest to shortest line (reverse christmas tree format).
>
> Patch #6 has the local variable ordering issue as well as does patch
> #3.
Hi Doug,
I have refloated PATCH V2 with reworked 6/8 and 7/8 patches.
I scanned [PATCH V1 3/8] but could not find any ordering issue amongst
local variables there. I hope I have not missed anything.
Best regards
Salil
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [rdma-core] Eliminate GCC warnings
From: Jason Gunthorpe @ 2016-09-29 17:09 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Leon Romanovsky
This patch series has already been applied, oops. I sent the pull
request, then got TravisCI working then ran out of time to send to the
list before Doug picked it.
Anyhow, most patches were on the list already in this group, save for
a few for ibacm.
Here are the commits, squashed diff below.
https://github.com/linux-rdma/rdma-core/compare/6f2c2b0021cc35e991808aeb825b7221f9e031b4...ad48f384594facfc73f9b9467c9a4bd33500ba02
If anyone has concerns..
The notable change is this makes TravisCI use -Werror, and runs the
build on 32 bit as well. So all future commits must be warning free on
64/32 bit GCC 6.2 to keep Travis happy.
Jason
.travis.yml | 16 ++++++++-
ibacm/src/acm.c | 9 ++---
ibacm/src/acme.c | 5 +--
iwpmd/src/iwarp_pm_helper.c | 2 -
libhfi1verbs/src/verbs.c | 2 -
libi40iw/src/i40iw_uverbs.c | 6 +--
libibumad/tests/umad_reg2_compat.c | 1
libibverbs/examples/asyncwatch.c | 2 -
libibverbs/examples/pingpong.c | 2 -
libibverbs/examples/rc_pingpong.c | 19 +++++------
libibverbs/examples/srq_pingpong.c | 17 +++++++---
libibverbs/examples/uc_pingpong.c | 19 +++++------
libibverbs/examples/ud_pingpong.c | 21 +++++--------
libibverbs/examples/xsrq_pingpong.c | 4 +-
libibverbs/src/neigh.c | 21 ++++++-------
libipathverbs/src/verbs.c | 2 -
libmlx5/src/verbs.c | 4 +-
libnes/src/nes_uverbs.c | 21 +++++++------
libocrdma/src/ocrdma_verbs.c | 3 +
librdmacm/examples/cmtime.c | 16 ---------
librdmacm/src/acm.c | 3 +
librdmacm/src/rsocket.c | 58 +++++++++++++++++++++++++-----------
librxe/src/rxe.c | 6 +++
23 files changed, 146 insertions(+), 113 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index e09dd32ffa9f..a2b9e3b8c3f3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,8 +21,20 @@ addons:
- pkg-config
- python
- valgrind
+
+ # 32 bit support packages
+ - gcc-multilib
+ - lib32gcc-6-dev
script:
- - mkdir build
+ - mkdir build build32
- cd build
- - CC=gcc-6 cmake -GNinja ..
+ # The goal is warning free compile on latest gcc.
+ - CC=gcc-6 CFLAGS=-Werror cmake -GNinja ..
+ - ninja
+
+ # 32 bit build
+ - cd ../build32
+ # travis's trusty is not configured in a way that enables all32 bit
+ # packages. We could fix this with some sudo stuff.. For now turn off libnl
+ - CC=gcc-6 CFLAGS="-Werror -m32" cmake -GNinja .. -DENABLE_RESOLVE_NEIGH=0
- ninja
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 4650421b81b7..41429e1db4d7 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -218,7 +218,7 @@ static struct sa_data {
struct pollfd *fds;
struct acmc_port **ports;
int nfds;
-} sa = { 2000, 2, 1};
+} sa = { 2000, 2, 1, 0, NULL, NULL, 0};
/*
* Service options - may be set through ibacm_opts.cfg file.
@@ -1402,7 +1402,7 @@ static int acm_nl_send(SOCKET sock, struct acm_msg *msg)
int ret;
int datalen;
- orig = (struct acm_nl_msg *) msg->hdr.tid;
+ orig = (struct acm_nl_msg *)(uintptr_t)msg->hdr.tid;
memset(&dst_addr, 0, sizeof(dst_addr));
dst_addr.nl_family = AF_NETLINK;
@@ -1562,7 +1562,7 @@ static void acm_nl_process_invalid_request(struct acmc_client *client,
msg.hdr.version = ACM_VERSION;
msg.hdr.length = ACM_MSG_HDR_LENGTH;
msg.hdr.status = ACM_STATUS_EINVAL;
- msg.hdr.tid = (uint64_t) acmnlmsg;
+ msg.hdr.tid = (uintptr_t) acmnlmsg;
acm_nl_send(client->sock, &msg);
}
@@ -1584,7 +1584,7 @@ static void acm_nl_process_resolve(struct acmc_client *client,
msg.hdr.version = ACM_VERSION;
msg.hdr.length = ACM_MSG_HDR_LENGTH + ACM_MSG_EP_LENGTH;
msg.hdr.status = ACM_STATUS_SUCCESS;
- msg.hdr.tid = (uint64_t) acmnlmsg;
+ msg.hdr.tid = (uintptr_t) acmnlmsg;
msg.resolve_data[0].type = ACM_EP_INFO_PATH;
/* We support only one pathrecord */
@@ -3031,7 +3031,6 @@ static int acm_open_lock_file(void)
snprintf(pid, sizeof pid, "%d\n", getpid());
if (write(lock_fd, pid, strlen(pid)) != strlen(pid)){
- lockf(lock_fd, F_ULOCK, 0);
close(lock_fd);
return -1;
}
diff --git a/ibacm/src/acme.c b/ibacm/src/acme.c
index 4d9003047506..4b5fe684c8e2 100644
--- a/ibacm/src/acme.c
+++ b/ibacm/src/acme.c
@@ -38,6 +38,7 @@
#include <getopt.h>
#include <netdb.h>
#include <arpa/inet.h>
+#include <inttypes.h>
#include <osd.h>
#include <infiniband/verbs.h>
@@ -902,7 +903,7 @@ static int enumerate_ep(char *svc, int index)
labels = 1;
}
- printf("%s,0x%016lx,%d,0x%04x,%d,%s", svc, ep_data->dev_guid,
+ printf("%s,0x%016" PRIx64 ",%d,0x%04x,%d,%s", svc, ep_data->dev_guid,
ep_data->port_num, ep_data->pkey, index, ep_data->prov_name);
for (i = 0; i < ep_data->addr_cnt; i++)
printf(",%s", ep_data->addrs[i].name);
@@ -927,7 +928,7 @@ static void enumerate_eps(char *svc)
static int query_svcs(void)
{
char **svc_list;
- int ret, i;
+ int ret = -1, i;
svc_list = parse(svc_arg, NULL);
if (!svc_list) {
diff --git a/iwpmd/src/iwarp_pm_helper.c b/iwpmd/src/iwarp_pm_helper.c
index f5c7b96a22e1..89d2b6cef5e6 100644
--- a/iwpmd/src/iwarp_pm_helper.c
+++ b/iwpmd/src/iwarp_pm_helper.c
@@ -82,7 +82,7 @@ iwpm_mapping_request *create_iwpm_map_request(struct nlmsghdr *req_nlh,
/* assochandle helps match iwpm request sent to remote peer with future iwpm accept/reject */
iwpm_map_req->assochandle = assochandle;
if (!assochandle)
- iwpm_map_req->assochandle = (__u64)iwpm_map_req;
+ iwpm_map_req->assochandle = (uintptr_t)iwpm_map_req;
memcpy(&iwpm_map_req->src_addr, src_addr, sizeof(struct sockaddr_storage));
/* keep record of remote IP address and port */
diff --git a/libhfi1verbs/src/verbs.c b/libhfi1verbs/src/verbs.c
index 854c5676908d..e245ad9e5b4f 100644
--- a/libhfi1verbs/src/verbs.c
+++ b/libhfi1verbs/src/verbs.c
@@ -607,7 +607,7 @@ int hfi1_modify_srq(struct ibv_srq *ibsrq,
(sizeof(struct ibv_sge) * srq->rq.max_sge)) *
srq->rq.size;
}
- cmd.offset_addr = (__u64) &offset;
+ cmd.offset_addr = (uintptr_t) &offset;
ret = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
&cmd.ibv_cmd, sizeof cmd);
if (ret) {
diff --git a/libi40iw/src/i40iw_uverbs.c b/libi40iw/src/i40iw_uverbs.c
index da23e4c9f413..8369e10f61ee 100644
--- a/libi40iw/src/i40iw_uverbs.c
+++ b/libi40iw/src/i40iw_uverbs.c
@@ -557,7 +557,7 @@ static int i40iw_vmapped_qp(struct i40iw_uqp *iwuqp, struct ibv_pd *pd,
return 0;
}
cmd.user_wqe_buffers = (__u64)((uintptr_t)info->sq);
- cmd.user_compl_ctx = (u64)&iwuqp->qp;
+ cmd.user_compl_ctx = (uintptr_t)&iwuqp->qp;
ret = ibv_cmd_create_qp(pd, &iwuqp->ibv_qp, attr, &cmd.ibv_cmd, sizeof(cmd),
&resp->ibv_resp, sizeof(struct i40iw_ucreate_qp_resp));
@@ -858,7 +858,7 @@ int i40iw_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr, struct ibv
info.op_type = I40IW_OP_TYPE_SEND;
if (ib_wr->send_flags & IBV_SEND_INLINE) {
- info.op.inline_send.data = (void *)ib_wr->sg_list[0].addr;
+ info.op.inline_send.data = (void *)(uintptr_t)ib_wr->sg_list[0].addr;
info.op.inline_send.len = ib_wr->sg_list[0].length;
ret = iwuqp->qp.ops.iw_inline_send(&iwuqp->qp, &info,
ib_wr->wr.rdma.rkey, false);
@@ -881,7 +881,7 @@ int i40iw_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr, struct ibv
info.op_type = I40IW_OP_TYPE_RDMA_WRITE;
if (ib_wr->send_flags & IBV_SEND_INLINE) {
- info.op.inline_rdma_write.data = (void *)ib_wr->sg_list[0].addr;
+ info.op.inline_rdma_write.data = (void *)(uintptr_t)ib_wr->sg_list[0].addr;
info.op.inline_rdma_write.len = ib_wr->sg_list[0].length;
info.op.inline_rdma_write.rem_addr.tag_off = ib_wr->wr.rdma.remote_addr;
info.op.inline_rdma_write.rem_addr.len = ib_wr->sg_list->length;
diff --git a/libibumad/tests/umad_reg2_compat.c b/libibumad/tests/umad_reg2_compat.c
index 6dd4a48a59b2..9c239ee4bfae 100644
--- a/libibumad/tests/umad_reg2_compat.c
+++ b/libibumad/tests/umad_reg2_compat.c
@@ -100,7 +100,6 @@ int open_test_device(void)
void test_register(void)
{
- int rc = 0;
int agent_id;
long method_mask[16 / sizeof(long)];
uint32_t class_oui = 0x001405; /* OPENIB_OUI */
diff --git a/libibverbs/examples/asyncwatch.c b/libibverbs/examples/asyncwatch.c
index df1261503b7d..c78994d24bed 100644
--- a/libibverbs/examples/asyncwatch.c
+++ b/libibverbs/examples/asyncwatch.c
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
static struct option long_options[] = {
{ .name = "ib-dev", .has_arg = 1, .val = 'd' },
{ .name = "help", .has_arg = 0, .val = 'h' },
- { 0 }
+ {}
};
c = getopt_long(argc, argv, "d:h", long_options, NULL);
diff --git a/libibverbs/examples/pingpong.c b/libibverbs/examples/pingpong.c
index 2fe4a04115fb..f6a50e9c62aa 100644
--- a/libibverbs/examples/pingpong.c
+++ b/libibverbs/examples/pingpong.c
@@ -44,7 +44,7 @@ enum ibv_mtu pp_mtu_to_enum(int mtu)
case 1024: return IBV_MTU_1024;
case 2048: return IBV_MTU_2048;
case 4096: return IBV_MTU_4096;
- default: return -1;
+ default: return 0;
}
}
diff --git a/libibverbs/examples/rc_pingpong.c b/libibverbs/examples/rc_pingpong.c
index 967678362833..9054a68b7eb5 100644
--- a/libibverbs/examples/rc_pingpong.c
+++ b/libibverbs/examples/rc_pingpong.c
@@ -208,14 +208,13 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
goto out;
}
- if (read(sockfd, msg, sizeof msg) != sizeof msg) {
- perror("client read");
- fprintf(stderr, "Couldn't read remote address\n");
+ if (read(sockfd, msg, sizeof msg) != sizeof msg ||
+ write(sockfd, "done", sizeof "done") != sizeof "done") {
+ perror("client read/write");
+ fprintf(stderr, "Couldn't read/write remote address\n");
goto out;
}
- write(sockfd, "done", sizeof "done");
-
rem_dest = malloc(sizeof *rem_dest);
if (!rem_dest)
goto out;
@@ -316,14 +315,14 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
gid_to_wire_gid(&my_dest->gid, gid);
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
my_dest->psn, gid);
- if (write(connfd, msg, sizeof msg) != sizeof msg) {
- fprintf(stderr, "Couldn't send local address\n");
+ if (write(connfd, msg, sizeof msg) != sizeof msg ||
+ read(connfd, msg, sizeof msg) != sizeof msg) {
+ fprintf(stderr, "Couldn't send/recv local address\n");
free(rem_dest);
rem_dest = NULL;
goto out;
}
- read(connfd, msg, sizeof msg);
out:
close(connfd);
@@ -732,7 +731,7 @@ int main(int argc, char *argv[])
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
{ .name = "odp", .has_arg = 0, .val = 'o' },
{ .name = "ts", .has_arg = 0, .val = 't' },
- { 0 }
+ {}
};
c = getopt_long(argc, argv, "p:d:i:s:m:r:n:l:eg:ot",
@@ -768,7 +767,7 @@ int main(int argc, char *argv[])
case 'm':
mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
- if (mtu < 0) {
+ if (mtu == 0) {
usage(argv[0]);
return 1;
}
diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
index a1061c31972d..f17972580b57 100644
--- a/libibverbs/examples/srq_pingpong.c
+++ b/libibverbs/examples/srq_pingpong.c
@@ -222,8 +222,10 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
wire_gid_to_gid(gid, &rem_dest[i].gid);
}
- write(sockfd, "done", sizeof "done");
-
+ if (write(sockfd, "done", sizeof "done") != sizeof "done") {
+ perror("client write");
+ goto out;
+ }
out:
close(sockfd);
return rem_dest;
@@ -333,7 +335,12 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
}
}
- read(connfd, msg, sizeof msg);
+ if (read(connfd, msg, sizeof msg) != sizeof msg) {
+ perror("client write");
+ free(rem_dest);
+ rem_dest = NULL;
+ goto out;
+ }
out:
close(connfd);
@@ -658,7 +665,7 @@ int main(int argc, char *argv[])
{ .name = "sl", .has_arg = 1, .val = 'l' },
{ .name = "events", .has_arg = 0, .val = 'e' },
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
- { 0 }
+ {}
};
c = getopt_long(argc, argv, "p:d:i:s:m:q:r:n:l:eg:",
@@ -697,7 +704,7 @@ int main(int argc, char *argv[])
case 'm':
mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
- if (mtu < 0) {
+ if (mtu == 0) {
usage(argv[0]);
return 1;
}
diff --git a/libibverbs/examples/uc_pingpong.c b/libibverbs/examples/uc_pingpong.c
index b25d16c79021..7d982d36a5ef 100644
--- a/libibverbs/examples/uc_pingpong.c
+++ b/libibverbs/examples/uc_pingpong.c
@@ -176,13 +176,13 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
goto out;
}
- if (read(sockfd, msg, sizeof msg) != sizeof msg) {
- perror("client read");
- fprintf(stderr, "Couldn't read remote address\n");
+ if (read(sockfd, msg, sizeof msg) != sizeof msg ||
+ write(sockfd, "done", sizeof "done") != sizeof "done") {
+ perror("client read/write");
+ fprintf(stderr, "Couldn't read/write remote address\n");
goto out;
}
- write(sockfd, "done", sizeof "done");
rem_dest = malloc(sizeof *rem_dest);
if (!rem_dest)
@@ -284,15 +284,14 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
gid_to_wire_gid(&my_dest->gid, gid);
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
my_dest->psn, gid);
- if (write(connfd, msg, sizeof msg) != sizeof msg) {
- fprintf(stderr, "Couldn't send local address\n");
+ if (write(connfd, msg, sizeof msg) != sizeof msg ||
+ read(connfd, msg, sizeof msg) != sizeof msg) {
+ fprintf(stderr, "Couldn't send/recv local address\n");
free(rem_dest);
rem_dest = NULL;
goto out;
}
- read(connfd, msg, sizeof msg);
-
out:
close(connfd);
return rem_dest;
@@ -569,7 +568,7 @@ int main(int argc, char *argv[])
{ .name = "sl", .has_arg = 1, .val = 'l' },
{ .name = "events", .has_arg = 0, .val = 'e' },
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
- { 0 }
+ {}
};
c = getopt_long(argc, argv, "p:d:i:s:m:r:n:l:eg:",
@@ -604,7 +603,7 @@ int main(int argc, char *argv[])
case 'm':
mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
- if (mtu < 0) {
+ if (mtu == 0) {
usage(argv[0]);
return 1;
}
diff --git a/libibverbs/examples/ud_pingpong.c b/libibverbs/examples/ud_pingpong.c
index fa99b9e51dfb..deefb9b81013 100644
--- a/libibverbs/examples/ud_pingpong.c
+++ b/libibverbs/examples/ud_pingpong.c
@@ -176,14 +176,13 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
goto out;
}
- if (read(sockfd, msg, sizeof msg) != sizeof msg) {
- perror("client read");
- fprintf(stderr, "Couldn't read remote address\n");
+ if (read(sockfd, msg, sizeof msg) != sizeof msg ||
+ write(sockfd, "done", sizeof "done") != sizeof "done") {
+ perror("client read/write");
+ fprintf(stderr, "Couldn't read/write remote address\n");
goto out;
}
- write(sockfd, "done", sizeof "done");
-
rem_dest = malloc(sizeof *rem_dest);
if (!rem_dest)
goto out;
@@ -282,15 +281,13 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
gid_to_wire_gid(&my_dest->gid, gid);
sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
my_dest->psn, gid);
- if (write(connfd, msg, sizeof msg) != sizeof msg) {
- fprintf(stderr, "Couldn't send local address\n");
+ if (write(connfd, msg, sizeof msg) != sizeof msg ||
+ read(connfd, msg, sizeof msg) != sizeof msg) {
+ fprintf(stderr, "Couldn't send/recv local address\n");
free(rem_dest);
rem_dest = NULL;
goto out;
}
-
- read(connfd, msg, sizeof msg);
-
out:
close(connfd);
return rem_dest;
@@ -327,7 +324,7 @@ static struct pingpong_context *pp_init_ctx(struct ibv_device *ib_dev, int size,
}
{
- struct ibv_port_attr port_info = { 0 };
+ struct ibv_port_attr port_info = {};
int mtu;
if (ibv_query_port(ctx->context, port, &port_info)) {
@@ -591,7 +588,7 @@ int main(int argc, char *argv[])
{ .name = "sl", .has_arg = 1, .val = 'l' },
{ .name = "events", .has_arg = 0, .val = 'e' },
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
- { 0 }
+ {}
};
c = getopt_long(argc, argv, "p:d:i:s:r:n:l:eg:",
diff --git a/libibverbs/examples/xsrq_pingpong.c b/libibverbs/examples/xsrq_pingpong.c
index ff00180f2644..903548ed6824 100644
--- a/libibverbs/examples/xsrq_pingpong.c
+++ b/libibverbs/examples/xsrq_pingpong.c
@@ -875,7 +875,7 @@ int main(int argc, char *argv[])
{ .name = "sl", .has_arg = 1, .val = 'l' },
{ .name = "events", .has_arg = 0, .val = 'e' },
{ .name = "gid-idx", .has_arg = 1, .val = 'g' },
- { 0 }
+ {}
};
c = getopt_long(argc, argv, "p:d:i:s:m:c:n:l:eg:", long_options,
@@ -906,7 +906,7 @@ int main(int argc, char *argv[])
break;
case 'm':
ctx.mtu = pp_mtu_to_enum(strtol(optarg, NULL, 0));
- if (ctx.mtu < 0) {
+ if (ctx.mtu == 0) {
usage(argv[0]);
return 1;
}
diff --git a/libibverbs/src/neigh.c b/libibverbs/src/neigh.c
index 799b810a9ec4..5acfcf06fcde 100644
--- a/libibverbs/src/neigh.c
+++ b/libibverbs/src/neigh.c
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <ifaddrs.h>
#include <netdb.h>
+#include <assert.h>
#ifndef _LINUX_IF_H
#include <net/if.h>
#else
@@ -207,7 +208,7 @@ static int create_socket(struct get_neigh_handler *neigh_handler,
&addr_src.len);
if (err) {
errno = EADDRNOTAVAIL;
- return err;
+ return -1;
}
addr_dst->len = sizeof(addr_dst->sktaddr);
@@ -216,24 +217,22 @@ static int create_socket(struct get_neigh_handler *neigh_handler,
&addr_dst->len);
if (err) {
errno = EADDRNOTAVAIL;
- return err;
+ return -1;
}
err = set_link_port(&addr_dst->sktaddr, PORT_DISCARD,
neigh_handler->oif);
if (err)
- return err;
+ return -1;
sock_fd = socket(addr_dst->sktaddr.s.sa_family,
SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (sock_fd == -1)
- return errno ? -errno : -1;
+ return -1;
err = bind(sock_fd, &addr_src.sktaddr.s, addr_src.len);
if (err) {
- int bind_err = -errno;
-
close(sock_fd);
- return bind_err ?: EADDRNOTAVAIL;
+ return -1;
}
*psock_fd = sock_fd;
@@ -374,9 +373,11 @@ static struct nl_addr *process_get_neigh_mac(
if (FD_ISSET(timer_fd, &fdset)) {
uint64_t read_val;
+ ssize_t rc;
- (void)read(timer_fd, &read_val,
- sizeof(read_val));
+ rc =
+ read(timer_fd, &read_val, sizeof(read_val));
+ assert(rc == sizeof(read_val));
if (++retries >= NUM_OF_TRIES) {
if (!errno)
errno = EDESTADDRREQ;
@@ -729,7 +730,7 @@ uint16_t neigh_get_vlan_id_from_dev(struct get_neigh_handler *neigh_handler)
void neigh_set_vlan_id(struct get_neigh_handler *neigh_handler, uint16_t vid)
{
- if (vid >= 0 && vid <= 0xfff)
+ if (vid <= 0xfff)
neigh_handler->vid = vid;
}
diff --git a/libipathverbs/src/verbs.c b/libipathverbs/src/verbs.c
index 17d54cd4026b..578a38af3428 100644
--- a/libipathverbs/src/verbs.c
+++ b/libipathverbs/src/verbs.c
@@ -583,7 +583,7 @@ int ipath_modify_srq(struct ibv_srq *ibsrq,
(sizeof(struct ibv_sge) * srq->rq.max_sge)) *
srq->rq.size;
}
- cmd.offset_addr = (__u64) &offset;
+ cmd.offset_addr = (uintptr_t) &offset;
ret = ibv_cmd_modify_srq(ibsrq, attr, attr_mask,
&cmd.ibv_cmd, sizeof cmd);
if (ret) {
diff --git a/libmlx5/src/verbs.c b/libmlx5/src/verbs.c
index 52289acc39cc..75cbae35e759 100644
--- a/libmlx5/src/verbs.c
+++ b/libmlx5/src/verbs.c
@@ -1700,8 +1700,8 @@ mlx5_open_xrcd(struct ibv_context *context,
{
int err;
struct verbs_xrcd *xrcd;
- struct ibv_open_xrcd cmd = {0};
- struct ibv_open_xrcd_resp resp = {0};
+ struct ibv_open_xrcd cmd = {};
+ struct ibv_open_xrcd_resp resp = {};
xrcd = calloc(1, sizeof(*xrcd));
if (!xrcd)
diff --git a/libnes/src/nes_uverbs.c b/libnes/src/nes_uverbs.c
index 80891d6243c7..983d87a80b8b 100644
--- a/libnes/src/nes_uverbs.c
+++ b/libnes/src/nes_uverbs.c
@@ -215,6 +215,7 @@ int nes_udereg_mr(struct ibv_mr *mr)
return 0;
}
+#if HAVE_DECL_IBV_QPT_RAW_ETH
static
int nes_ima_ureplace_cq(struct ibv_cq *cq,
int mcrqf,
@@ -296,6 +297,7 @@ int nes_ima_ureplace_cq(struct ibv_cq *cq,
err:
return ret;
}
+#endif
/**
* nes_ucreate_cq
@@ -425,7 +427,6 @@ int nes_ima_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
int cqe_count = 0;
uint32_t head;
uint32_t cq_size;
- uint16_t qp_size;
volatile struct nes_hw_nic_cqe *cqe = 0;
volatile struct nes_hw_nic_cqe *cqes;
@@ -487,7 +488,6 @@ int nes_ima_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
entry->src_qp = nesuqp->qp_id;
if (cqe_misc & NES_NIC_CQE_SQ) {
entry->opcode = IBV_WC_SEND;
- qp_size = nesuqp->sq_size;
entry->wr_id =
nesuqp->send_wr_id[nesuqp->sq_tail];
@@ -518,8 +518,8 @@ int nes_ima_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
/* Working on a RQ Completion*/
if (++nesuqp->rq_tail >= nesuqp->rq_size)
nesuqp->rq_tail = 0;
- if (entry->status == NES_CQ_BUF_OV_ERR)
- entry->status = IBV_WC_LOC_LEN_ERR;
+ if (entry->status == NES_CQ_BUF_OV_ERR)
+ entry->status = IBV_WC_LOC_LEN_ERR;
}
if (++head >= cq_size)
@@ -557,7 +557,6 @@ int nes_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
uint32_t wqe_index;
uint32_t wq_tail = 0;
struct nes_hw_cqe cqe;
- uint32_t tmp;
uint64_t u64temp;
int move_cq_head = 1;
uint32_t err_code;
@@ -679,7 +678,6 @@ nes_upoll_cq_update:
nesvctx = to_nes_uctx(cq->context);
nesvctx->nesupd->udoorbell->cqe_alloc = cpu_to_le32(nesucq->cq_id |
(nesucq->polled_completions << 16));
- tmp = nesvctx->nesupd->udoorbell->cqe_alloc;
nesucq->polled_completions = 0;
}
} else {
@@ -699,7 +697,6 @@ nes_upoll_cq_update:
nesvctx = to_nes_uctx(cq->context);
nesvctx->nesupd->udoorbell->cqe_alloc = cpu_to_le32(nesucq->cq_id |
(nesucq->polled_completions << 16));
- tmp = nesvctx->nesupd->udoorbell->cqe_alloc;
nesucq->polled_completions = 0;
}
nesucq->head = head;
@@ -1140,7 +1137,6 @@ struct ibv_qp *nes_ucreate_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr)
struct nes_uqp *nesuqp;
int sqdepth, rqdepth;
int status = 1;
- int i = 0;
/* fprintf(stderr, PFX "%s\n", __FUNCTION__); */
@@ -1211,6 +1207,8 @@ struct ibv_qp *nes_ucreate_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr)
#if HAVE_DECL_IBV_QPT_RAW_ETH
if (attr->qp_type == IBV_QPT_RAW_ETH) {
+ int i = 0;
+
nesuqp->nes_ud_sksq_fd = open("/dev/infiniband/nes_ud_sksq",
O_RDWR);
if (nesuqp->nes_ud_sksq_fd <= 0)
@@ -1327,7 +1325,6 @@ int nes_udestroy_qp(struct ibv_qp *qp)
{
struct nes_uqp *nesuqp = to_nes_uqp(qp);
int ret = 0;
- int i = 0;
// fprintf(stderr, PFX "%s addr&mr= %p \n", __FUNCTION__, &nesuqp->mr );
@@ -1353,6 +1350,8 @@ int nes_udestroy_qp(struct ibv_qp *qp)
#if HAVE_DECL_IBV_QPT_RAW_ETH
if (qp->qp_type == IBV_QPT_RAW_ETH) {
+ int i = 0;
+
if (nesuqp->pend_rx_wr) {
for (i = 0; i < NES_UD_RX_BATCH_SZ; i++)
if (nesuqp->pend_rx_wr[i].sg_list) {
@@ -1381,6 +1380,7 @@ int nes_udestroy_qp(struct ibv_qp *qp)
return 0;
}
+#if HAVE_DECL_IBV_QPT_RAW_ETH
static inline
int nes_ima_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr,
struct ibv_send_wr **bad_wr)
@@ -1457,6 +1457,7 @@ int nes_ima_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr,
out:
return ret;
}
+#endif
/**
* nes_upost_send
@@ -1653,6 +1654,7 @@ int nes_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr,
return err;
}
+#if HAVE_DECL_IBV_QPT_RAW_ETH
static inline
int nes_ima_upost_recv(struct ibv_qp *ib_qp, struct ibv_recv_wr *ib_wr,
struct ibv_recv_wr **bad_wr)
@@ -1727,6 +1729,7 @@ int nes_ima_upost_recv(struct ibv_qp *ib_qp, struct ibv_recv_wr *ib_wr,
out:
return ret;
}
+#endif
/**
* nes_upost_recv
diff --git a/libocrdma/src/ocrdma_verbs.c b/libocrdma/src/ocrdma_verbs.c
index 60626260656d..8eb70db2693a 100644
--- a/libocrdma/src/ocrdma_verbs.c
+++ b/libocrdma/src/ocrdma_verbs.c
@@ -945,10 +945,11 @@ static inline void *ocrdma_hwq_head(struct ocrdma_qp_hwq_info *q)
return q->va + (q->head * q->entry_size);
}
-static inline void *ocrdma_wq_tail(struct ocrdma_qp_hwq_info *q)
+/*static inline void *ocrdma_wq_tail(struct ocrdma_qp_hwq_info *q)
{
return q->va + (q->tail * q->entry_size);
}
+*/
static inline void *ocrdma_hwq_head_from_idx(struct ocrdma_qp_hwq_info *q,
uint32_t idx)
diff --git a/librdmacm/examples/cmtime.c b/librdmacm/examples/cmtime.c
index e45980b9bb04..f0b4d0276288 100644
--- a/librdmacm/examples/cmtime.c
+++ b/librdmacm/examples/cmtime.c
@@ -128,13 +128,6 @@ static inline int __list_empty(struct work_list *list)
return list->list.next == &list->list;
}
-static inline int list_empty(struct work_list *work_list)
-{
- pthread_mutex_lock(&work_list->lock);
- return work_list->list.next == &work_list->list;
- pthread_mutex_unlock(&work_list->lock);
-}
-
static inline struct list_head *__list_remove_head(struct work_list *work_list)
{
struct list_head *list_item;
@@ -144,15 +137,6 @@ static inline struct list_head *__list_remove_head(struct work_list *work_list)
return list_item;
}
-static inline struct list_head *list_remove_head(struct work_list *work_list)
-{
- struct list_head *list_item;
- pthread_mutex_lock(&work_list->lock);
- list_item = __list_remove_head(work_list);
- pthread_mutex_unlock(&work_list->lock);
- return list_item;
-}
-
static inline void list_add_tail(struct work_list *work_list, struct list_head *req)
{
int empty;
diff --git a/librdmacm/src/acm.c b/librdmacm/src/acm.c
index 75d9d8cf487e..823381aac367 100644
--- a/librdmacm/src/acm.c
+++ b/librdmacm/src/acm.c
@@ -121,7 +121,8 @@ static int ucma_set_server_port(void)
FILE *f;
if ((f = fopen(IBACM_PORT_FILE, "r" STREAM_CLOEXEC))) {
- fscanf(f, "%" SCNu16, &server_port);
+ if (fscanf(f, "%" SCNu16, &server_port) != 1)
+ server_port = 0;
fclose(f);
}
return server_port;
diff --git a/librdmacm/src/rsocket.c b/librdmacm/src/rsocket.c
index 818505fbe02e..205101f1702f 100644
--- a/librdmacm/src/rsocket.c
+++ b/librdmacm/src/rsocket.c
@@ -404,6 +404,20 @@ struct ds_udp_header {
#define ds_next_qp(qp) container_of((qp)->list.next, struct ds_qp, list)
+static void write_all(int fd, const void *msg, size_t len)
+{
+ // FIXME: if fd is a socket this really needs to handle EINTR and other conditions.
+ ssize_t rc = write(fd, msg, len);
+ assert(rc == len);
+}
+
+static void read_all(int fd, void *msg, size_t len)
+{
+ // FIXME: if fd is a socket this really needs to handle EINTR and other conditions.
+ ssize_t rc = read(fd, msg, len);
+ assert(rc == len);
+}
+
static void ds_insert_qp(struct rsocket *rs, struct ds_qp *qp)
{
if (!rs->qp_list)
@@ -444,8 +458,8 @@ static int rs_notify_svc(struct rs_svc *svc, struct rsocket *rs, int cmd)
msg.cmd = cmd;
msg.status = EINVAL;
msg.rs = rs;
- write(svc->sock[0], &msg, sizeof msg);
- read(svc->sock[0], &msg, sizeof msg);
+ write_all(svc->sock[0], &msg, sizeof msg);
+ read_all(svc->sock[0], &msg, sizeof msg);
ret = rdma_seterrno(msg.status);
if (svc->cnt)
goto unlock;
@@ -484,6 +498,15 @@ static int rs_scale_to_value(int value, int bits)
value : (value & ~(1 << (bits - 1))) << bits;
}
+/* gcc > ~5 will not allow (void)fscanf to suppress -Wunused-result, but this
+ will do it. In this case ignoring the result is OK (but horribly
+ unfriendly to user) since the library has a sane default. */
+#define failable_fscanf(f, fmt, ...) \
+ { \
+ int rc = fscanf(f, fmt, __VA_ARGS__); \
+ (void) rc; \
+ }
+
void rs_configure(void)
{
FILE *f;
@@ -501,27 +524,27 @@ void rs_configure(void)
ucma_ib_init();
if ((f = fopen(RS_CONF_DIR "/polling_time", "r"))) {
- (void) fscanf(f, "%u", &polling_time);
+ failable_fscanf(f, "%u", &polling_time);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/inline_default", "r"))) {
- (void) fscanf(f, "%hu", &def_inline);
+ failable_fscanf(f, "%hu", &def_inline);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/sqsize_default", "r"))) {
- (void) fscanf(f, "%hu", &def_sqsize);
+ failable_fscanf(f, "%hu", &def_sqsize);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/rqsize_default", "r"))) {
- (void) fscanf(f, "%hu", &def_rqsize);
+ failable_fscanf(f, "%hu", &def_rqsize);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/mem_default", "r"))) {
- (void) fscanf(f, "%u", &def_mem);
+ failable_fscanf(f, "%u", &def_mem);
fclose(f);
if (def_mem < 1)
@@ -529,14 +552,14 @@ void rs_configure(void)
}
if ((f = fopen(RS_CONF_DIR "/wmem_default", "r"))) {
- (void) fscanf(f, "%u", &def_wmem);
+ failable_fscanf(f, "%u", &def_wmem);
fclose(f);
if (def_wmem < RS_SNDLOWAT)
def_wmem = RS_SNDLOWAT << 1;
}
if ((f = fopen(RS_CONF_DIR "/iomap_size", "r"))) {
- (void) fscanf(f, "%hu", &def_iomap_size);
+ failable_fscanf(f, "%hu", &def_iomap_size);
fclose(f);
/* round to supported values */
@@ -3345,7 +3368,8 @@ static int rs_set_keepalive(struct rsocket *rs, int on)
if (on) {
if (!rs->keepalive_time) {
if ((f = fopen("/proc/sys/net/ipv4/tcp_keepalive_time", "r"))) {
- (void) fscanf(f, "%u", &rs->keepalive_time);
+ if (fscanf(f, "%u", &rs->keepalive_time) != 1)
+ rs->keepalive_time = 7200;
fclose(f);
} else {
rs->keepalive_time = 7200;
@@ -3985,7 +4009,7 @@ static void udp_svc_process_sock(struct rs_svc *svc)
{
struct rs_svc_msg msg;
- read(svc->sock[1], &msg, sizeof msg);
+ read_all(svc->sock[1], &msg, sizeof msg);
switch (msg.cmd) {
case RS_SVC_ADD_DGRAM:
msg.status = rs_svc_add_rs(svc, msg.rs);
@@ -4009,7 +4033,7 @@ static void udp_svc_process_sock(struct rs_svc *svc)
break;
}
- write(svc->sock[1], &msg, sizeof msg);
+ write_all(svc->sock[1], &msg, sizeof msg);
}
static uint8_t udp_svc_sgid_index(struct ds_dest *dest, union ibv_gid *sgid)
@@ -4184,7 +4208,7 @@ static void *udp_svc_run(void *arg)
ret = rs_svc_grow_sets(svc, 4);
if (ret) {
msg.status = ret;
- write(svc->sock[1], &msg, sizeof msg);
+ write_all(svc->sock[1], &msg, sizeof msg);
return (void *) (uintptr_t) ret;
}
@@ -4222,7 +4246,7 @@ static void tcp_svc_process_sock(struct rs_svc *svc)
struct rs_svc_msg msg;
int i;
- read(svc->sock[1], &msg, sizeof msg);
+ read_all(svc->sock[1], &msg, sizeof msg);
switch (msg.cmd) {
case RS_SVC_ADD_KEEPALIVE:
msg.status = rs_svc_add_rs(svc, msg.rs);
@@ -4253,7 +4277,7 @@ static void tcp_svc_process_sock(struct rs_svc *svc)
default:
break;
}
- write(svc->sock[1], &msg, sizeof msg);
+ write_all(svc->sock[1], &msg, sizeof msg);
}
/*
@@ -4266,7 +4290,7 @@ static void tcp_svc_send_keepalive(struct rsocket *rs)
if (rs_ctrl_avail(rs) && (rs->state & rs_connected)) {
rs->ctrl_seqno++;
rs_post_write(rs, NULL, 0, rs_msg_set(RS_OP_CTRL, RS_CTRL_KEEPALIVE),
- 0, (uint64_t) NULL, (uint64_t) NULL);
+ 0, (uintptr_t) NULL, (uintptr_t) NULL);
}
fastlock_release(&rs->cq_lock);
}
@@ -4282,7 +4306,7 @@ static void *tcp_svc_run(void *arg)
ret = rs_svc_grow_sets(svc, 16);
if (ret) {
msg.status = ret;
- write(svc->sock[1], &msg, sizeof msg);
+ write_all(svc->sock[1], &msg, sizeof msg);
return (void *) (uintptr_t) ret;
}
diff --git a/librxe/src/rxe.c b/librxe/src/rxe.c
index 94d0de51f7dd..7164f6627171 100644
--- a/librxe/src/rxe.c
+++ b/librxe/src/rxe.c
@@ -596,6 +596,12 @@ void convert_send_wr(struct rxe_send_wr *kwr, struct ibv_send_wr *uwr)
kwr->wr.atomic.swap = uwr->wr.atomic.swap;
kwr->wr.atomic.rkey = uwr->wr.atomic.rkey;
break;
+
+ case IBV_WR_LOCAL_INV:
+ case IBV_WR_BIND_MW:
+ case IBV_WR_SEND_WITH_INV:
+ case IBV_WR_TSO:
+ break;
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH V2 for-next 8/8] net: hns: delete redundant broadcast packet filter process
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, Daode Huang
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: Daode Huang <huangdaode@hisilicon.com>
The broadcast packets is filtered in the hardware now, so this process
is no need in the driver, just delete it.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 5494e0e..a7abe11 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -574,7 +574,6 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data,
struct sk_buff *skb;
struct hnae_desc *desc;
struct hnae_desc_cb *desc_cb;
- struct ethhdr *eh;
unsigned char *va;
int bnum, length, i;
int pull_len;
@@ -600,7 +599,6 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data,
ring->stats.sw_err_cnt++;
return -ENOMEM;
}
- skb_reset_mac_header(skb);
prefetchw(skb->data);
length = le16_to_cpu(desc->rx.pkt_len);
@@ -682,14 +680,6 @@ out_bnum_err:
return -EFAULT;
}
- /* filter out multicast pkt with the same src mac as this port */
- eh = eth_hdr(skb);
- if (unlikely(is_multicast_ether_addr(eh->h_dest) &&
- ether_addr_equal(ndev->dev_addr, eh->h_source))) {
- dev_kfree_skb_any(skb);
- return -EFAULT;
- }
-
ring->stats.rx_pkts++;
ring->stats.rx_bytes += skb->len;
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 7/8] net: hns: bug fix about broadcast/multicast packets
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, Daode Huang
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: Daode Huang <huangdaode@hisilicon.com>
When the dsaf mode receives a broadcast packet, it will filter
the packet by comparing the received queue number and destination
queue number(get from forwarding table), if they are the same,
the packet will be filtered. Otherwise, the packet will be loopback.
So this patch select queue 0 to send broadcast and multicast packets.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
PATCH v2: Addressed comments by David Miller
Link: https://lkml.org/lkml/2016/9/28/390
PATCH V1: Initial Submit
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 09ed237..5494e0e 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -1597,6 +1597,21 @@ struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev,
return stats;
}
+static u16
+hns_nic_select_queue(struct net_device *ndev, struct sk_buff *skb,
+ void *accel_priv, select_queue_fallback_t fallback)
+{
+ struct ethhdr *eth_hdr = (struct ethhdr *)skb->data;
+ struct hns_nic_priv *priv = netdev_priv(ndev);
+
+ /* fix hardware broadcast/multicast packets queue loopback */
+ if (!AE_IS_VER1(priv->enet_ver) &&
+ is_multicast_ether_addr(eth_hdr->h_dest))
+ return 0;
+ else
+ return fallback(ndev, skb);
+}
+
static const struct net_device_ops hns_nic_netdev_ops = {
.ndo_open = hns_nic_net_open,
.ndo_stop = hns_nic_net_stop,
@@ -1612,6 +1627,7 @@ static const struct net_device_ops hns_nic_netdev_ops = {
.ndo_poll_controller = hns_nic_poll_controller,
#endif
.ndo_set_rx_mode = hns_nic_set_rx_mode,
+ .ndo_select_queue = hns_nic_select_queue,
};
static void hns_nic_update_link_status(struct net_device *netdev)
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 6/8] net: hns: fix the bug of forwarding table
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, Daode Huang
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: Daode Huang <huangdaode@hisilicon.com>
As the sub queue id in the broadcast forwarding table is always
set to absolute queue 0 rather than the interface's relative queue 0,
this will cause the received broadcast packets loopback to rcb.
This patch sets the sub queue id to relative queue 0 of each port.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
PATCH V2: Addressed comments by David Miller
Link: https://lkml.org/lkml/2016/9/28/390
PATCH V1: Initial Submit
---
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 8 ++++++--
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 13 ++++++++++---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h | 2 ++
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
index e0f9cdc..2d0cb60 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
@@ -207,6 +207,7 @@ static int hns_ae_set_multicast_one(struct hnae_handle *handle, void *addr)
int ret;
char *mac_addr = (char *)addr;
struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle);
+ u8 port_num;
assert(mac_cb);
@@ -221,8 +222,11 @@ static int hns_ae_set_multicast_one(struct hnae_handle *handle, void *addr)
return ret;
}
- ret = hns_mac_set_multi(mac_cb, DSAF_BASE_INNER_PORT_NUM,
- mac_addr, true);
+ ret = hns_mac_get_inner_port_num(mac_cb, handle->vf_id, &port_num);
+ if (ret)
+ return ret;
+
+ ret = hns_mac_set_multi(mac_cb, port_num, mac_addr, true);
if (ret)
dev_err(handle->owner_dev,
"mac add mul_mac:%pM port%d fail, ret = %#x!\n",
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index a68eef0..151fd6e 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -141,9 +141,10 @@ void hns_mac_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex)
*@port_num:port number
*
*/
-static int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb,
- u8 vmid, u8 *port_num)
+int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb, u8 vmid, u8 *port_num)
{
+ int q_num_per_vf, vf_num_per_port;
+ int vm_queue_id;
u8 tmp_port;
if (mac_cb->dsaf_dev->dsaf_mode <= DSAF_MODE_ENABLE) {
@@ -174,6 +175,12 @@ static int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb,
return -EINVAL;
}
+ q_num_per_vf = mac_cb->dsaf_dev->rcb_common[0]->max_q_per_vf;
+ vf_num_per_port = mac_cb->dsaf_dev->rcb_common[0]->max_vfn;
+
+ vm_queue_id = vmid * q_num_per_vf +
+ vf_num_per_port * q_num_per_vf * mac_cb->mac_id;
+
switch (mac_cb->dsaf_dev->dsaf_mode) {
case DSAF_MODE_ENABLE_FIX:
tmp_port = 0;
@@ -193,7 +200,7 @@ static int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb,
case DSAF_MODE_DISABLE_6PORT_2VM:
case DSAF_MODE_DISABLE_6PORT_4VM:
case DSAF_MODE_DISABLE_6PORT_16VM:
- tmp_port = vmid;
+ tmp_port = vm_queue_id;
break;
default:
dev_err(mac_cb->dev, "dsaf mode invalid,%s mac%d!\n",
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h
index 4cbdf14..d3a1f72 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h
@@ -461,5 +461,7 @@ void hns_set_led_opt(struct hns_mac_cb *mac_cb);
int hns_cpld_led_set_id(struct hns_mac_cb *mac_cb,
enum hnae_led_state status);
void hns_mac_set_promisc(struct hns_mac_cb *mac_cb, u8 en);
+int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb,
+ u8 vmid, u8 *port_num);
#endif /* _HNS_DSAF_MAC_H */
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 5/8] net: hns: fix port not available after testing loopback
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, Kejian Yan
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: Kejian Yan <yankejian@huawei.com>
After running command "ethtool -t eth0", eth0 can not be connected to
network. It is caused by the changing the inner loopback register and
this register cannot be changed when hns connected to network. The
routine of setting this register needs to be removed and using promisc
mode to let the packet looped back pass by dsaf mode.
Reported-by: Jun He <hjat2005@huawei.com>
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Reviewed-by: Yisen Zhaung <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 3 ---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 10 ----------
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h | 1 -
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 7 +++++++
4 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
index e28d960..e0f9cdc 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
@@ -678,9 +678,6 @@ static int hns_ae_config_loopback(struct hnae_handle *handle,
ret = -EINVAL;
}
- if (!ret)
- hns_dsaf_set_inner_lb(mac_cb->dsaf_dev, mac_cb->mac_id, en);
-
return ret;
}
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
index 9283bc6..827d8fb 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
@@ -768,16 +768,6 @@ void hns_dsaf_set_promisc_mode(struct dsaf_device *dsaf_dev, u32 en)
DSAF_CFG_MIX_MODE_S, !!en);
}
-void hns_dsaf_set_inner_lb(struct dsaf_device *dsaf_dev, u32 mac_id, u32 en)
-{
- if (AE_IS_VER1(dsaf_dev->dsaf_ver) ||
- dsaf_dev->mac_cb[mac_id]->mac_type == HNAE_PORT_DEBUG)
- return;
-
- dsaf_set_dev_bit(dsaf_dev, DSAFV2_SERDES_LBK_0_REG + 4 * mac_id,
- DSAFV2_SERDES_LBK_EN_B, !!en);
-}
-
/**
* hns_dsaf_tbl_stat_en - tbl
* @dsaf_id: dsa fabric id
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
index 35df187..c494fc5 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
@@ -466,6 +466,5 @@ void hns_dsaf_get_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
u32 *en);
int hns_dsaf_set_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
u32 en);
-void hns_dsaf_set_inner_lb(struct dsaf_device *dsaf_dev, u32 mac_id, u32 en);
#endif /* __HNS_DSAF_MAIN_H__ */
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index ab33487..fa91ce3 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -342,6 +342,13 @@ static int __lb_setup(struct net_device *ndev,
break;
}
+ if (!ret) {
+ if (loop == MAC_LOOP_NONE)
+ h->dev->ops->set_promisc_mode(
+ h, ndev->flags & IFF_PROMISC);
+ else
+ h->dev->ops->set_promisc_mode(h, 1);
+ }
return ret;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 4/8] net: hns: delete repeat read fbd num after while
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, Daode Huang
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: Daode Huang <huangdaode@hisilicon.com>
Because we handle the received packets after napi, so delete the checking
before submitting. It delete the code of read the fbd number register,
which reduces the cpu usages while receiving packets
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index e6bfc51..09ed237 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -760,7 +760,7 @@ static int hns_nic_rx_poll_one(struct hns_nic_ring_data *ring_data,
{
struct hnae_ring *ring = ring_data->ring;
struct sk_buff *skb;
- int num, bnum, ex_num;
+ int num, bnum;
#define RCB_NOF_ALLOC_RX_BUFF_ONCE 16
int recv_pkts, recv_bds, clean_count, err;
int unused_count = hns_desc_unused(ring);
@@ -770,7 +770,7 @@ static int hns_nic_rx_poll_one(struct hns_nic_ring_data *ring_data,
recv_pkts = 0, recv_bds = 0, clean_count = 0;
num -= unused_count;
-recv:
+
while (recv_pkts < budget && recv_bds < num) {
/* reuse or realloc buffers */
if (clean_count + unused_count >= RCB_NOF_ALLOC_RX_BUFF_ONCE) {
@@ -798,17 +798,6 @@ recv:
recv_pkts++;
}
- /* make all data has been write before submit */
- if (recv_pkts < budget) {
- ex_num = readl_relaxed(ring->io_base + RCB_REG_FBDNUM);
- ex_num -= unused_count;
- if (ex_num > clean_count) {
- num += ex_num - clean_count;
- rmb(); /*complete read rx ring bd number*/
- goto recv;
- }
- }
-
out:
/* make all data has been write before submit */
if (clean_count + unused_count > 0)
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 3/8] net: hns: add fini_process for v2 napi process
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: salil.mehta-hv44wF8Li93QT0dZR+AlfA,
yisen.zhuang-hv44wF8Li93QT0dZR+AlfA,
xavier.huwei-hv44wF8Li93QT0dZR+AlfA,
oulijun-hv44wF8Li93QT0dZR+AlfA,
mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linuxarm-hv44wF8Li93QT0dZR+AlfA, Daode Huang
In-Reply-To: <20160929170916.631972-1-salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
From: Daode Huang <huangdaode-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
This patch adds fini_process for v2, it handles the packets recevied
by the hardware in the napi porcess. With this patch, the hardware irq
numbers will drop 50% per sec.
Signed-off-by: Daode Huang <huangdaode-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>
Reviewed-by: Yisen Zhuang <yisen.zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Salil Mehta <salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 45 +++++++++++++++++++++----
1 file changed, 38 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 32ff270..e6bfc51 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -823,6 +823,8 @@ static void hns_nic_rx_fini_pro(struct hns_nic_ring_data *ring_data)
struct hnae_ring *ring = ring_data->ring;
int num = 0;
+ ring_data->ring->q->handle->dev->ops->toggle_ring_irq(ring, 0);
+
/* for hardware bug fixed */
num = readl_relaxed(ring->io_base + RCB_REG_FBDNUM);
@@ -834,6 +836,20 @@ static void hns_nic_rx_fini_pro(struct hns_nic_ring_data *ring_data)
}
}
+static void hns_nic_rx_fini_pro_v2(struct hns_nic_ring_data *ring_data)
+{
+ struct hnae_ring *ring = ring_data->ring;
+ int num = 0;
+
+ num = readl_relaxed(ring->io_base + RCB_REG_FBDNUM);
+
+ if (num == 0)
+ ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
+ ring, 0);
+ else
+ napi_schedule(&ring_data->napi);
+}
+
static inline void hns_nic_reclaim_one_desc(struct hnae_ring *ring,
int *bytes, int *pkts)
{
@@ -935,7 +951,11 @@ static int hns_nic_tx_poll_one(struct hns_nic_ring_data *ring_data,
static void hns_nic_tx_fini_pro(struct hns_nic_ring_data *ring_data)
{
struct hnae_ring *ring = ring_data->ring;
- int head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
+ int head;
+
+ ring_data->ring->q->handle->dev->ops->toggle_ring_irq(ring, 0);
+
+ head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
if (head != ring->next_to_clean) {
ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
@@ -945,6 +965,18 @@ static void hns_nic_tx_fini_pro(struct hns_nic_ring_data *ring_data)
}
}
+static void hns_nic_tx_fini_pro_v2(struct hns_nic_ring_data *ring_data)
+{
+ struct hnae_ring *ring = ring_data->ring;
+ int head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
+
+ if (head == ring->next_to_clean)
+ ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
+ ring, 0);
+ else
+ napi_schedule(&ring_data->napi);
+}
+
static void hns_nic_tx_clr_all_bufs(struct hns_nic_ring_data *ring_data)
{
struct hnae_ring *ring = ring_data->ring;
@@ -976,10 +1008,7 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget)
if (clean_complete >= 0 && clean_complete < budget) {
napi_complete(napi);
- ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
- ring_data->ring, 0);
- if (ring_data->fini_process)
- ring_data->fini_process(ring_data);
+ ring_data->fini_process(ring_data);
return 0;
}
@@ -1755,7 +1784,8 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
rd->queue_index = i;
rd->ring = &h->qs[i]->tx_ring;
rd->poll_one = hns_nic_tx_poll_one;
- rd->fini_process = is_ver1 ? hns_nic_tx_fini_pro : NULL;
+ rd->fini_process = is_ver1 ? hns_nic_tx_fini_pro :
+ hns_nic_tx_fini_pro_v2;
netif_napi_add(priv->netdev, &rd->napi,
hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
@@ -1767,7 +1797,8 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
rd->ring = &h->qs[i - h->q_num]->rx_ring;
rd->poll_one = hns_nic_rx_poll_one;
rd->ex_process = hns_nic_rx_up_pro;
- rd->fini_process = is_ver1 ? hns_nic_rx_fini_pro : NULL;
+ rd->fini_process = is_ver1 ? hns_nic_rx_fini_pro :
+ hns_nic_rx_fini_pro_v2;
netif_napi_add(priv->netdev, &rd->napi,
hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH V2 for-next 2/8] net: hns: bug fix about setting coalsecs-usecs to 0
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, Daode Huang
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: Daode Huang <huangdaode@hisilicon.com>
When set rx/tx coalesce usecs to 0, the interrupt coalesce will be
disabled, but there is a interrupt rate limit which set to 1us, it
will cause no interrupt occurs. This patch disable interrupt limit
when sets coalsecs usecs to 0, and restores it to 1 in other case.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 16 ++++++++++++++++
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 4 ++++
2 files changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
index ef11077..f0ed80d6 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
@@ -543,6 +543,22 @@ int hns_rcb_set_coalesce_usecs(
"error: coalesce_usecs setting supports 0~1023us\n");
return -EINVAL;
}
+
+ if (!AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) {
+ if (timeout == 0)
+ /* set timeout to 0, Disable gap time */
+ dsaf_set_reg_field(rcb_common->io_base,
+ RCB_INT_GAP_TIME_REG + port_idx * 4,
+ PPE_INT_GAPTIME_M, PPE_INT_GAPTIME_B,
+ 0);
+ else
+ /* set timeout non 0, restore gap time to 1 */
+ dsaf_set_reg_field(rcb_common->io_base,
+ RCB_INT_GAP_TIME_REG + port_idx * 4,
+ PPE_INT_GAPTIME_M, PPE_INT_GAPTIME_B,
+ 1);
+ }
+
hns_rcb_set_port_timeout(rcb_common, port_idx, timeout);
return 0;
}
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
index 4b8b803..878950a 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
@@ -417,6 +417,7 @@
#define RCB_CFG_OVERTIME_REG 0x9300
#define RCB_CFG_PKTLINE_INT_NUM_REG 0x9304
#define RCB_CFG_OVERTIME_INT_NUM_REG 0x9308
+#define RCB_INT_GAP_TIME_REG 0x9400
#define RCB_PORT_CFG_OVERTIME_REG 0x9430
#define RCB_RING_RX_RING_BASEADDR_L_REG 0x00000
@@ -898,6 +899,9 @@
#define PPE_CNT_CLR_CE_B 0
#define PPE_CNT_CLR_SNAP_EN_B 1
+#define PPE_INT_GAPTIME_B 0
+#define PPE_INT_GAPTIME_M 0x3ff
+
#define PPE_COMMON_CNT_CLR_CE_B 0
#define PPE_COMMON_CNT_CLR_SNAP_EN_B 1
#define RCB_COM_TSO_MODE_B 0
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 1/8] net: hns: fix port unavailable after hnae_reserve_buffer_map fail
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm, lipeng
In-Reply-To: <20160929170916.631972-1-salil.mehta@huawei.com>
From: lipeng <lipeng321@huawei.com>
When hnae_reserve_buffer_map fail, it will break cycle and some
buffer description has no available memory, therefore the port will
be unavailable.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index d7e1f8c..32ff270 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -747,6 +747,14 @@ static void hns_nic_rx_up_pro(struct hns_nic_ring_data *ring_data,
ndev->last_rx = jiffies;
}
+static int hns_desc_unused(struct hnae_ring *ring)
+{
+ int ntc = ring->next_to_clean;
+ int ntu = ring->next_to_use;
+
+ return ((ntc >= ntu) ? 0 : ring->desc_num) + ntc - ntu;
+}
+
static int hns_nic_rx_poll_one(struct hns_nic_ring_data *ring_data,
int budget, void *v)
{
@@ -755,17 +763,21 @@ static int hns_nic_rx_poll_one(struct hns_nic_ring_data *ring_data,
int num, bnum, ex_num;
#define RCB_NOF_ALLOC_RX_BUFF_ONCE 16
int recv_pkts, recv_bds, clean_count, err;
+ int unused_count = hns_desc_unused(ring);
num = readl_relaxed(ring->io_base + RCB_REG_FBDNUM);
rmb(); /* make sure num taken effect before the other data is touched */
recv_pkts = 0, recv_bds = 0, clean_count = 0;
+ num -= unused_count;
recv:
while (recv_pkts < budget && recv_bds < num) {
/* reuse or realloc buffers */
- if (clean_count >= RCB_NOF_ALLOC_RX_BUFF_ONCE) {
- hns_nic_alloc_rx_buffers(ring_data, clean_count);
+ if (clean_count + unused_count >= RCB_NOF_ALLOC_RX_BUFF_ONCE) {
+ hns_nic_alloc_rx_buffers(ring_data,
+ clean_count + unused_count);
clean_count = 0;
+ unused_count = hns_desc_unused(ring);
}
/* poll one pkt */
@@ -789,7 +801,7 @@ recv:
/* make all data has been write before submit */
if (recv_pkts < budget) {
ex_num = readl_relaxed(ring->io_base + RCB_REG_FBDNUM);
-
+ ex_num -= unused_count;
if (ex_num > clean_count) {
num += ex_num - clean_count;
rmb(); /*complete read rx ring bd number*/
@@ -799,8 +811,9 @@ recv:
out:
/* make all data has been write before submit */
- if (clean_count > 0)
- hns_nic_alloc_rx_buffers(ring_data, clean_count);
+ if (clean_count + unused_count > 0)
+ hns_nic_alloc_rx_buffers(ring_data,
+ clean_count + unused_count);
return recv_pkts;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH V2 for-next 0/8] Bug Fixes and Code Improvement in HNS driver
From: Salil Mehta @ 2016-09-29 17:09 UTC (permalink / raw)
To: dledford
Cc: salil.mehta, yisen.zhuang, xavier.huwei, oulijun, mehta.salil.lnk,
linux-rdma, netdev, linux-kernel, linuxarm
This patch-set introduces fix to some Bugs, potential problems
and code improvements identified during internal review and
testing of Hisilicon Network Subsystem driver.
Submit Change
V1->V2: This addresses the feedbacks provided by David Miller
and Doug Ledford
Daode Huang (6):
net: hns: bug fix about setting coalsecs-usecs to 0
net: hns: add fini_process for v2 napi process
net: hns: delete repeat read fbd num after while
net: hns: fix the bug of forwarding table
net: hns: bug fix about broadcast/multicast packets
net: hns: delete redundant broadcast packet filter process
Kejian Yan (1):
net: hns: fix port not available after testing loopback
lipeng (1):
net: hns: fix port unavailable after hnae_reserve_buffer_map fail
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 11 +-
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 13 ++-
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h | 2 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 10 --
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h | 1 -
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 16 +++
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 4 +
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 107 +++++++++++++-------
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 7 ++
9 files changed, 118 insertions(+), 53 deletions(-)
--
1.7.9.5
^ permalink raw reply
* Re: rdma-core: cmake minimum version issue on RH 6.5
From: Jason Gunthorpe @ 2016-09-29 16:46 UTC (permalink / raw)
To: Doug Ledford
Cc: Yishai, RDMA mailing list,
majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, Alaa Hleihel
In-Reply-To: <57ED2E87.50008-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Thu, Sep 29, 2016 at 11:08:55AM -0400, Doug Ledford wrote:
> On 9/29/16 7:40 AM, Yishai Hadas wrote:
> > Hi Jason,
> >
> > Currently there is a hard requirement of cmake minimum version of 2.8.11
> > to build the rdma-core project. (i.e. cmake_minimum_required(VERSION
> > 2.8.11 ATAL_ERROR)).
> >
> >
> > Trying to build with default yum install of cmake on RH6.5 fails as it
> > doesn't meet the above requirement. (i.e. cmake version 2.6-patch 4).
> >
> > As a test phase, we tried to comment out this limitation from the cmake
> > files, however, the build failed with few other errors. (e.g. CMake
> > Error at buildlib/rdma_functions.cmake:39 (set_property):
> > set_property could not find TARGET APPEND_STRING. Perhaps it has not yet
> > been created).
> >
> > Is it a real requirement for above cmake minimum version in this project
> > ? if yes, where the appropriate cmake should come from to work on RH6.5.
> Is anyone really running 6.5? I mean the current version in the 6
> family is 6.8, and there are significant improvements between 6.5 and 6.8.
Indeed, I did my testing on CentOS 6.8 and everything is fine. I
expect that RHEL6.8 has the same cmake version.
Simple Options:
- Upgrade to 6.8 and forget about 6.5, it is years old and deficient
on security updates at this point?
- Do your build on 6.8, the resulting binary should still work on 6.5?
- Cherry pick the cmake RPM from 6.8 eg
yum install ftp://fr2.rpmfind.net/linux/centos/6.8/os/x86_64/Packages/cmake-2.8.12.2-4.el6.x86_64.rpm
- Use EPEL according to the README.md and install cmake3 from EPEL.
I don't know if EPEL supports obsolete distros.
> > Is it a real requirement for above cmake minimum version in this project
> > ? if yes.
It is a real requirement, cmake has lots of tools to deal with changes
across versions so it could probably be relaxed, but I've tried to
keep everything simple so I'm not excited about a bunch more stuff to
support a 7 year old version of cmake.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Doug Ledford @ 2016-09-29 16:26 UTC (permalink / raw)
To: Jason Gunthorpe, Christoph Hellwig
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Leon Romanovsky
In-Reply-To: <20160929161659.GA774-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1819 bytes --]
On 9/29/16 12:16 PM, Jason Gunthorpe wrote:
> On Thu, Sep 29, 2016 at 09:00:53AM -0700, Christoph Hellwig wrote:
>> Hi Jason,
>>
>> any chance you could simply follow the modern debian copyright file
>> format:
>
> I was thinking about doing that.. But choose not to for this first
> draft.
>
> 1) I'd have to go and unwind on a file by file basis exactly what
> every licnese is. Right now I've just done a survey. There are many
> copyrightable files with no license text, and many potentially
> non-copyrightable files with no license text as well. All that
> needs to be figured out first.
>
> I would like to add at least short license headers to every file.
> 2) It seems to require listing the copyright owners for every file,
> this is a royal pain, IMHO. Many copyrightable files do not have
> copyright data, so it would have to be mined out of git. I have
> a script that does that someplace..
>
> My thinking was to start small, document the survey results (and agree
> my interpetation is sensible), then work on achiveing full copyright
> headers, then use that to build the debian format.
>
> I'd appreciate help, eg patches moving toward #1 and eliminating the
> free COPYING files and unlicnesed items. I think it will take a bit to
> get there, I still have a bit wack of patches to get applied on other
> topics..
I just merged a pull request of yours, and that was the last outstanding
pull request in the github. I still have to sort through patches on the
list that aren't in the github interface...but at least 20 or so of your
outstanding patches were taken in today.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG Key ID: 0E572FDD
Red Hat, Inc.
100 E. Davie St
Raleigh, NC 27601 USA
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 907 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-core] Add a .travis.yml file
From: Jason Gunthorpe @ 2016-09-29 16:25 UTC (permalink / raw)
To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <57ED3128.4060509-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Thu, Sep 29, 2016 at 11:20:08AM -0400, Doug Ledford wrote:
> > https://github.com/linux-rdma/rdma-core/pull/7
>
> Merged, thanks.
FWIW, I updated the docker stuff in my preview tree to approximate
what travis does:
docker/do_docker.py pkg travis
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Jason Gunthorpe @ 2016-09-29 16:16 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford, Leon Romanovsky
In-Reply-To: <20160929160053.GA11879-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
On Thu, Sep 29, 2016 at 09:00:53AM -0700, Christoph Hellwig wrote:
> Hi Jason,
>
> any chance you could simply follow the modern debian copyright file
> format:
I was thinking about doing that.. But choose not to for this first
draft.
1) I'd have to go and unwind on a file by file basis exactly what
every licnese is. Right now I've just done a survey. There are many
copyrightable files with no license text, and many potentially
non-copyrightable files with no license text as well. All that
needs to be figured out first.
I would like to add at least short license headers to every file.
2) It seems to require listing the copyright owners for every file,
this is a royal pain, IMHO. Many copyrightable files do not have
copyright data, so it would have to be mined out of git. I have
a script that does that someplace..
My thinking was to start small, document the survey results (and agree
my interpetation is sensible), then work on achiveing full copyright
headers, then use that to build the debian format.
I'd appreciate help, eg patches moving toward #1 and eliminating the
free COPYING files and unlicnesed items. I think it will take a bit to
get there, I still have a bit wack of patches to get applied on other
topics..
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Christoph Hellwig @ 2016-09-29 16:00 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford, Leon Romanovsky
In-Reply-To: <20160923041340.GA11269-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Hi Jason,
any chance you could simply follow the modern debian copyright file
format:
https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
This format lists the copyright applying to each file while allowing
grouping for multiple files. I think that's the best way to document
the licensing situation for a project that hasa few different licenses.
The catchall in this format also gives a good statement on what the
default for the repository should be.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH rdma-core] Improve global COPYING files
From: Doug Ledford @ 2016-09-29 15:53 UTC (permalink / raw)
To: Jason Gunthorpe, Hefty Sean
Cc: Leon Romanovsky,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20160923174848.GC13920-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2174 bytes --]
On 9/23/16 1:48 PM, Jason Gunthorpe wrote:
> On Fri, Sep 23, 2016 at 05:23:29PM +0000, Hefty, Sean wrote:
>
>> If this combined repo is intended to support the plumbing for the
>> linux-rdma subsystem, then I think it must support code that is
>> submitted under GPL only.
>
> Hum, I don't think that follows.
>
> My expectation in the kernel is that the entire RDMA subystem and
> drivers follows the overall licensing model of the kernel and does not
> require userspace to follow any specific license, and certainly does
> not require userspace to follow the GPLv2.
>
>> Much of the tradition code can remain dual-license, but new provider
>> code, for example, should be submit-able under GPL.
>
> I do not support that recommendation.
>
> The FSF has made very clear their position on GPL licensing of plugins
> (see https://www.gnu.org/licenses/gpl-faq.en.html), and allowing a
> GPLv2 only plugin or library code would break our community's promise
> to our customers - that the library core is usable in any application.
>
> It would be a complicated discussion if someone proposed a GPLv2 only
> provider.
>
> A LGPLv2-only provider would be more acceptable, and I would encourage
> anyone who wishes to have the protections of the GPLv2 in their
> provider to go that route. I suspect it would still be controversial.
>
> I would prefer to see us continue with the dual license approach, and
> obviously all OFA member companies have agreed to do that.
I agree with Jason here. Dual license or at least LGPL is needed on
providers because they will be linked to by other programs. Libraries
shouldn't taint user programs. But we do have some leaf code in the
overall rdma-core repo. Things like iwpmd and ibacm. These could be
licensed GPL only and still be OK. So I think it's OK for the repo to
support GPL only, we just have to be clear about the fact that GPL only
is not the default as this repo is more about libraries than leaf utilities.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG Key ID: 0E572FDD
Red Hat, Inc.
100 E. Davie St
Raleigh, NC 27601 USA
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 907 bytes --]
^ permalink raw reply
* Re: [PATCH rdma-core] Add a .travis.yml file
From: Doug Ledford @ 2016-09-29 15:20 UTC (permalink / raw)
To: Jason Gunthorpe,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1475105337-18002-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 933 bytes --]
On 9/28/16 7:28 PM, Jason Gunthorpe wrote:
> Necessary to use the Travis CI service.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> ---
> .travis.yml | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
> create mode 100644 .travis.yml
>
> Now that travis is enabled on repo, we need a yml file to make it run.
>
> Here is a basic one.
>
> I don't test with distros as old as precise and I don't expect that glibc to
> be new enough to build this (eg missing timerfd, O_CLOEXEC, etc), and the
> cmake certainly isn't. So we use the trusty 'beta' environment and install
> gcc 6.2.
>
> See it in action:
>
> https://github.com/linux-rdma/rdma-core/pull/7
Merged, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG Key ID: 0E572FDD
Red Hat, Inc.
100 E. Davie St
Raleigh, NC 27601 USA
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 907 bytes --]
^ permalink raw reply
* Re: [PATCH V1 rdma-core 0/5] Licensing and cleanup issues
From: Doug Ledford @ 2016-09-29 15:19 UTC (permalink / raw)
To: Yishai Hadas,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
In-Reply-To: <1475147462-803-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 4162 bytes --]
On 9/29/16 7:10 AM, Yishai Hadas wrote:
> Sending V1 to introduce few notes got from Jason, details below.
>
> This series comes to solve some potential licensing issue around list.h
> and ocrdma_list.h by using the CCAN functionality which has BSD license.
>
> The CCAN required functionality was taken as is with minor touches as of
> flattening the directory structure, its original header
> with the licensing note was preserved.
>
> In addition, the series drops some local definitions and use shared code instead.
> Pull request was sent [1]
>
> [1] https://github.com/linux-rdma/rdma-core/pull/5
>
> Changes from V0:
> Patch #2: Move to use min_t/max_t and fix typing issues among the project.
> Add involved license files to ccan.
> Sort list of files in ccan/CMakeLists.txt.
> Use buildlib/config.h.in for ccan HAVE_XXX.
It looks to me as you successfully addressed Jason's comments, so I've
merged this patch set. Future changes will need to be incremental
patches. Thanks!
> Patch #3: Add ccan/str.c and update relevant cmake files.
> Sort list of files in ccan/CMakeLists.txt.
>
> Yishai Hadas (5):
> Remove container_of and offset local declarations
> ccan: Add CCAN min and max functionality
> ccan: Add list functionality
> libmlx5: Move to use CCAN list functionality
> libocrdma: Move to use CCAN list functionality
>
> CMakeLists.txt | 1 +
> buildlib/config.h.in | 10 +
> buildlib/publish_headers.cmake | 18 +-
> buildlib/rdma_functions.cmake | 8 +
> ccan/BSD-MIT | 17 +
> ccan/CC0 | 97 ++++
> ccan/CMakeLists.txt | 16 +
> ccan/build_assert.h | 40 ++
> ccan/check_type.h | 64 +++
> ccan/container_of.h | 146 ++++++
> ccan/list.h | 842 +++++++++++++++++++++++++++++++++++
> ccan/minmax.h | 65 +++
> ccan/str.c | 13 +
> ccan/str.h | 228 ++++++++++
> ccan/str_debug.h | 30 ++
> ibacm/CMakeLists.txt | 6 +-
> ibacm/linux/osd.h | 8 +-
> ibacm/prov/acmp/src/acmp.c | 2 +-
> iwpmd/src/CMakeLists.txt | 2 +-
> libibcm/examples/CMakeLists.txt | 2 +-
> libibcm/src/cm.c | 5 -
> libibumad/tests/CMakeLists.txt | 4 +-
> libibverbs/examples/CMakeLists.txt | 16 +-
> libibverbs/examples/rc_pingpong.c | 12 +-
> libmlx5/src/buf.c | 11 +-
> libmlx5/src/list.h | 331 --------------
> libmlx5/src/mlx5.c | 2 +-
> libmlx5/src/mlx5.h | 19 +-
> libmlx5/src/qp.c | 4 +-
> libmlx5/src/srq.c | 2 +-
> libmlx5/src/verbs.c | 21 +-
> libocrdma/src/ocrdma_list.h | 104 -----
> libocrdma/src/ocrdma_main.c | 24 +-
> libocrdma/src/ocrdma_main.h | 12 +-
> libocrdma/src/ocrdma_verbs.c | 33 +-
> librdmacm/examples/CMakeLists.txt | 26 +-
> librdmacm/src/cma.h | 11 +-
> librdmacm/src/rsocket.c | 13 +-
> srp_daemon/srp_daemon/CMakeLists.txt | 2 +-
> 39 files changed, 1692 insertions(+), 575 deletions(-)
> create mode 100644 ccan/BSD-MIT
> create mode 100644 ccan/CC0
> create mode 100644 ccan/CMakeLists.txt
> create mode 100644 ccan/build_assert.h
> create mode 100644 ccan/check_type.h
> create mode 100644 ccan/container_of.h
> create mode 100644 ccan/list.h
> create mode 100644 ccan/minmax.h
> create mode 100644 ccan/str.c
> create mode 100644 ccan/str.h
> create mode 100644 ccan/str_debug.h
> delete mode 100644 libmlx5/src/list.h
> delete mode 100644 libocrdma/src/ocrdma_list.h
>
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG Key ID: 0E572FDD
Red Hat, Inc.
100 E. Davie St
Raleigh, NC 27601 USA
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 907 bytes --]
^ permalink raw reply
* Re: rdma-core: cmake minimum version issue on RH 6.5
From: Doug Ledford @ 2016-09-29 15:08 UTC (permalink / raw)
To: Yishai, Gunthorpe Jason
Cc: RDMA mailing list, majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
Alaa Hleihel
In-Reply-To: <5169a490-10b4-cb9f-d7b7-fb552692f1f6-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1173 bytes --]
On 9/29/16 7:40 AM, Yishai Hadas wrote:
> Hi Jason,
>
> Currently there is a hard requirement of cmake minimum version of 2.8.11
> to build the rdma-core project. (i.e. cmake_minimum_required(VERSION
> 2.8.11 ATAL_ERROR)).
>
>
> Trying to build with default yum install of cmake on RH6.5 fails as it
> doesn't meet the above requirement. (i.e. cmake version 2.6-patch 4).
>
> As a test phase, we tried to comment out this limitation from the cmake
> files, however, the build failed with few other errors. (e.g. CMake
> Error at buildlib/rdma_functions.cmake:39 (set_property):
> set_property could not find TARGET APPEND_STRING. Perhaps it has not yet
> been created).
>
> Is it a real requirement for above cmake minimum version in this project
> ? if yes, where the appropriate cmake should come from to work on RH6.5.
>
> Yishai
>
>
Is anyone really running 6.5? I mean the current version in the 6
family is 6.8, and there are significant improvements between 6.5 and 6.8.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG Key ID: 0E572FDD
Red Hat, Inc.
100 E. Davie St
Raleigh, NC 27601 USA
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 907 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox