From patchwork Fri Mar 28 05:50:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 3900991 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 28FE09F2E8 for ; Fri, 28 Mar 2014 05:50:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2858202E6 for ; Fri, 28 Mar 2014 05:50:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DB47202F0 for ; Fri, 28 Mar 2014 05:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751038AbaC1Fux (ORCPT ); Fri, 28 Mar 2014 01:50:53 -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 S1751249AbaC1FuV (ORCPT ); Fri, 28 Mar 2014 01:50:21 -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="501476382" 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 14/16] ibacm: ib_acme remove IP addresses from ibacm_addr.cfg file generation Date: Thu, 27 Mar 2014 22:50:08 -0700 Message-Id: <1395985810-23822-15-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 Signed-off-by: Ira Weiny --- Makefile.am | 3 +- linux/acme_linux.c | 95 ---------------------------------------------------- man/ib_acme.1 | 3 +- src/acme.c | 12 ++----- 4 files changed, 5 insertions(+), 108 deletions(-) delete mode 100644 linux/acme_linux.c diff --git a/Makefile.am b/Makefile.am index cab1ca1..9070a5a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,8 +5,7 @@ AM_CFLAGS = -g -Wall -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(b bin_PROGRAMS = util/ib_acme sbin_PROGRAMS = svc/ibacm svc_ibacm_SOURCES = src/acm.c src/acm_util.c -util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c src/libacm.c linux/libacm_linux.c \ - src/parse.c src/acm_util.c +util_ib_acme_SOURCES = src/acme.c src/libacm.c linux/libacm_linux.c src/parse.c svc_ibacm_CFLAGS = $(AM_CFLAGS) util_ib_acme_CFLAGS = $(AM_CFLAGS) -DACME_PRINTS diff --git a/linux/acme_linux.c b/linux/acme_linux.c deleted file mode 100644 index 33fafd2..0000000 --- a/linux/acme_linux.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2009 Intel Corporation. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include -#include -#include - -#include -#include "acm_util.h" - -extern struct ibv_context **verbs; -extern int dev_cnt; -extern int verbose; - -static int -get_devaddr(union ibv_gid *sgid, int *dev_index, uint8_t *port) -{ - struct ibv_device_attr dev_attr; - struct ibv_port_attr port_attr; - union ibv_gid gid; - int ret, i; - - for (*dev_index = 0; *dev_index < dev_cnt; (*dev_index)++) { - ret = ibv_query_device(verbs[*dev_index], &dev_attr); - if (ret) - continue; - - for (*port = 1; *port <= dev_attr.phys_port_cnt; (*port)++) { - ret = ibv_query_port(verbs[*dev_index], *port, &port_attr); - if (ret) - continue; - - for (i = 0; i < port_attr.gid_tbl_len; i++) { - ret = ibv_query_gid(verbs[*dev_index], *port, i, &gid); - if (ret || !gid.global.interface_id) - break; - - if (!memcmp(sgid->raw, gid.raw, sizeof gid)) - return 0; - } - } - } - return -1; -} - -static void iter_cb(char *ifname, union ibv_gid *gid, uint16_t pkey, - uint8_t addr_type, uint8_t *addr, size_t addr_len, - char *addr_name, void *ctx) -{ - FILE *f = (FILE *)ctx; - int ret; - int dev_index; - uint8_t port; - - ret = get_devaddr(gid, &dev_index, &port); - if (ret) { - printf("Failed to find verbs device for %s\n", ifname); - return; - } - - if (verbose) - printf("%s %s %d 0x%x\n", addr_name, verbs[dev_index]->device->name, port, pkey); - fprintf(f, "%s %s %d 0x%x\n", addr_name, verbs[dev_index]->device->name, port, pkey); -} - -int gen_addr_ip(FILE *f) -{ - return acm_if_iter_sys(iter_cb, (void *)f); -} diff --git a/man/ib_acme.1 b/man/ib_acme.1 index b00b315..baa1dd6 100644 --- a/man/ib_acme.1 +++ b/man/ib_acme.1 @@ -55,8 +55,7 @@ performance of ACM cache lookups. Defaults to 1. \-A [addr_file] With this option, the ib_acme utility automatically generates the address configuration file ibacm_addr.cfg. The generated file is -constructed using the system host name and any IP addresses that are -assigned to IPoIB device instances. +constructed using the system host name. .TP \-O [opt_file] With this option, the ib_acme utility automatically generates the option diff --git a/src/acme.c b/src/acme.c index fbe9dbc..61797af 100644 --- a/src/acme.c +++ b/src/acme.c @@ -317,9 +317,11 @@ static void gen_addr_temp(FILE *f) fprintf(f, "# Entry format is:\n"); fprintf(f, "# address device port pkey\n"); fprintf(f, "#\n"); + fprintf(f, "# NOTE: IP addresses are now automatically read and monitored on the system.\n"); + fprintf(f, "# They are therefore no longer required nor supported in this file\n"); + fprintf(f, "#\n"); fprintf(f, "# The address may be one of the following:\n"); fprintf(f, "# host_name - ascii character string, up to 31 characters\n"); - fprintf(f, "# address - IPv4 or IPv6 formatted address\n"); fprintf(f, "#\n"); fprintf(f, "# device name - struct ibv_device name\n"); fprintf(f, "# port number - valid port number on device (numbering starts at 1)\n"); @@ -331,8 +333,6 @@ static void gen_addr_temp(FILE *f) fprintf(f, "# node31 ibv_device0 1 default\n"); fprintf(f, "# node31-1 ibv_device0 1 0x00FF\n"); fprintf(f, "# node31-2 ibv_device0 2 0x00FF\n"); - fprintf(f, "# 192.168.0.1 ibv_device0 1 0xFFFF\n"); - fprintf(f, "# 192.168.0.2 ibv_device0 2 default\n"); } static int open_verbs(void) @@ -449,12 +449,6 @@ static int gen_addr(void) goto out2; } - ret = gen_addr_ip(f); - if (ret) { - printf("Failed to auto generate IP addresses in config file\n"); - goto out2; - } - out2: close_verbs(); out1: