From patchwork Fri Feb 1 18:50:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Haakon Bugge X-Patchwork-Id: 10793519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC81213B5 for ; Fri, 1 Feb 2019 18:51:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FE7B32C9F for ; Fri, 1 Feb 2019 18:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93CB832CE5; Fri, 1 Feb 2019 18:51:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DA9232CFC for ; Fri, 1 Feb 2019 18:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730583AbfBASva (ORCPT ); Fri, 1 Feb 2019 13:51:30 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34388 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730471AbfBASv3 (ORCPT ); Fri, 1 Feb 2019 13:51:29 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x11Ihn66159576; Fri, 1 Feb 2019 18:51:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=G8TuojEkorEyyqaDxsQZCdcPT8RA8xjBFWvC9gt5u00=; b=DTKECr2V9yX9qmPWxSI6wbnG0pERoX5BjKHKVfo7zW0aV01Nv2b46RilHCtr1/p9+tKb +t3cnoETACibukKWoNqHC6U79AbpNJJ5TSEb5c+gj8Q9U8R+clW0BxO4zh/gFY9ymeEA 6AE0ObpBcOjEXW7+h9zL0kxJVoQX0IeYaJE1W5bYaH3Z+tv7Mxgh1nS/4vPeyGDwN3oP 4CCRynSToSNjAU5hVsJhGHrQXSXhi+YKy8bGpONg+8EjHYgsshKuTc3nFoqzcjn+gTcp QSOMKMqGIsJoswJg0I3OQPfOGbkbwH25ssVp3DE0KmQYokxiBeO/yUSb2IRYDMj5+jQ8 3Q== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2q8d2ergsm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Feb 2019 18:51:21 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x11IpK2m019806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 1 Feb 2019 18:51:21 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x11IpKlm020470; Fri, 1 Feb 2019 18:51:20 GMT Received: from lab02.no.oracle.com (/10.172.144.56) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Feb 2019 10:51:19 -0800 From: =?utf-8?q?H=C3=A5kon_Bugge?= To: jgg@mellanox.com Cc: dledford@redhat.com, hal@dev.mellanox.co.il, sean.hefty@intel.com, leon@kernel.org, linux-rdma@vger.kernel.org, ira.weiny@intel.com, aron.silverton@oracle.com, mark.haywood@oracle.com Subject: [PATCH v4 4/4] ibacm: Use alias name when possible Date: Fri, 1 Feb 2019 19:50:49 +0100 Message-Id: <20190201185049.239177-5-haakon.bugge@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201185049.239177-1-haakon.bugge@oracle.com> References: <20190201185049.239177-1-haakon.bugge@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9154 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902010138 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Håkon Bugge Reviewed-by: Ira Weiny --- v1 -> v2: * Added Ira's r-b * Removed Gerrit's Change-Id tag (Håkon) --- 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 8807579d..828501df 100644 --- a/ibacm/src/acm_util.c +++ b/ibacm/src/acm_util.c @@ -216,7 +216,8 @@ static void acm_if_iter(struct nl_object *obj, void *_ctx_and_cb) be64toh(sgid.global.interface_id)); 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); }