LU-5435 lnet: LNet drop rule implementation

This is implementation of LNet Drop Rule, which can randomly drop
LNet messages at specified rate.

LNet Drop Rule can only be applied to receive side of message. User
can add drop_rule either on end point of cluster (client/server) or
on LNet routers.

Here are lctl command to control LNet Drop Rules:
- net_drop_add -s SRC_NID -d DEST_NID --rate VALUE
  drop 1/@VALUE of messages from @SRC_NID to @DEST_NID

- net_drop_del -s SRC_NID -d DEST_NID
  remove all drop rules from @SRC_NID to @DEST_NID

- net_drop_list
  list all drop rules on current node

Examples:
- lctl net_drop_add -s *@o2ib0 -d 192.168.1.102@tcp 1000
  add new drop rule, it will drop 1/1000 messages from network o2ib0
  to 192.168.1.102@tcp

- lctl net_drop_add -s 10.8.6.123@o2ib1 -d * 500
  add new drop rule, it will drop 1/500 messages from 10.8.6.123@o2ib1
  to all nodes

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: Ib4cc384a8a191e88bd5f293cf1a5d7f524970d01
Reviewed-on: http://review.whamcloud.com/11314
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4665 utils: lfs setstripe to specify OSTs

Extend lfs setstripe command to support specifying individual
OSTs. [--ost|-o] option is invented for this purpose. Support
specifying OSTs for regular files only. Directory support will
be implemented later in a separate project.

OSTs can be spcified by lfs setstripe [--ost|-o] as follows:
  lfs setstripe [[--ost-list|-o] <ost_1>,<ost_i>-<ost_j>,<ost_n>]

For example, -o 1,2,4-6,8 will be expanded as OSTs:
  1,2,4,5,6,8

In addition, duplicate indices will be eliminated automatically.

Calculate the max easize by ld_active_tgt_count instead of
ld_tgt_count. However this may introduce problems when the OSTs
are in recovery because non sufficient buffer may be allocated
to store EA.

This patch adds the following test cases into conf-sanity.sh:
test 81: sparse OST indexing
test 82a: specify OSTs for file (succeed) or directory (fail)
test 82b: specify OSTs for file with --pool and --ost-list options

Signed-off-by: Jian Yu <jian.yu@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I055ea492e909d1073e08d46e00cfb5389e958ad2
Reviewed-on: http://review.whamcloud.com/9383
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5435 lnet: lustre network latency simulation

Incoming lnet message can be delayed for seconds if it can match
any of LNet Delay Rules.

User can add/remove/list Delay Rule by lctl commands:
- lctl net_delay_add
  Add a new Delay Rule to LNet, options
  <-s | --source SRC_NID>
  <-d | --dest DST_NID>
  <<-r | --rate RATE_NUMBER>
   <-i | --interlval SECONDS>>
  <-l | --latency DELAY_LATENCY>

- lctl net_delay_del
  Remove matched Delay Rule from LNet, options:
  <[-a | --all] |
   <-s | --source SRC_NID>
   <-d | --dest DST_NID>>

- lctl net_delay_list
  List all Delay Rules in LNet

- lctl net_delay_reset
  Reset statistic counters for all Delay Rules

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: Iba1234908918ad1619ae85aa2f0ad77a992374aa
Reviewed-on: http://review.whamcloud.com/11409
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>