Re: [PATCH 4/4] ibacm: Use alias name when possible

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

 



On Thu, Jan 24, 2019 at 03:47:38PM +0100, Håkon Bugge wrote:
> When using ipoib child interfaces, the names displayed by the ip
> utility show:
> 
>  # ip addr show | grep inet' ' | grep ib
>     inet 192.168.200.201/24 scope global stib1
>     inet 192.168.200.200/24 scope global secondary stib1:P03
> 
> However, the logging of ibacm uses the device names (slightly edited
> for better brevity):
> 
>  # grep acm_ep_ip_iter_cb /usr/local/var/log/ibacm.log
> Added 192.168.200.201/24 mlx4_0 2 0x84b4 from stib1
> Added 192.168.200.200/24 mlx4_0 2 0x84b4 from stib1
> 
> This commit changes this by using the alias name when possible, and
> the above would read:
> 
>  # grep acm_ep_ip_iter_cb /usr/local/var/log/ibacm.log
> Added 192.168.200.201/24 mlx4_0 2 0x84b4 from stib1
> Added 192.168.200.200/24 mlx4_0 2 0x84b4 from stib1:P03
> 
> Change-Id: I71e91f94f1e9c9037df96a87db57b9718b28eed3
> Signed-off-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx>

Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>

> ---
>  ibacm/src/acm_util.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ibacm/src/acm_util.c b/ibacm/src/acm_util.c
> index 2c050aa0..172dcc63 100644
> --- a/ibacm/src/acm_util.c
> +++ b/ibacm/src/acm_util.c
> @@ -226,7 +226,8 @@ void acm_if_iter(struct nl_object *obj, void *_ctx_and_cb)
>  		be64toh(*guid_ptr));
>  
>  	memcpy(&bin_addr, nl_addr_get_binary_addr(a), addr_len);
> -	ctx_cb->cb(rtnl_link_get_name(link), &sgid, pkey, af2acm_addr_type(af), bin_addr, ip_str, ctx_cb->ctx);
> +	ctx_cb->cb(label ? label : rtnl_link_get_name(link),
> +		   &sgid, pkey, af2acm_addr_type(af), bin_addr, ip_str, ctx_cb->ctx);
>  }
>  
>  
> -- 
> 2.20.1
> 



[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