All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gioh Kim <gi-oh.kim@ionos.com>
To: linux-rdma@vger.kernel.org
Cc: bvanassche@acm.org, leon@kernel.org, dledford@redhat.com,
	jgg@ziepe.ca, haris.iqbal@ionos.com, jinpu.wang@ionos.com,
	Gioh Kim <gi-oh.kim@cloud.ionos.com>
Subject: [PATCH for-next 05/22] docs: fault-injection: Add fault-injection manual of RTRS
Date: Thu, 25 Mar 2021 16:32:51 +0100	[thread overview]
Message-ID: <20210325153308.1214057-6-gi-oh.kim@ionos.com> (raw)
In-Reply-To: <20210325153308.1214057-1-gi-oh.kim@ionos.com>

From: Gioh Kim <gi-oh.kim@cloud.ionos.com>

It describes how to use the fault-injection of RTRS.

Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
---
 .../fault-injection/rtrs-fault-injection.rst  | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 Documentation/fault-injection/rtrs-fault-injection.rst

diff --git a/Documentation/fault-injection/rtrs-fault-injection.rst b/Documentation/fault-injection/rtrs-fault-injection.rst
new file mode 100644
index 000000000000..775a223fef09
--- /dev/null
+++ b/Documentation/fault-injection/rtrs-fault-injection.rst
@@ -0,0 +1,83 @@
+RTRS (RDMA Transport) Fault Injection
+=====================================
+This document introduces how to enable and use the error injection of RTRS
+via debugfs in the /sys/kernel/debug directory. When enabled, users can
+enable specific error injection point and change the default status code
+via the debugfs.
+
+Following examples show how to inject an error into the RTRS.
+
+First, enable CONFIG_FAULT_INJECTION_DEBUG_FS kernel config,
+recompile the kernel. After booting up the kernel, map a target device.
+
+After mapping, /sys/kernel/debug/<session-name> directory is created
+on both of the client and the server.
+
+Example 1: Inject an error into request processing of rtrs-client
+-----------------------------------------------------------------
+
+Generate an error on one session of rtrs-client::
+   
+  echo 100 > /sys/kernel/debug/ip\:192.168.123.144@ip\:192.168.123.190/fault_inject/probability 
+  echo 1 > /sys/kernel/debug/ip\:192.168.123.144@ip\:192.168.123.190/fault_inject/times 
+  echo 1 > /sys/kernel/debug/ip\:192.168.123.144@ip\:192.168.123.190/fault_inject/fail-request 
+  dd if=/dev/rnbd0 of=./dd bs=1k count=10
+
+Expected Result::
+
+  dd succeeds but generates an IO error
+
+Message from dmesg::
+
+  FAULT_INJECTION: forcing a failure.
+  name fault_inject, interval 1, probability 100, space 0, times 1
+  CPU: 0 PID: 799 Comm: dd Tainted: G           O      5.4.77-pserver+ #169
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
+  Call Trace:
+    dump_stack+0x97/0xe0
+    should_fail.cold+0x5/0x11
+    rtrs_clt_should_fail_request+0x2f/0x50 [rtrs_client]
+    rtrs_clt_request+0x223/0x540 [rtrs_client]
+    rnbd_queue_rq+0x347/0x800 [rnbd_client]
+    __blk_mq_try_issue_directly+0x268/0x380
+    blk_mq_request_issue_directly+0x9a/0xe0
+    blk_mq_try_issue_list_directly+0xa3/0x170
+    blk_mq_sched_insert_requests+0x1de/0x340
+    blk_mq_flush_plug_list+0x488/0x620
+    blk_flush_plug_list+0x20f/0x250
+    blk_finish_plug+0x3c/0x54
+    read_pages+0x104/0x2b0
+    __do_page_cache_readahead+0x28b/0x2b0
+    ondemand_readahead+0x2cc/0x610
+    generic_file_read_iter+0xde0/0x11f0
+    new_sync_read+0x246/0x360
+    vfs_read+0xc1/0x1b0
+    ksys_read+0xc3/0x160
+    do_syscall_64+0x68/0x260
+    entry_SYSCALL_64_after_hwframe+0x49/0xbe
+  RIP: 0033:0x7f7ff4296461
+  Code: fe ff ff 50 48 8d 3d fe d0 09 00 e8 e9 03 02 00 66 0f 1f 84 00 00 00 00 00 48 8d 05 99 62 0d 00 8b 00 85 c0 75 13 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 57 c3 66 0f 1f 44 00 00 41 54 49 89 d4 55 48
+  RSP: 002b:00007fffdceca5b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
+  RAX: ffffffffffffffda RBX: 000055c5eab6e3e0 RCX: 00007f7ff4296461
+  RDX: 0000000000000400 RSI: 000055c5ead27000 RDI: 0000000000000000
+  RBP: 0000000000000400 R08: 0000000000000003 R09: 00007f7ff4368260
+  R10: ffffffffffffff3b R11: 0000000000000246 R12: 000055c5ead27000
+  R13: 0000000000000000 R14: 0000000000000000 R15: 000055c5ead27000
+
+Example 2: rtrs-server does not send ACK to the heart-beat of rtrs-client
+-------------------------------------------------------------------------
+
+::
+
+  echo 100 > /sys/kernel/debug/ip\:192.168.123.190@ip\:192.168.123.144/fault_inject/probability 
+  echo 5 > /sys/kernel/debug/ip\:192.168.123.190@ip\:192.168.123.144/fault_inject/times 
+  echo 1 > /sys/kernel/debug/ip\:192.168.123.190@ip\:192.168.123.144/fault_inject/fail-hb-ack
+   
+Expected Result::
+
+  If rtrs-server does not send ACK more than 5 times, rtrs-client tries reconnection.
+
+Check how many times rtrs-client did reconnection::
+
+  cat /sys/devices/virtual/rtrs-client/bla/paths/ip\:192.168.122.142@ip\:192.168.122.130/stats/reconnects 
+  1 0
-- 
2.25.1


  parent reply	other threads:[~2021-03-25 15:34 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 15:32 [PATCH for-next 00/22] Misc update for rtrs Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 01/22] MAINTAINERS: Change maintainer for rtrs module Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 02/22] RDMA/rtrs: Enable the fault-injection Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 03/22] RDMA/rtrs-clt: Inject a fault at request processing Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 04/22] RDMA/rtrs-srv: Inject a fault at heart-beat sending Gioh Kim
