From patchwork Fri Mar 28 05:50:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 3900961 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3CE56BF549 for ; Fri, 28 Mar 2014 05:50:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84497202FE for ; Fri, 28 Mar 2014 05:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A95B4202EC for ; Fri, 28 Mar 2014 05:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbaC1FuY (ORCPT ); Fri, 28 Mar 2014 01:50:24 -0400 Received: from mga02.intel.com ([134.134.136.20]:2933 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202AbaC1FuT (ORCPT ); Fri, 28 Mar 2014 01:50:19 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 27 Mar 2014 22:50:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,748,1389772800"; d="scan'208";a="501476379" Received: from cst-linux.jf.intel.com ([10.23.221.72]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2014 22:50:17 -0700 From: sean.hefty@intel.com To: linux-rdma@vger.kernel.org Cc: Ira Weiny Subject: [PATCH 13/16] ibacm: fix handling of aliased IPoIB devices Date: Thu, 27 Mar 2014 22:50:07 -0700 Message-Id: <1395985810-23822-14-git-send-email-sean.hefty@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1395985810-23822-1-git-send-email-sean.hefty@intel.com> References: <1395985810-23822-1-git-send-email-sean.hefty@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ira Weiny ibX:Y devices don't have sysfs files directly. They use the "base" interface of ibX. The ioctl calls however include the full aliased name. Netlink does not have this problem as the interface name is reported as it appears in sysfs. Signed-off-by: Ira Weiny --- src/acm_util.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/acm_util.c b/src/acm_util.c index c3c5b69..da6d058 100644 --- a/src/acm_util.c +++ b/src/acm_util.c @@ -134,6 +134,7 @@ int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx) uint8_t addr_type; uint8_t addr[ACM_MAX_ADDRESS]; size_t addr_len; + char *alias_sep; s = socket(AF_INET6, SOCK_DGRAM, 0); if (!s) @@ -177,6 +178,12 @@ int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx) continue; } + acm_log(2, "%s\n", ifr[i].ifr_name); + + alias_sep = strchr(ifr[i].ifr_name, ':'); + if (alias_sep) + *alias_sep = '\0'; + if (!acm_if_is_ib(ifr[i].ifr_name)) continue;