From patchwork Tue Nov 28 22:11:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 10081175 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C65EA60353 for ; Tue, 28 Nov 2017 22:11:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8E6E296A9 for ; Tue, 28 Nov 2017 22:11:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD9092970D; Tue, 28 Nov 2017 22:11:59 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 391482970C for ; Tue, 28 Nov 2017 22:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbdK1WL6 (ORCPT ); Tue, 28 Nov 2017 17:11:58 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36192 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbdK1WL5 (ORCPT ); Tue, 28 Nov 2017 17:11:57 -0500 Received: by mail-qk0-f193.google.com with SMTP id t187so1962752qkh.3 for ; Tue, 28 Nov 2017 14:11:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=5QUDVaiMz696OZZnX2vluUThLET8QmFzFvjtoPYfa7M=; b=2C4rmzTbDFoMZYIfWeexSr5QzIDgJ9u0V1DjBXpBN0zAlIYTYOeMQDCdR0HVfc4shP n/nQEyufFNcDSgHHnIOYvSIOtfEgzu6t+NrOnntcF4tVwtKm9PeG70A2f5nLY+QDXf8C 0+QGIvgRpKgDuYNIFMhWHALJ109n2WHX3JlIs2iknW571WcUe5bXMMk1t+Sm35vIEqKV Q5MI8k8+bfs6f3/j+aUBPmC9+NKgT81Nfz8XNUG9Xr0jFXFWlHfNPGoXbEFN8LDAvhUc sQJYFNNQkqOYRCZD9odxLmXfOI5xeZBKtlmr8QYIaHJrvgq2wkH0sCKVYeL8hKN+CnaS vxcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=5QUDVaiMz696OZZnX2vluUThLET8QmFzFvjtoPYfa7M=; b=lvq8xQecXfkhwasDSepzcCY5LUpHaqYbcKdM9QWFIycXLqjib0XMqZohRrfa7S0HrA wzZQsC0AdQvB2ZuwSq7RmxftuqMXMMLSJ/b0M4TtFF5GgI7/qeb5n/5FmOzy+hkFIYZg 2QQ6zI46Bb/fBYCPZ2B2YLWlhzxHjulzdBY6Z4gJU+5UtrW3P6+30pOMjjsKsAywHQhQ kSlgaauN2S0sLkRPv/WKybfe8z84ECyjaHO7NjO2Yudyl2EuQKQkHNuEvYRjjeVz0+To 4IJFzEbJhN7FoTKupQSFyiKhZmZA0bhLLgiRI9WQmS+96W+391+JaHw+CCkePUE8wTIu 39ww== X-Gm-Message-State: AJaThX6Z6oM8ThjffI17nN5CD6tZIlaNDylxKnMk55qYIbck6wlUSgB8 uEwd8iuthATEeYi6e2reYXYLoD+g X-Google-Smtp-Source: AGs4zMalbHpZlPM5UAEfg3HnU8NoAwPUMCbE0R2bCx67voXwDpXluc2qfEOahMsaqmg2jOEhXESbRQ== X-Received: by 10.233.222.135 with SMTP id s129mr1207381qkf.32.1511907117087; Tue, 28 Nov 2017 14:11:57 -0800 (PST) Received: from [192.168.1.183] (c-73-182-207-166.hsd1.ma.comcast.net. [73.182.207.166]) by smtp.googlemail.com with ESMTPSA id a195sm160848qkb.23.2017.11.28.14.11.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2017 14:11:56 -0800 (PST) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH infiniband-diags 3/6] libibmad: Add support for HDRFECMode fields in PortInfoExtended attribute Message-ID: Date: Tue, 28 Nov 2017 17:11:56 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US 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 Per MgtWG comment #9367 Signed-off-by: Hal Rosenstock --- libibmad/include/infiniband/mad.h | 7 +++++++ libibmad/src/dump.c | 12 ++++++++++-- libibmad/src/fields.c | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h index 7f6b886..da82636 100644 --- a/libibmad/include/infiniband/mad.h +++ b/libibmad/include/infiniband/mad.h @@ -1315,6 +1315,13 @@ enum MAD_FIELDS { */ IB_PC_QP1_DROP_F, + /* + * More PortInfoExtended fields + */ + IB_PORT_EXT_HDR_FEC_MODE_SUPPORTED_F, + IB_PORT_EXT_HDR_FEC_MODE_ENABLED_F, + IB_PORT_EXT_HDR_FEC_MODE_LAST_F, + IB_FIELD_LAST_ /* must be last */ }; diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c index 98d5a34..d71c529 100644 --- a/libibmad/src/dump.c +++ b/libibmad/src/dump.c @@ -1183,8 +1183,16 @@ void mad_dump_classportinfo(char *buf, int bufsz, void *val, int valsz) void mad_dump_portinfo_ext(char *buf, int bufsz, void *val, int valsz) { - _dump_fields(buf, bufsz, val, IB_PORT_EXT_FIRST_F, - IB_PORT_EXT_LAST_F); + int cnt; + + cnt = _dump_fields(buf, bufsz, val, IB_PORT_EXT_FIRST_F, + IB_PORT_EXT_LAST_F); + if (cnt < 0) + return; + + _dump_fields(buf + cnt, bufsz - cnt, val, + IB_PORT_EXT_HDR_FEC_MODE_SUPPORTED_F, + IB_PORT_EXT_HDR_FEC_MODE_LAST_F); } void xdump(FILE * file, char *msg, void *p, int size) diff --git a/libibmad/src/fields.c b/libibmad/src/fields.c index bf48689..61fd540 100644 --- a/libibmad/src/fields.c +++ b/libibmad/src/fields.c @@ -1009,6 +1009,13 @@ static const ib_field_t ib_mad_f[] = { */ {160, 16, "QP1Dropped", mad_dump_uint}, + /* + * More PortInfoExtended fields + */ + {112, 16, "HDRFECModeSupported", mad_dump_hex}, + {128, 16, "HDRFECModeEnabled", mad_dump_hex}, + {0, 0}, /* IB_PORT_EXT_HDR_FEC_MODE_LAST_F */ + {0, 0} /* IB_FIELD_LAST_ */ };