Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933009AbbDXPQA (ORCPT ); Fri, 24 Apr 2015 11:16:00 -0400 Received: from mail-am1on0089.outbound.protection.outlook.com ([157.56.112.89]:9355 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932475AbbDXPP5 convert rfc822-to-8bit (ORCPT ); Fri, 24 Apr 2015 11:15:57 -0400 From: Liran Liss To: Michael Wang , Roland Dreier , Sean Hefty , Hal Rosenstock , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Steve Wise , Tom Talpey , Jason Gunthorpe , Doug Ledford , Ira Weiny , Tom Tucker , Hoang-Nam Nguyen , "raisch@de.ibm.com" , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , "Or Gerlitz" , Haggai Eran Subject: RE: [PATCH v6 02/26] IB/Verbs: Implement raw management helpers Thread-Topic: [PATCH v6 02/26] IB/Verbs: Implement raw management helpers Thread-Index: AQHQfosbDxsryTQyFECRfcsvVa3c951cRQ6g Date: Fri, 24 Apr 2015 15:15:54 +0000 Message-ID: References: <1429878230-11749-1-git-send-email-yun.wang@profitbricks.com> <1429878230-11749-3-git-send-email-yun.wang@profitbricks.com> In-Reply-To: <1429878230-11749-3-git-send-email-yun.wang@profitbricks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [85.250.13.154] authentication-results: profitbricks.com; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB4PR05MB446;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB4PR05MB398; x-microsoft-antispam-prvs: x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(51704005)(77156002)(92566002)(2950100001)(122556002)(74316001)(76576001)(2201001)(2900100001)(2656002)(33656002)(62966003)(87936001)(76176999)(102836002)(50986999)(66066001)(19580405001)(40100003)(46102003)(19580395003)(86362001)(106116001)(2501003)(54356999)(5001770100001)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB4PR05MB446;H:DB4PR05MB0863.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010)(3002001);SRVR:DB4PR05MB446;BCL:0;PCL:0;RULEID:;SRVR:DB4PR05MB446; x-forefront-prvs: 05568D1FF7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2015 15:15:54.1448 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR05MB446 X-OriginatorOrg: Mellanox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2436 Lines: 75 > From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma- > > Add raw helpers: > rdma_tech_ib > rdma_tech_iboe > rdma_tech_iwarp > rdma_ib_or_iboe (transition, clean up later) To help us detect which > technology the port supported. > Replace "rdma_tech_*" with "rdma_protocol_*". > Cc: Hal Rosenstock > Cc: Steve Wise > Cc: Tom Talpey > Cc: Jason Gunthorpe > Cc: Doug Ledford > Cc: Ira Weiny > Cc: Sean Hefty > Signed-off-by: Michael Wang > --- > include/rdma/ib_verbs.h | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index > d54f91e..a12e876 100644 > --- a/include/rdma/ib_verbs.h > +++ b/include/rdma/ib_verbs.h > @@ -1748,6 +1748,31 @@ int ib_query_port(struct ib_device *device, enum > rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, > u8 port_num); > > +static inline int rdma_tech_ib(struct ib_device *device, u8 port_num) { > + return device->query_transport(device, port_num) > + == RDMA_TRANSPORT_IB; > +} > + > +static inline int rdma_tech_iboe(struct ib_device *device, u8 port_num) > +{ > + return device->query_transport(device, port_num) > + == RDMA_TRANSPORT_IBOE; Remove RDMA_TRANSPORT_IBOE. In the current code, the test should be: (IB transport && Ethernet link layer). We can later consider each provider declaring the transports directly. > +} > + > +static inline int rdma_tech_iwarp(struct ib_device *device, u8 > +port_num) { > + return device->query_transport(device, port_num) > + == RDMA_TRANSPORT_IWARP; > +} > + > +static inline int rdma_ib_or_iboe(struct ib_device *device, u8 > +port_num) { > + enum rdma_transport_type tp = device->query_transport(device, > +port_num); > + > + return (tp == RDMA_TRANSPORT_IB || tp == > RDMA_TRANSPORT_IBOE); } Remove RDMA_TRANSPORT_IBOE. Just test against RDMA_TRANSPORT_IB. > + > int ib_query_gid(struct ib_device *device, > u8 port_num, int index, union ib_gid *gid); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/