All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yanteng Si <siyanteng@loongson.cn>
To: corbet@lwn.net, alexs@kernel.org, bobwxc@email.cn, seakeel@gmail.com
Cc: Yanteng Si <siyanteng@loongson.cn>,
	chenhuacai@kernel.org, jiaxun.yang@flygoat.com,
	linux-doc@vger.kernel.org, realpuyuwang@gmail.com,
	chenweiguang82@126.com, siyanteng01@gmail.com
Subject: [PATCH v2 2/8] docs/zh_CN: add infiniband core_locking translation
Date: Sun,  1 Aug 2021 20:25:32 +0800	[thread overview]
Message-ID: <c7b4cc2c6aba739f777cef80dd527ae523c3d9e5.1627820210.git.siyanteng@loongson.cn> (raw)
In-Reply-To: <cover.1627820210.git.siyanteng@loongson.cn>

Translate Documentation/infiniband/core_locking.rst into Chinese.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 .../zh_CN/infiniband/core_locking.rst         | 115 ++++++++++++++++++
 .../translations/zh_CN/infiniband/index.rst   |   3 +-
 2 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/translations/zh_CN/infiniband/core_locking.rst

diff --git a/Documentation/translations/zh_CN/infiniband/core_locking.rst b/Documentation/translations/zh_CN/infiniband/core_locking.rst
new file mode 100644
index 000000000000..42f08038d44b
--- /dev/null
+++ b/Documentation/translations/zh_CN/infiniband/core_locking.rst
@@ -0,0 +1,115 @@
+
+.. include:: ../disclaimer-zh_CN.rst
+
+:Original: Documentation/infiniband/core_locking.rst
+
+:翻译:
+
+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
+
+:校译:
+
+ 王普宇 Puyu Wang <realpuyuwang@gmail.com>
+ 时奎亮 Alex Shi <alexs@kernel.org>
+
+.. _cn_infiniband_core_locking:
+
+==================
+infiniband中间层锁
+==================
+
+  本指南试图明确infiniband中间层的锁假设。它描述了对位于中间层以下的低
+  级驱动程序和使用中间层的上层协议的要求。
+
+睡眠和中断环境
+==============
+
+  除了以下异常情况,ib_device结构体中所有方法的低级驱动实现都可以睡眠。
+  这些异常情况是列表中的任意的方法:
+
+    - create_ah
+    - modify_ah
+    - query_ah
+    - destroy_ah
+    - post_send
+    - post_recv
+    - poll_cq
+    - req_notify_cq
+
+    他们可能不可以睡眠,而且必须可以从任何上下文中调用。
+
+    向上层协议使用者输出的相应函数:
+
+    - rdma_create_ah
+    - rdma_modify_ah
+    - rdma_query_ah
+    - rdma_destroy_ah
+    - ib_post_send
+    - ib_post_recv
+    - ib_req_notify_cq
+
+    因此,在任何情况下都可以安全调用(它们)。
+
+  此外,该函数
+
+    - ib_dispatch_event
+
+  被底层驱动用来通过中间层调度异步事件的“A”,也可以从任何上下文中安全调
+  用。
+
+可重入性
+--------
+
+  由低级驱动程序导出的ib_device结构体中的所有方法必须是完全可重入的。
+  即使使用同一对象的多个函数调用被同时运行,低级驱动程序也需要执行所有
+  必要的同步以保持一致性。
+
+  IB中间层不执行任何函数调用的序列化。
+
+  因为低级驱动程序是可重入的,所以不要求上层协议使用者任何顺序执行。然
+  而,为了得到合理的结果,可能需要一些顺序。例如,一个使用者可以在多个
+  CPU上同时安全地调用ib_poll_cq()。然而,不同的ib_poll_cq()调用之间
+  的工作完成信息的顺序没有被定义。
+
+回调
+----
+
+  低级驱动程序不得直接从与ib_device方法调用相同的调用链中执行回调。例
+  如,低级驱动程序不允许从post_send方法直接调用使用者的完成事件处理程
+  序。相反,低级驱动程序应该推迟这个回调,例如,调度一个tasklet来执行
+  这个回调。
+
+  低层驱动负责确保同一CQ的多个完成事件处理程序不被同时调用。驱动程序必
+  须保证一个给定的CQ的事件处理程序在同一时间只有一个在运行。换句话说,
+  以下情况是不允许的::
+
+          CPU1                                    CPU2
+
+    low-level driver ->
+      consumer CQ event callback:
+        /* ... */
+        ib_req_notify_cq(cq, ...);
+                                          low-level driver ->
+        /* ... */                           consumer CQ event callback:
+                                              /* ... */
+        return from CQ event handler
+
+  完成事件和异步事件回调的运行环境没有被定义。 根据低级别的驱动程序,它可能是
+  进程上下文、softirq上下文或中断上下文。上层协议使用者可能不会在回调中睡眠。
+
+热插拔
+------
+
+  当一个低级驱动程序调用ib_register_device()时,它宣布一个设备已经
+  准备好供使用者使用,所有的初始化必须在这个调用之前完成。设备必须保
+  持可用,直到驱动对ib_unregister_device()的调用返回。
+
+  低级驱动程序必须从进程上下文调用ib_register_device()和
+  ib_unregister_device()。如果使用者在这些调用中回调到驱动程序,它
+  不能持有任何可能导致死锁的semaphores。
+
+  一旦其结构体ib_client的add方法被调用,上层协议使用者就可以开始使用
+  一个IB设备。使用者必须在从移除方法返回之前完成所有的清理工作并释放
+  与设备相关的所有资源。
+
+  使用者被允许在其添加和删除方法中睡眠。
diff --git a/Documentation/translations/zh_CN/infiniband/index.rst b/Documentation/translations/zh_CN/infiniband/index.rst
index ebb1e20b7df4..cc00f31c77d0 100644
--- a/Documentation/translations/zh_CN/infiniband/index.rst
+++ b/Documentation/translations/zh_CN/infiniband/index.rst
@@ -22,9 +22,10 @@ infiniband
 .. toctree::
    :maxdepth: 1
 
