linux/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h
<<
>>
Prefs
   1/*
   2 *   This file is part of Portals, http://www.sf.net/projects/lustre/
   3 *
   4 *   Portals is free software; you can redistribute it and/or
   5 *   modify it under the terms of version 2 of the GNU General Public
   6 *   License as published by the Free Software Foundation.
   7 *
   8 *   Portals is distributed in the hope that it will be useful,
   9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11 *   GNU General Public License for more details.
  12 *
  13 * header for lnet ioctl
  14 */
  15#ifndef _LNETCTL_H_
  16#define _LNETCTL_H_
  17
  18#include <uapi/linux/lnet/lnet-types.h>
  19
  20/** \addtogroup lnet_fault_simulation
  21 * @{
  22 */
  23
  24enum {
  25        LNET_CTL_DROP_ADD,
  26        LNET_CTL_DROP_DEL,
  27        LNET_CTL_DROP_RESET,
  28        LNET_CTL_DROP_LIST,
  29        LNET_CTL_DELAY_ADD,
  30        LNET_CTL_DELAY_DEL,
  31        LNET_CTL_DELAY_RESET,
  32        LNET_CTL_DELAY_LIST,
  33};
  34
  35#define LNET_ACK_BIT            (1 << 0)
  36#define LNET_PUT_BIT            (1 << 1)
  37#define LNET_GET_BIT            (1 << 2)
  38#define LNET_REPLY_BIT          (1 << 3)
  39
  40/** ioctl parameter for LNet fault simulation */
  41struct lnet_fault_attr {
  42        /**
  43         * source NID of drop rule
  44         * LNET_NID_ANY is wildcard for all sources
  45         * 255.255.255.255@net is wildcard for all addresses from @net
  46         */
  47        lnet_nid_t                      fa_src;
  48        /** destination NID of drop rule, see \a dr_src for details */
  49        lnet_nid_t                      fa_dst;
  50        /**
  51         * Portal mask to drop, -1 means all portals, for example:
  52         * fa_ptl_mask = (1 << _LDLM_CB_REQUEST_PORTAL ) |
  53         *               (1 << LDLM_CANCEL_REQUEST_PORTAL)
  54         *
  55         * If it is non-zero then only PUT and GET will be filtered, otherwise
  56         * there is no portal filter, all matched messages will be checked.
  57         */
  58        __u64                           fa_ptl_mask;
  59        /**
  60         * message types to drop, for example:
  61         * dra_type = LNET_DROP_ACK_BIT | LNET_DROP_PUT_BIT
  62         *
  63         * If it is non-zero then only specified message types are filtered,
  64         * otherwise all message types will be checked.
  65         */
  66        __u32                           fa_msg_mask;
  67        union {
  68                /** message drop simulation */
  69                struct {
  70                        /** drop rate of this rule */
  71                        __u32                   da_rate;
  72                        /**
  73                         * time interval of message drop, it is exclusive
  74                         * with da_rate
  75                         */
  76                        __u32                   da_interval;
  77                } drop;
  78                /** message latency simulation */
  79                struct {
  80                        __u32                   la_rate;
  81                        /**
  82                         * time interval of message delay, it is exclusive
  83                         * with la_rate
  84                         */
  85                        __u32                   la_interval;
  86                        /** latency to delay */
  87                        __u32                   la_latency;
  88                } delay;
  89                __u64                   space[8];
  90        } u;
  91};
  92
  93/** fault simluation stats */
  94struct lnet_fault_stat {
  95        /** total # matched messages */
  96        __u64                           fs_count;
  97        /** # dropped LNET_MSG_PUT by this rule */
  98        __u64                           fs_put;
  99        /** # dropped LNET_MSG_ACK by this rule */
 100        __u64                           fs_ack;
 101        /** # dropped LNET_MSG_GET by this rule */
 102        __u64                           fs_get;
 103        /** # dropped LNET_MSG_REPLY by this rule */
 104        __u64                           fs_reply;
 105        union {
 106                struct {
 107                        /** total # dropped messages */
 108                        __u64                   ds_dropped;
 109                } drop;
 110                struct {
 111                        /** total # delayed messages */
 112                        __u64                   ls_delayed;
 113                } delay;
 114                __u64                   space[8];
 115        } u;
 116};
 117
 118/** @} lnet_fault_simulation */
 119
 120#define LNET_DEV_ID 0
 121#define LNET_DEV_PATH "/dev/lnet"
 122#define LNET_DEV_MAJOR 10
 123#define LNET_DEV_MINOR 240
 124#define OBD_DEV_ID 1
 125#define OBD_DEV_NAME "obd"
 126#define OBD_DEV_PATH "/dev/" OBD_DEV_NAME
 127#define OBD_DEV_MAJOR 10
 128#define OBD_DEV_MINOR 241
 129#define SMFS_DEV_ID  2
 130#define SMFS_DEV_PATH "/dev/snapdev"
 131#define SMFS_DEV_MAJOR 10
 132#define SMFS_DEV_MINOR 242
 133
 134#endif
 135