From patchwork Fri Oct 28 18:00:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nikolova, Tatyana E" X-Patchwork-Id: 9402545 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 6C457601C0 for ; Fri, 28 Oct 2016 18:00:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64E442A8B2 for ; Fri, 28 Oct 2016 18:00:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59AD72A8B8; Fri, 28 Oct 2016 18:00:18 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 1F7252A8B9 for ; Fri, 28 Oct 2016 18:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964795AbcJ1SAP convert rfc822-to-8bit (ORCPT ); Fri, 28 Oct 2016 14:00:15 -0400 Received: from mga11.intel.com ([192.55.52.93]:46197 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941855AbcJ1SAO (ORCPT ); Fri, 28 Oct 2016 14:00:14 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 28 Oct 2016 11:00:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,411,1473145200"; d="scan'208";a="895183461" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 28 Oct 2016 11:00:13 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 28 Oct 2016 11:00:13 -0700 Received: from fmsmsx104.amr.corp.intel.com ([169.254.3.71]) by FMSMSX153.amr.corp.intel.com ([169.254.9.16]) with mapi id 14.03.0248.002; Fri, 28 Oct 2016 11:00:12 -0700 From: "Nikolova, Tatyana E" To: Jason Gunthorpe , Doug Ledford , "linux-rdma@vger.kernel.org" CC: Steve Wise Subject: RE: [PATCH rdma-core 2/4] Move rdma_netlink compat into CMake Thread-Topic: [PATCH rdma-core 2/4] Move rdma_netlink compat into CMake Thread-Index: AQHSMKbKvIi/bWsRjEOWycQKnPbmfaC+Jq5w Date: Fri, 28 Oct 2016 18:00:12 +0000 Message-ID: <13AA599688F47243B14FCFCCC2C803BB10AA2DB4@fmsmsx104.amr.corp.intel.com> References: <1477609570-8087-1-git-send-email-jgunthorpe@obsidianresearch.com> <1477609570-8087-3-git-send-email-jgunthorpe@obsidianresearch.com> In-Reply-To: <1477609570-8087-3-git-send-email-jgunthorpe@obsidianresearch.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjQzYjUwMGQtYTQwNC00MjU2LWI5YjktYzRiNDg4M2E0YjBkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IndhanRCZFgwaytcL0IxdzV4bVRZTWpQZHVnQmhHalYzUk11eWpmYlBydURzPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 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 Hi Jason, The patch looks good. I don't think that RDMA_NL_I40IW enum bellow is necessary. +enum { + RDMA_NL_RDMA_CM = 1, + RDMA_NL_IWCM, + RDMA_NL_RSVD, + RDMA_NL_LS, /* RDMA Local Services */ + RDMA_NL_I40IW, + RDMA_NL_NUM_CLIENTS +}; Thank you, Tatyana -----Original Message----- From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-owner@vger.kernel.org] On Behalf Of Jason Gunthorpe Sent: Thursday, October 27, 2016 6:06 PM To: Doug Ledford ; linux-rdma@vger.kernel.org Cc: Steve Wise Subject: [PATCH rdma-core 2/4] Move rdma_netlink compat into CMake Detect if the distro's rdma_netlink.h is new enough, if not replace it with the built in copy, and eliminate the two loose copies of the header. The built in copy is from v4.8 Signed-off-by: Jason Gunthorpe --- buildlib/RDMA_LinuxHeaders.cmake | 2 +- buildlib/fixup-include/rdma-rdma_netlink.h | 225 +++++++++++++++++++++++++++++ ibacm/src/acm.c | 3 - ibacm/src/acm_netlink.h | 128 ---------------- iwpmd/iwarp_pm.h | 2 +- iwpmd/iwarp_pm_common.c | 5 - iwpmd/iwarp_pm_server.c | 4 +- iwpmd/iwpm_netlink.h | 214 --------------------------- 8 files changed, 229 insertions(+), 354 deletions(-) create mode 100644 buildlib/fixup-include/rdma-rdma_netlink.h delete mode 100644 ibacm/src/acm_netlink.h delete mode 100644 iwpmd/iwpm_netlink.h Steve, Can you check if the changes to iwpmd/iwarp_pm_server.c make sense? Should we do something to fix the kernel header? -- 2.1.4 -- 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 -- 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/buildlib/RDMA_LinuxHeaders.cmake b/buildlib/RDMA_LinuxHeaders.cmake index bd16d8deca72..c67b0a6113d2 100644 --- a/buildlib/RDMA_LinuxHeaders.cmake +++ b/buildlib/RDMA_LinuxHeaders.cmake @@ -80,6 +80,6 @@ rdma_check_kheader("rdma/ib_user_verbs.h" "${DEFAULT_TEST}") rdma_check_kheader("rdma/ib_user_sa.h" "${DEFAULT_TEST}") rdma_check_kheader("rdma/ib_user_cm.h" "${DEFAULT_TEST}") rdma_check_kheader("rdma/ib_user_mad.h" "${DEFAULT_TEST}") -rdma_check_kheader("rdma/rdma_netlink.h" "${DEFAULT_TEST}") +rdma_check_kheader("rdma/rdma_netlink.h" "int main(int argc,const char +*argv[]) { return RDMA_NL_IWPM_REMOTE_INFO && RDMA_NL_IWCM; }") rdma_check_kheader("rdma/rdma_user_cm.h" "${DEFAULT_TEST}") rdma_check_kheader("rdma/rdma_user_rxe.h" "${DEFAULT_TEST}") diff --git a/buildlib/fixup-include/rdma-rdma_netlink.h b/buildlib/fixup-include/rdma-rdma_netlink.h new file mode 100644 index 000000000000..02fe8390c18f --- /dev/null +++ b/buildlib/fixup-include/rdma-rdma_netlink.h @@ -0,0 +1,225 @@ +#ifndef _UAPI_RDMA_NETLINK_H +#define _UAPI_RDMA_NETLINK_H + +#include + +enum { + RDMA_NL_RDMA_CM = 1, + RDMA_NL_IWCM, + RDMA_NL_RSVD, + RDMA_NL_LS, /* RDMA Local Services */ + RDMA_NL_I40IW, + RDMA_NL_NUM_CLIENTS +}; + +enum { + RDMA_NL_GROUP_CM = 1, + RDMA_NL_GROUP_IWPM, + RDMA_NL_GROUP_LS, + RDMA_NL_NUM_GROUPS +}; + +#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> +10) #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) #define +RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) + +enum { + RDMA_NL_RDMA_CM_ID_STATS = 0, + RDMA_NL_RDMA_CM_NUM_OPS +}; + +enum { + RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1, + RDMA_NL_RDMA_CM_ATTR_DST_ADDR, + RDMA_NL_RDMA_CM_NUM_ATTR, +}; + +/* iwarp port mapper op-codes */ +enum { + RDMA_NL_IWPM_REG_PID = 0, + RDMA_NL_IWPM_ADD_MAPPING, + RDMA_NL_IWPM_QUERY_MAPPING, + RDMA_NL_IWPM_REMOVE_MAPPING, + RDMA_NL_IWPM_REMOTE_INFO, + RDMA_NL_IWPM_HANDLE_ERR, + RDMA_NL_IWPM_MAPINFO, + RDMA_NL_IWPM_MAPINFO_NUM, + RDMA_NL_IWPM_NUM_OPS +}; + +struct rdma_cm_id_stats { + __u32 qp_num; + __u32 bound_dev_if; + __u32 port_space; + __s32 pid; + __u8 cm_state; + __u8 node_type; + __u8 port_num; + __u8 qp_type; +}; + +enum { + IWPM_NLA_REG_PID_UNSPEC = 0, + IWPM_NLA_REG_PID_SEQ, + IWPM_NLA_REG_IF_NAME, + IWPM_NLA_REG_IBDEV_NAME, + IWPM_NLA_REG_ULIB_NAME, + IWPM_NLA_REG_PID_MAX +}; + +enum { + IWPM_NLA_RREG_PID_UNSPEC = 0, + IWPM_NLA_RREG_PID_SEQ, + IWPM_NLA_RREG_IBDEV_NAME, + IWPM_NLA_RREG_ULIB_NAME, + IWPM_NLA_RREG_ULIB_VER, + IWPM_NLA_RREG_PID_ERR, + IWPM_NLA_RREG_PID_MAX + +}; + +enum { + IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0, + IWPM_NLA_MANAGE_MAPPING_SEQ, + IWPM_NLA_MANAGE_ADDR, + IWPM_NLA_MANAGE_MAPPED_LOC_ADDR, + IWPM_NLA_RMANAGE_MAPPING_ERR, + IWPM_NLA_RMANAGE_MAPPING_MAX +}; + +#define IWPM_NLA_MANAGE_MAPPING_MAX 3 +#define IWPM_NLA_QUERY_MAPPING_MAX 4 +#define IWPM_NLA_MAPINFO_SEND_MAX 3 + +enum { + IWPM_NLA_QUERY_MAPPING_UNSPEC = 0, + IWPM_NLA_QUERY_MAPPING_SEQ, + IWPM_NLA_QUERY_LOCAL_ADDR, + IWPM_NLA_QUERY_REMOTE_ADDR, + IWPM_NLA_RQUERY_MAPPED_LOC_ADDR, + IWPM_NLA_RQUERY_MAPPED_REM_ADDR, + IWPM_NLA_RQUERY_MAPPING_ERR, + IWPM_NLA_RQUERY_MAPPING_MAX +}; + +enum { + IWPM_NLA_MAPINFO_REQ_UNSPEC = 0, + IWPM_NLA_MAPINFO_ULIB_NAME, + IWPM_NLA_MAPINFO_ULIB_VER, + IWPM_NLA_MAPINFO_REQ_MAX +}; + +enum { + IWPM_NLA_MAPINFO_UNSPEC = 0, + IWPM_NLA_MAPINFO_LOCAL_ADDR, + IWPM_NLA_MAPINFO_MAPPED_ADDR, + IWPM_NLA_MAPINFO_MAX +}; + +enum { + IWPM_NLA_MAPINFO_NUM_UNSPEC = 0, + IWPM_NLA_MAPINFO_SEQ, + IWPM_NLA_MAPINFO_SEND_NUM, + IWPM_NLA_MAPINFO_ACK_NUM, + IWPM_NLA_MAPINFO_NUM_MAX +}; + +enum { + IWPM_NLA_ERR_UNSPEC = 0, + IWPM_NLA_ERR_SEQ, + IWPM_NLA_ERR_CODE, + IWPM_NLA_ERR_MAX +}; + +/* + * Local service operations: + * RESOLVE - The client requests the local service to resolve a path. + * SET_TIMEOUT - The local service requests the client to set the timeout. + * IP_RESOLVE - The client requests the local service to resolve an IP to GID. + */ +enum { + RDMA_NL_LS_OP_RESOLVE = 0, + RDMA_NL_LS_OP_SET_TIMEOUT, + RDMA_NL_LS_OP_IP_RESOLVE, + RDMA_NL_LS_NUM_OPS +}; + +/* Local service netlink message flags */ +#define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */ + +/* + * Local service resolve operation family header. + * The layout for the resolve operation: + * nlmsg header + * family header + * attributes + */ + +/* + * Local service path use: + * Specify how the path(s) will be used. + * ALL - For connected CM operation (6 pathrecords) + * UNIDIRECTIONAL - For unidirectional UD (1 pathrecord) + * GMP - For miscellaneous GMP like operation (at least 1 reversible + * pathrecord) + */ +enum { + LS_RESOLVE_PATH_USE_ALL = 0, + LS_RESOLVE_PATH_USE_UNIDIRECTIONAL, + LS_RESOLVE_PATH_USE_GMP, + LS_RESOLVE_PATH_USE_MAX +}; + +#define LS_DEVICE_NAME_MAX 64 + +struct rdma_ls_resolve_header { + __u8 device_name[LS_DEVICE_NAME_MAX]; + __u8 port_num; + __u8 path_use; +}; + +struct rdma_ls_ip_resolve_header { + __u32 ifindex; +}; + +/* Local service attribute type */ +#define RDMA_NLA_F_MANDATORY (1 << 13) +#define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \ + RDMA_NLA_F_MANDATORY)) + +/* + * Local service attributes: + * Attr Name Size Byte order + * ----------------------------------------------------- + * PATH_RECORD struct ib_path_rec_data + * TIMEOUT u32 cpu + * SERVICE_ID u64 cpu + * DGID u8[16] BE + * SGID u8[16] BE + * TCLASS u8 + * PKEY u16 cpu + * QOS_CLASS u16 cpu + * IPV4 u32 BE + * IPV6 u8[16] BE + */ +enum { + LS_NLA_TYPE_UNSPEC = 0, + LS_NLA_TYPE_PATH_RECORD, + LS_NLA_TYPE_TIMEOUT, + LS_NLA_TYPE_SERVICE_ID, + LS_NLA_TYPE_DGID, + LS_NLA_TYPE_SGID, + LS_NLA_TYPE_TCLASS, + LS_NLA_TYPE_PKEY, + LS_NLA_TYPE_QOS_CLASS, + LS_NLA_TYPE_IPV4, + LS_NLA_TYPE_IPV6, + LS_NLA_TYPE_MAX +}; + +/* Local service DGID/SGID attribute: big endian */ struct +rdma_nla_ls_gid { + __u8 gid[16]; +}; + +#endif /* _UAPI_RDMA_NETLINK_H */ diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c index cc7dd065f69c..5f4068f619b4 100644 --- a/ibacm/src/acm.c +++ b/ibacm/src/acm.c @@ -61,9 +61,6 @@ #include #include "acm_mad.h" #include "acm_util.h" -#if !defined(RDMA_NL_LS_F_ERR) - #include "acm_netlink.h" -#endif #define src_out data[0] #define src_index data[1] diff --git a/ibacm/src/acm_netlink.h b/ibacm/src/acm_netlink.h deleted file mode 100644 index 867ae8c838fc..000000000000 diff --git a/iwpmd/iwarp_pm.h b/iwpmd/iwarp_pm.h index b5a5a457a423..fc09e4fd752a 100644 --- a/iwpmd/iwarp_pm.h +++ b/iwpmd/iwarp_pm.h @@ -53,7 +53,7 @@ #include #include #include -#include "iwpm_netlink.h" +#include #define IWARP_PM_PORT 3935 #define IWARP_PM_VER_SHIFT 6 diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c index 58b1089a1998..941e0406ade7 100644 --- a/iwpmd/iwarp_pm_common.c +++ b/iwpmd/iwarp_pm_common.c @@ -33,11 +33,6 @@ #include "iwarp_pm.h" -/* Necessary only for SLES11 */ -#if !defined (NETLINK_RDMA) - #define NETLINK_RDMA 20 -#endif - /* iwpm config params */ static const char * iwpm_param_names[IWPM_PARAM_NUM] = { "nl_sock_rbuf_size" }; diff --git a/iwpmd/iwarp_pm_server.c b/iwpmd/iwarp_pm_server.c index ab90c6c4b077..ef541c8175ed 100644 --- a/iwpmd/iwarp_pm_server.c +++ b/iwpmd/iwarp_pm_server.c @@ -1214,8 +1214,8 @@ static int init_iwpm_clients(__u32 iwarp_clients[]) { int client_num = 2; - iwarp_clients[0] = RDMA_NL_NES; - iwarp_clients[1] = RDMA_NL_C4IW; + iwarp_clients[0] = RDMA_NL_IWCM; + iwarp_clients[1] = RDMA_NL_IWCM+1; /* Legacy RDMA_NL_C4IW for old +kernels */ return client_num; } diff --git a/iwpmd/iwpm_netlink.h b/iwpmd/iwpm_netlink.h deleted file mode 100644 index 0edcb620de99..000000000000