From patchwork Mon Sep 24 23:55:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Hefty X-Patchwork-Id: 186620 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1CC4B2C008D for ; Tue, 25 Sep 2012 09:56:15 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110Ab2IXX4A (ORCPT ); Mon, 24 Sep 2012 19:56:00 -0400 Received: from mga14.intel.com ([143.182.124.37]:25822 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040Ab2IXXz5 convert rfc822-to-8bit (ORCPT ); Mon, 24 Sep 2012 19:55:57 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 24 Sep 2012 16:55:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,478,1344236400"; d="scan'208";a="148616561" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by AZSMGA002.ch.intel.com with ESMTP; 24 Sep 2012 16:55:53 -0700 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.152]) by ORSMSX106.amr.corp.intel.com ([169.254.5.60]) with mapi id 14.01.0355.002; Mon, 24 Sep 2012 16:55:34 -0700 From: "Hefty, Sean" To: "linux-rdma (linux-rdma@vger.kernel.org)" , "netdev@vger.kernel.org" Subject: [PATCH 17/26 v3] ib/sa: Export function to pack a path record into wire format Thread-Topic: [PATCH 17/26 v3] ib/sa: Export function to pack a path record into wire format Thread-Index: Ac2ajpvmdgv6MTxfQSa65To4wJMwzw== Date: Mon, 24 Sep 2012 23:55:34 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A8237346A8F122@ORSMSX101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Allow converting from struct ib_sa_path_rec to the IB defined SA path record wire format. This will be used to report path data from the rdma cm into user space. Signed-off-by: Sean Hefty --- resending with netdev copied drivers/infiniband/core/sa_query.c | 6 ++++++ include/rdma/ib_sa.h | 6 ++++++ 2 files changed, 12 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index fbbfa24..027c797 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -616,6 +616,12 @@ void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec) } EXPORT_SYMBOL(ib_sa_unpack_path); +void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute) +{ + ib_pack(path_rec_table, ARRAY_SIZE(path_rec_table), rec, attribute); +} +EXPORT_SYMBOL(ib_sa_pack_path); + static void ib_sa_path_rec_callback(struct ib_sa_query *sa_query, int status, struct ib_sa_mad *mad) diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index d44a563..ade03ca 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h @@ -385,4 +385,10 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num, */ void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec); +/** + * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec + * to IB MAD wire format. + */ +void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute); + #endif /* IB_SA_H */