Re: [PATCH v3 1/4] ibacm: Replace ioctl with netlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 01, 2019 at 05:45:54PM +0100, Håkon Bugge wrote:
> ibacm uses ioctl with SIOCGIFCONF to enumerate the interfaces. This
> particular ioctl will only return interfaces that are "running".
> 
> This is a problem if, for example, ibacm is started before the
> interfaces get plumbed, or when an interface gets resurrected.
> 
> By using netlink (nl), we avoid using the sysfs interface to read the
> gid, as it is supplied directly by nl.
> 
> This commit does not change the existing functionality, but is made
> to prepare for a fix where ibacm is unable to resurrect an interface.
> 
> Detailed logging added:
> 
> acm_if_iter: name: stib0 label:     stib0 index:  9
> flags: broadcast,multicast,up,running,lowerup
> addr: 192.168.200.200/24 pkey: 0x88b4 guid: 0x21280001a17c97
> 
> Signed-off-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx>
> Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> 
> 
> v1 -> v2:
>    * Use static for CB function (Jason, Ira)
>    * Use original order of includes (Ira)
>    * Use ib_gid's global.interface_id instead of casting (Ira)
>    * Require Netlink in CMakeLists.txt (Jason)
>    * Removed ioctl.h include (Håkon)
>    * Removed Gerrit's Change-Id tag (Håkon)
>  ibacm/CMakeLists.txt |   4 +
>  ibacm/src/acm.c      |   7 ++
>  ibacm/src/acm_util.c | 251 ++++++++++++++++++++++++-------------------
>  ibacm/src/acm_util.h |   5 +-
>  4 files changed, 155 insertions(+), 112 deletions(-)
> 
> diff --git a/ibacm/CMakeLists.txt b/ibacm/CMakeLists.txt
> index 3a4e2632..7020def6 100644
> +++ b/ibacm/CMakeLists.txt
> @@ -1,3 +1,5 @@
> +pkg_check_modules(NL libnl-3.0 libnl-route-3.0 REQUIRED)

This should follow the pattern of iwpmd:

if (NOT NL_KIND EQUAL 0)
  add_subdirectory(iwpmd)
endif()

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux