diff options
author | Liang Zhen <liang.zhen@intel.com> | 2016-03-07 18:10:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-07 16:17:45 -0800 |
commit | b7acfc959b72cbb429859ec4912b48f00eacf2c3 (patch) | |
tree | 158bb4722fa734dc69930bcddb8db831973b3daa /drivers/staging/lustre/include | |
parent | 0fbbced21a94e038e4edb9069fa7a6d98c7ec64a (diff) | |
download | op-kernel-dev-b7acfc959b72cbb429859ec4912b48f00eacf2c3.zip op-kernel-dev-b7acfc959b72cbb429859ec4912b48f00eacf2c3.tar.gz |
staging: lustre: LNet 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>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11409
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/include')
-rw-r--r-- | drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 17 | ||||
-rw-r--r-- | drivers/staging/lustre/include/linux/lnet/lib-types.h | 3 | ||||
-rw-r--r-- | drivers/staging/lustre/include/linux/lnet/lnetctl.h | 21 |
3 files changed, 39 insertions, 2 deletions
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 7b3f858..dfc0208 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -559,13 +559,22 @@ void lnet_portals_destroy(void); /* message functions */ int lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t fromnid, void *private, int rdma_req); +int lnet_parse_local(lnet_ni_t *ni, lnet_msg_t *msg); +int lnet_parse_forward_locked(lnet_ni_t *ni, lnet_msg_t *msg); + void lnet_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed, unsigned int offset, unsigned int mlen, unsigned int rlen); +void lnet_ni_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, + int delayed, unsigned int offset, + unsigned int mlen, unsigned int rlen); + lnet_msg_t *lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *get_msg); void lnet_set_reply_msg_len(lnet_ni_t *ni, lnet_msg_t *msg, unsigned int len); void lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int rc); +void lnet_drop_message(lnet_ni_t *ni, int cpt, void *private, + unsigned int nob); void lnet_drop_delayed_msg_list(struct list_head *head, char *reason); void lnet_recv_delayed_msg_list(struct list_head *head); @@ -586,6 +595,14 @@ void lnet_fault_fini(void); bool lnet_drop_rule_match(lnet_hdr_t *hdr); +int lnet_delay_rule_add(struct lnet_fault_attr *attr); +int lnet_delay_rule_del(lnet_nid_t src, lnet_nid_t dst, bool shutdown); +int lnet_delay_rule_list(int pos, struct lnet_fault_attr *attr, + struct lnet_fault_stat *stat); +void lnet_delay_rule_reset(void); +void lnet_delay_rule_check(void); +bool lnet_delay_rule_match_locked(lnet_hdr_t *hdr, struct lnet_msg *msg); + /** @} lnet_fault_simulation */ void lnet_counters_get(lnet_counters_t *counters); diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index cb09a8a..29c72f8 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -88,6 +88,7 @@ typedef struct lnet_msg { unsigned int msg_rtrcredit:1; /* taken a global router credit */ unsigned int msg_peerrtrcredit:1; /* taken a peer router credit */ unsigned int msg_onactivelist:1; /* on the activelist */ + unsigned int msg_rdma_get:1; struct lnet_peer *msg_txpeer; /* peer I'm sending to */ struct lnet_peer *msg_rxpeer; /* peer I received from */ @@ -574,6 +575,7 @@ typedef struct { /* failure simulation */ struct list_head ln_test_peers; struct list_head ln_drop_rules; + struct list_head ln_delay_rules; struct list_head ln_nis; /* LND instances */ /* NIs bond on specific CPT(s) */ @@ -610,6 +612,7 @@ typedef struct { struct mutex ln_api_mutex; struct mutex ln_lnd_mutex; + struct mutex ln_delay_mutex; /* Have I called LNetNIInit myself? */ int ln_niinit_self; /* LNetNIInit/LNetNIFini counter */ diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/linux/lnet/lnetctl.h index ec33bf8..3957507 100644 --- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/linux/lnet/lnetctl.h @@ -26,6 +26,10 @@ enum { LNET_CTL_DROP_DEL, LNET_CTL_DROP_RESET, LNET_CTL_DROP_LIST, + LNET_CTL_DELAY_ADD, + LNET_CTL_DELAY_DEL, + LNET_CTL_DELAY_RESET, + LNET_CTL_DELAY_LIST, }; #define LNET_ACK_BIT BIT(0) @@ -71,7 +75,17 @@ struct lnet_fault_attr { */ __u32 da_interval; } drop; - /** TODO: add more */ + /** message latency simulation */ + struct { + __u32 la_rate; + /** + * time interval of message delay, it is exclusive + * with la_rate + */ + __u32 la_interval; + /** latency to delay */ + __u32 la_latency; + } delay; __u64 space[8]; } u; }; @@ -93,7 +107,10 @@ struct lnet_fault_stat { /** total # dropped messages */ __u64 ds_dropped; } drop; - /** TODO: add more */ + struct { + /** total # delayed messages */ + __u64 ls_delayed; + } delay; __u64 space[8]; } u; }; |