diff mbox series

[rdma-core,1/8] verbs: Remove support for libnl1

Message ID 20180920163910.4403-2-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series Various small fixes | expand

Commit Message

Jason Gunthorpe Sept. 20, 2018, 4:39 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

This hasn't been needed or tested in a long time, all supported distros
have libnl3.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 CMakeLists.txt       | 23 ++---------------------
 buildlib/config.h.in |  6 +-----
 libibverbs/neigh.c   |  2 --
 libibverbs/neigh.h   |  9 ---------
 4 files changed, 3 insertions(+), 37 deletions(-)
diff mbox series

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 85858a97b41d96..8e88dc78d1d3eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -366,25 +366,9 @@  if (NOT DEFINED ENABLE_RESOLVE_NEIGH)
 endif()
 if (ENABLE_RESOLVE_NEIGH)
   # FIXME use of pkgconfig is discouraged
-  pkg_check_modules(NL3 libnl-3.0 libnl-route-3.0)
-  if (NL3_FOUND)
-    set(NL_KIND 3)
-    set(NL_INCLUDE_DIRS ${NL3_INCLUDE_DIRS})
-    set(NL_LIBRARIES ${NL3_LIBRARIES})
-  else()
-    # FIXME: I don't know why we have this fallback, all supported distros
-    # have libnl3
-    pkg_check_modules(NL1 libnl-1)
-    if (NL1_FOUND)
-      set(NL_KIND 1)
-      set(NL_INCLUDE_DIRS ${NL1_INCLUDE_DIRS})
-      set(NL_LIBRARIES ${NL1_LIBRARIES})
-    else()
-      message(FATAL_ERROR "Cannot find libnl-3.0 or libnl-1")
-    endif()
-  endif()
-
+  pkg_check_modules(NL libnl-3.0 libnl-route-3.0 REQUIRED)
   include_directories(${NL_INCLUDE_DIRS})
+  set(NL_KIND 3)
 else()
   set(NL_KIND 0)
   set(NL_LIBRARIES "")
@@ -606,9 +590,6 @@  endif()
 if (NOT HAVE_VALGRIND_DRD)
   message(STATUS " Valgrind drd.h NOT enabled")
 endif()
-if (NL_KIND EQUAL 1)
-  message(STATUS " libnl 3 NOT found (using libnl 1 compat)")
-endif()
 if (NL_KIND EQUAL 0)
   message(STATUS " neighbour resolution NOT enabled")
 else()
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index e1ae72c5cba5cf..0754d249423476 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -46,11 +46,7 @@ 
 
 @SIZEOF_LONG_CODE@
 
-#if @NL_KIND@ == 3
-# define HAVE_LIBNL3 1
-#elif @NL_KIND@ == 1
-# define HAVE_LIBNL1 1
-#elif @NL_KIND@ == 0
+#if @NL_KIND@ == 0
 # define NRESOLVE_NEIGH 1
 #endif
 
diff --git a/libibverbs/neigh.c b/libibverbs/neigh.c
index cfc593a0473b12..59f9b57db280e2 100644
--- a/libibverbs/neigh.c
+++ b/libibverbs/neigh.c
@@ -39,9 +39,7 @@  extern unsigned int if_nametoindex(__const char *__ifname) __THROW;
 
 #include "neigh.h"
 
-#ifndef HAVE_LIBNL1
 #include <netlink/route/link/vlan.h>
-#endif
 
 static pthread_once_t device_neigh_alloc = PTHREAD_ONCE_INIT;
 static struct nl_sock *zero_socket;
diff --git a/libibverbs/neigh.h b/libibverbs/neigh.h
index 88211bf2f489f0..b1812d1b83a413 100644
--- a/libibverbs/neigh.h
+++ b/libibverbs/neigh.h
@@ -7,19 +7,10 @@ 
 #include <stddef.h>
 #include <stdint.h>
 #include "config.h"
-#ifdef HAVE_LIBNL1
-#include <netlink/object.h>
-#include "nl1_compat.h"
-#else
 #include <netlink/object-api.h>
-#endif
 
 struct get_neigh_handler {
-#ifdef HAVE_LIBNL1
-	struct nl_handle *sock;
-#else
 	struct nl_sock *sock;
-#endif
 	struct nl_cache *link_cache;
 	struct nl_cache	*neigh_cache;
 	struct nl_cache *route_cache;