From patchwork Thu Feb 21 19:01:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2172751 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A3213DFB7B for ; Thu, 21 Feb 2013 19:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755826Ab3BUTB6 (ORCPT ); Thu, 21 Feb 2013 14:01:58 -0500 Received: from mail-bk0-f42.google.com ([209.85.214.42]:43641 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755783Ab3BUTB4 (ORCPT ); Thu, 21 Feb 2013 14:01:56 -0500 Received: by mail-bk0-f42.google.com with SMTP id jk7so4291085bkc.29 for ; Thu, 21 Feb 2013 11:01:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:content-transfer-encoding:x-gm-message-state; bh=E5PUDj/vMuPVYP+uaw1TjXMFLInhmPne1GWbVxvbFcs=; b=HnjrgPhPaelnZ356oMK6zwur5M62hh78ignCJ/2w87YZDT26/TbLCkqB5C+BNZTq49 gzDKz9HkH0fqu2UjGq5w8HeRKk7GoTQr81y0GctNPwUvrUFwDzRy4CXTyUDvqF/X+uTo HTikzHRlGCCaeZOsULnc9guyl3gqzQ0PxMI+Tj6C48C7kHyVBPSU/rwfp2OGgfI8dNwG cx8LGlG3khQ7jl9LGGKlpTX1wF0qpVy09MNpV/v11Y3N5LGJAt6hGoFI5ZPFzF7ksCei lZH3jstsodA4aVEIicKVgVDF910GApNDq/CyneWRpk428zFeEfyjPc3xRuN/JDbyjjnk g9Mw== X-Received: by 10.204.155.73 with SMTP id r9mr11310776bkw.51.1361473314306; Thu, 21 Feb 2013 11:01:54 -0800 (PST) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPS id io13sm5045560bkc.15.2013.02.21.11.01.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Feb 2013 11:01:53 -0800 (PST) Message-ID: <51266F1F.608@dev.mellanox.co.il> Date: Thu, 21 Feb 2013 14:01:51 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Ilya Nelkenbaum Subject: [PATCH] libibumad/umad.c: In resolve_ca_port, skip ethernet link layer ports X-Gm-Message-State: ALoCoQkJQ4QWzKat30hopOHKUuNkYHrn/HesX6RpyqNNBZhgVnjEdjFazu0HrlL4vVyOrbl+QbC+ Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Ilya Nelkenbaum --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/umad.c b/src/umad.c index 8f817d2..8ab5e80 100644 --- a/src/umad.c +++ b/src/umad.c @@ -256,6 +256,11 @@ static int resolve_ca_port(char *ca_name, int *port) ret = -1; goto Exit; } + if (strcmp(ca.ports[*port]->link_layer, "InfiniBand") && + strcmp(ca.ports[*port]->link_layer, "IB")) { + ret = -1; + goto Exit; + } if (ca.ports[*port]->state == 4) { ret = 1; goto Exit; @@ -270,6 +275,9 @@ static int resolve_ca_port(char *ca_name, int *port) DEBUG("checking port %d", i); if (!ca.ports[i]) continue; + if (strcmp(ca.ports[i]->link_layer, "InfiniBand") && + strcmp(ca.ports[i]->link_layer, "IB")) + continue; if (up < 0 && ca.ports[i]->phys_state == 5) up = *port = i; if (ca.ports[i]->state == 4) {