+   core_locking
+
 TODOLIST:
 
-   core_locking
    ipoib
    opa_vnic
    sysfs
-- 
2.27.0


  parent reply	other threads:[~2021-08-01 12:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01 12:25 [PATCH v2 0/8] docs/zh_CN: add infiniband translation Yanteng Si
2021-08-01 12:25 ` [PATCH v2 1/8] docs/zh_CN: add infiniband index translation Yanteng Si
2021-08-04  2:26   ` Alex Shi
2021-08-06  2:06     ` Puyu Wang
2021-08-01 12:25 ` Yanteng Si [this message]
2021-08-04  2:27   ` [PATCH v2 2/8] docs/zh_CN: add infiniband core_locking translation Alex Shi
2021-08-06  2:12   ` Puyu Wang
2021-08-01 12:25 ` [PATCH v2 3/8] docs/zh_CN: add infiniband ipoib translation Yanteng Si
2021-08-04  2:27   ` Alex Shi
2021-08-06  2:14   ` Puyu Wang
2021-08-01 12:25 ` [PATCH v2 4/8] docs/zh_CN: add infiniband opa_vnic translation Yanteng Si
2021-08-04  2:28   ` Alex Shi
2021-08-06  2:14   ` Puyu Wang
2021-08-01 12:25 ` [PATCH v2 5/8] docs/zh_CN: add infiniband sysfs translation Yanteng Si
2021-08-04  2:29   ` Alex Shi
2021-08-06  2:15   ` Puyu Wang
2021-08-01 12:25 ` [PATCH v2 6/8] docs/zh_CN: add infiniband tag_matching translation Yanteng Si
2021-08-04  2:30   ` Alex Shi
2021-08-06  2:17   ` Puyu Wang
2021-08-01 12:25 ` [PATCH v2 7/8] docs/zh_CN: add infiniband user_mad translation Yanteng Si
2021-08-04  2:30   ` Alex Shi
2021-08-06  2:18   ` Puyu Wang
2021-08-01 12:25 ` [PATCH v2 8/8] docs/zh_CN: add infiniband user_verbs translation Yanteng Si
2021-08-04  2:35   ` Alex Shi
2021-08-04  6:38     ` yanteng si
2021-08-06  2:29   ` Puyu Wang
2021-08-06  2:45     ` yanteng si

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=c7b4cc2c6aba739f777cef80dd527ae523c3d9e5.1627820210.git.siyanteng@loongson.cn \
    --to=siyanteng@loongson.cn \
    --cc=alexs@kernel.org \
    --cc=bobwxc@email.cn \
    --cc=chenhuacai@kernel.org \
    --cc=chenweiguang82@126.com \
    --cc=corbet@lwn.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=realpuyuwang@gmail.com \
    --cc=seakeel@gmail.com \
    --cc=siyanteng01@gmail.com \
    /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.