From patchwork Wed Feb 13 13:31:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2136071 X-Patchwork-Delegate: ira.weiny@intel.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 00AD5DFE75 for ; Wed, 13 Feb 2013 13:31:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934023Ab3BMNbq (ORCPT ); Wed, 13 Feb 2013 08:31:46 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:40488 "EHLO mail-ee0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759115Ab3BMNbq (ORCPT ); Wed, 13 Feb 2013 08:31:46 -0500 Received: by mail-ee0-f44.google.com with SMTP id l10so637771eei.31 for ; Wed, 13 Feb 2013 05:31:44 -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=KLsG+uJaQldpfwUnLmm7zncPSxWFnIo+tPnDWkLtUIA=; b=KBz0O4dTdPNgHpAqyLZc1P3iGmUNmiHszDc07gxIiA6VhlgEqICCXOi8nGkn6tWM4b HBxJchC6YIJCl1CHbgrFx8E2aZFFUqftKqEv72qVk851Rqc4FJ3YaFIW2q86qGRydaxr n6npnJR/3C84FNoIxaDgSfkBsBwMlOQojAN/kN0KJzNpVpEGoD6OET6udt6MSBto+WE0 iiHTTOjltjrFp6aXeBPoqcFmyCO7nzR93W4EyW3c2MqkUk6vxH8nSQHne/FZU/wkQWEZ ZGj9E5p6+CWt+XkVYBkqebU9cgm4InJuZ0tWDV3pAq3/6Iq4iEF3POd2vHh1Ya7aV74W I50g== X-Received: by 10.14.201.5 with SMTP id a5mr6013531eeo.17.1360762304344; Wed, 13 Feb 2013 05:31:44 -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 h5sm73183463eem.1.2013.02.13.05.31.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Feb 2013 05:31:43 -0800 (PST) Message-ID: <511B95BD.4020309@dev.mellanox.co.il> Date: Wed, 13 Feb 2013 08:31:41 -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: Ira Weiny CC: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] infiniband-diags/saquery.c: Add support for ServiceID in PathRecord querying X-Gm-Message-State: ALoCoQnNrtG59BzRD6Ywy8gRbXiRsIF+weKyY/EVeHythi2xRZJuAtQzyrz40E/l8lYWNEag6TrW Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Hal Rosenstock --- -- 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/saquery.c b/src/saquery.c index bdf5e9a..1994cf9 100644 --- a/src/saquery.c +++ b/src/saquery.c @@ -59,7 +59,13 @@ #include "ibdiag_common.h" +#ifndef IB_PR_COMPMASK_SERVICEID +#define IB_PR_COMPMASK_SERVICEID (IB_PR_COMPMASK_SERVICEID_MSB | \ + IB_PR_COMPMASK_SERVICEID_LSB) +#endif + struct query_params { + uint64_t service_id; ib_gid_t sgid, dgid, gid, mgid; uint16_t slid, dlid, mlid; uint32_t flow_label; @@ -959,6 +965,7 @@ static int query_path_records(const struct query_cmd *q, bind_handle_t h, uint8_t reversible = 0; memset(&pr, 0, sizeof(pr)); + CHECK_AND_SET_VAL(p->service_id, 64, 0, pr.service_id, PR, SERVICEID); CHECK_AND_SET_GID(p->sgid, pr.sgid, PR, SGID); CHECK_AND_SET_GID(p->dgid, pr.dgid, PR, DGID); CHECK_AND_SET_VAL(p->slid, 16, 0, pr.slid, PR, SLID); @@ -1518,6 +1525,9 @@ static int process_opt(void *context, int ch, char *optarg) case 'X': p->proxy_join = strtoul(optarg, NULL, 0); break; + case 22: + p->service_id = strtoull(optarg, NULL, 0); + break; default: return -1; } @@ -1596,6 +1606,7 @@ int main(int argc, char **argv) {"hop_limit", 'H', 1, NULL, "Hop limit (PathRecord, MCMemberRecord)"}, {"scope", 21, 1, NULL, "Scope (MCMemberRecord)"}, + {"service_id", 22, 1, NULL, "ServiceID (PathRecord)"}, {"join_state", 'J', 1, NULL, "Join state (MCMemberRecord)"}, {"proxy_join", 'X', 1, NULL, "Proxy join (MCMemberRecord)"}, {0}