2021-03-25 15:32 ` Gioh Kim [this message]
2021-04-01 18:37   ` [PATCH for-next 05/22] docs: fault-injection: Add fault-injection manual of RTRS Jason Gunthorpe
2021-04-01 19:06     ` Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 06/22] RDMA/rtrs-clt: Break if one sess is connected in rtrs_clt_is_connected Gioh Kim
2021-04-01 18:38   ` Jason Gunthorpe
2021-04-06 10:23     ` Gioh Kim
2021-04-06 12:51       ` Jason Gunthorpe
2021-04-06 12:53         ` Gioh Kim
2021-04-06 12:59           ` Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 07/22] RDMA/rtrs-clt: Remove redundant code from rtrs_clt_read_req Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 08/22] RDMA/rtrs: Kill the put label in rtrs_srv_create_once_sysfs_root_folders Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 09/22] RDMA/rtrs: Remove sessname and sess_kobj from rtrs_attrs Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 10/22] RDMA/rtrs: Cleanup the code in rtrs_srv_rdma_cm_handler Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 11/22] RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 12/22] RDMA/rtrs-clt: Check state of the rtrs_clt_sess before reading its stats Gioh Kim
2021-04-01 18:44   ` Jason Gunthorpe
2021-04-06  8:55     ` Gioh Kim
2021-04-08 12:04       ` Jason Gunthorpe
2021-04-08 12:08         ` Gioh Kim
2021-04-08 13:45         ` Jinpu Wang
2021-04-08 13:50           ` Jason Gunthorpe
2021-04-08 14:44             ` Gioh Kim
2021-04-08 14:51               ` Jason Gunthorpe
2021-04-12  8:41                 ` Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 13/22] RDMA/rtrs: New function converting rtrs_addr to string Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 14/22] RDMA/rtrs-clt: Print more info when an error happens Gioh Kim
2021-04-01 18:46   ` Jason Gunthorpe
2021-04-01 19:09     ` Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 15/22] RDMA/rtrs-srv: More debugging info when fail to send reply Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 16/22] RDMA/rtrs-srv: Report temporary sessname for error message Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 17/22] RDMA/rtrs: cleanup unused variable Gioh Kim
2021-04-01 18:50   ` Jason Gunthorpe
2021-03-25 15:33 ` [PATCH for-next 18/22] RDMA/rtrs-clt: Simplify error message Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 19/22] RDMA/rtrs-clt: Cap max_io_size Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 20/22] RDMA/rtrs-clt: Add a minimum latency multipath policy Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 21/22] RDMA/rtrs-clt: new sysfs attribute to print the latency of each path Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 22/22] Documentation/ABI/rtrs-clt: Add descriptions for min-latency policy Gioh Kim
2021-04-01 19:04 ` [PATCH for-next 00/22] Misc update for rtrs Jason Gunthorpe
2021-04-06  9:04   ` Gioh Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210325153308.1214057-6-gi-oh.kim@ionos.com \
    --to=gi-oh.kim@ionos.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=gi-oh.kim@cloud.ionos.com \
    --cc=haris.iqbal@ionos.com \
    --cc=jgg@ziepe.ca \
    --cc=jinpu.wang@ionos.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.