From: Chris Horn Date: Fri, 19 Aug 2022 16:48:01 +0000 (-0600) Subject: LU-16213 kfilnd: Fail sends of particular message type X-Git-Tag: 2.15.54~83 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=35747c871df1c2e97d415cb7c3601e045a58c8e6;p=fs%2Flustre-release.git LU-16213 kfilnd: Fail sends of particular message type Add ability to use failure injection to specify a message type for simulated failure. For example, to simulate failure of all immediate messages: lctl set_param fail_loc=0xF114 fail_val=1 To simulate failure of a single hello request: lctl set_param fail_loc=0x8000F114 fail_val=4 HPE-bug-id: LUS-11128 Test-Parameters: trivial Signed-off-by: Chris Horn Change-Id: I4a20e92826df75812ef5b81979944526e4b94d83 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48782 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Ian Ziemba Reviewed-by: Oleg Drokin Reviewed-by: Ron Gredvig --- diff --git a/lnet/klnds/kfilnd/kfilnd.h b/lnet/klnds/kfilnd/kfilnd.h index 4f0fb9c..64b126e 100644 --- a/lnet/klnds/kfilnd/kfilnd.h +++ b/lnet/klnds/kfilnd/kfilnd.h @@ -99,6 +99,7 @@ #define CFS_KFI_FAIL_RECV_EAGAIN 0xF111 #define CFS_KFI_FAIL_RECV 0xF112 #define CFS_KFI_FAIL_MSG_UNPACK 0xF113 +#define CFS_KFI_FAIL_MSG_TYPE 0xF114 /* Maximum number of transaction keys supported. */ #define KFILND_EP_KEY_BITS 16U diff --git a/lnet/klnds/kfilnd/kfilnd_ep.c b/lnet/klnds/kfilnd/kfilnd_ep.c index dec95f2..ff743ee 100644 --- a/lnet/klnds/kfilnd/kfilnd_ep.c +++ b/lnet/klnds/kfilnd/kfilnd_ep.c @@ -398,7 +398,9 @@ int kfilnd_ep_post_send(struct kfilnd_ep *ep, struct kfilnd_transaction *tn) return -EINVAL; /* Progress transaction to failure if send should fail. */ - if (CFS_FAIL_CHECK(CFS_KFI_FAIL_SEND_EVENT)) { + if (CFS_FAIL_CHECK_VALUE(CFS_KFI_FAIL_MSG_TYPE, + tn->tn_tx_msg.msg->type) || + CFS_FAIL_CHECK(CFS_KFI_FAIL_SEND_EVENT)) { rc = kfilnd_ep_gen_fake_err(ep, &fake_error); if (!rc) return 0;