Whamcloud - gitweb
LU-16213 kfilnd: Fail sends of particular message type 82/48782/4
authorChris Horn <chris.horn@hpe.com>
Fri, 19 Aug 2022 16:48:01 +0000 (10:48 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 Jan 2023 15:30:02 +0000 (15:30 +0000)
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 <chris.horn@hpe.com>
Change-Id: I4a20e92826df75812ef5b81979944526e4b94d83
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48782
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ian Ziemba <ian.ziemba@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Ron Gredvig <ron.gredvig@hpe.com>
lnet/klnds/kfilnd/kfilnd.h
lnet/klnds/kfilnd/kfilnd_ep.c

index 4f0fb9c..64b126e 100644 (file)
@@ -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
index dec95f2..ff743ee 100644 (file)
@@ -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;