Whamcloud - gitweb
New tag 2.15.63
[fs/lustre-release.git] / lnet / include / uapi / linux / lnet / lnet-dlc.h
index 0ed61bd..e5b7b03 100644 (file)
@@ -1,30 +1,8 @@
-/*
- * LGPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.
- *
- * LGPL HEADER END
- *
- */
-/*
- * Copyright (c) 2014, 2017, Intel Corporation.
- */
-/*
- * Author: Amir Shehata <amir.shehata@intel.com>
- */
+// SPDX-License-Identifier: LGPL-2.0
+
+/* Copyright (c) 2014, 2017, Intel Corporation. */
+
+/* Author: Amir Shehata <amir.shehata@intel.com> */
 
 #ifndef __UAPI_LNET_DLC_H_
 #define __UAPI_LNET_DLC_H_
 #define __user
 #endif
 
+#define LNET_GENL_NAME         "lnet"
+#define LNET_GENL_VERSION      0x05
+
+/* enum lnet_commands        - Supported core LNet Netlink commands
+ *
+ * @LNET_CMD_UNSPEC:           unspecified command to catch errors
+ *
+ * @LNET_CMD_CONFIGURE:                command to setup LNet stack
+ * @LNET_CMD_NETS:             command to manage the LNet networks
+ * @LNET_CMD_ROUTES:           command to manage LNet routes
+ * @LNET_CMD_PING:             command to send pings to LNet connections
+ * @LNET_CMD_CPT_OF_NID:       command to calculate the CPT of specified NIDs
+ */
+enum lnet_commands {
+       LNET_CMD_UNSPEC         = 0,
+
+       LNET_CMD_CONFIGURE      = 1,
+       LNET_CMD_NETS           = 2,
+       LNET_CMD_PEERS          = 3,
+       LNET_CMD_ROUTES         = 4,
+       LNET_CMD_CONNS          = 5,
+       LNET_CMD_PING           = 6,
+       LNET_CMD_CPT_OF_NID     = 7,
+       LNET_CMD_PEER_DIST      = 8,
+
+       __LNET_CMD_MAX_PLUS_ONE
+};
+
+#define LNET_CMD_MAX (__LNET_CMD_MAX_PLUS_ONE - 1)
+
 /*
  * To allow for future enhancements to extend the tunables
  * add a hdr to this structure, so that the version can be set
@@ -79,11 +87,38 @@ struct lnet_ioctl_config_o2iblnd_tunables {
        __u32 lnd_fmr_cache;
        __u16 lnd_conns_per_peer;
        __u16 lnd_ntx;
+       __u32 lnd_timeout;
+       __s16 lnd_tos;
+};
+
+struct lnet_ioctl_config_kfilnd_tunables {
+       __u32 lnd_version;
+       __u32 lnd_prov_major_version;
+       __u32 lnd_prov_minor_version;
+       __u32 lnd_auth_key;
+       char lnd_traffic_class_str[LNET_MAX_STR_LEN];
+       __u32 lnd_traffic_class;
+};
+
+struct lnet_ioctl_config_socklnd_tunables {
+       __u32 lnd_version;
+       __u16 lnd_conns_per_peer;
+       __u16 lnd_pad;
+       __u32 lnd_timeout;
+       __s16 lnd_tos;
+};
+
+struct lnet_ioctl_config_gnilnd_tunables {
+       __u32 lnd_version;
+       __u32 lnd_timeout;
 };
 
 struct lnet_lnd_tunables {
        union {
                struct lnet_ioctl_config_o2iblnd_tunables lnd_o2ib;
+               struct lnet_ioctl_config_socklnd_tunables lnd_sock;
+               struct lnet_ioctl_config_kfilnd_tunables lnd_kfi;
+               struct lnet_ioctl_config_gnilnd_tunables lnd_gni;
        } lnd_tun_u;
 };
 
@@ -125,6 +160,7 @@ struct lnet_ioctl_ping_data {
        __u32 mr_info;
        struct lnet_process_id ping_id;
        struct lnet_process_id __user *ping_buf;
+       lnet_nid_t ping_src;
 };
 
 struct lnet_ioctl_config_data {
@@ -265,7 +301,9 @@ struct lnet_ioctl_peer_cfg {
        struct libcfs_ioctl_hdr prcfg_hdr;
        lnet_nid_t prcfg_prim_nid;
        lnet_nid_t prcfg_cfg_nid;
-       __u32 prcfg_count;
+       __u32 prcfg_count;      /* ADD_PEER_NI: used for 'lock_prim' option
+                                * DEL_PEER_NI: used for 'force' option
+                                */
        __u32 prcfg_mr;
        __u32 prcfg_state;
        __u32 prcfg_size;
@@ -280,6 +318,13 @@ struct lnet_ioctl_reset_health_cfg {
        lnet_nid_t rh_nid;
 };
 
+struct lnet_ioctl_reset_conns_per_peer_cfg {
+       struct libcfs_ioctl_hdr rcpp_hdr;
+       __u16 rcpp_all:1;
+       __s16 rcpp_value;
+       lnet_nid_t rcpp_nid;
+};
+
 struct lnet_ioctl_recovery_list {
        struct libcfs_ioctl_hdr rlst_hdr;
        enum lnet_health_type rlst_type:32;