lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250626185224281uob0b6opNV8WcLja16SOg@zte.com.cn>
Date: Thu, 26 Jun 2025 18:52:24 +0800 (CST)
From: <jiang.kun2@....com.cn>
To: <alexs@...nel.org>, <si.yanteng@...ux.dev>, <corbet@....net>,
        <linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Cc: <xu.xin16@....com.cn>, <yang.yang29@....com.cn>, <wang.yaxin@....com.cn>,
        <fan.yu9@....com.cn>, <he.peilin@....com.cn>, <tu.qiang35@....com.cn>,
        <qiu.yutan@....com.cn>, <zhang.yunkai@....com.cn>,
        <ye.xingchen@....com.cn>
Subject: [PATCH 1/3 linux next v2] Docs/zh_CN: Translate netif-msg.rst
 to Simplified Chinese

From: Wang Yaxin <wang.yaxin@....com.cn>

translate the "netif-msg.rst" into Simplified Chinese.

Update to commit c4d5dff60f0a("docs: networking: convert
 netif-msg.txt to ReST")

Signed-off-by: Wang Yaxin <wang.yaxin@....com.cn>
Signed-off-by: Jiang Kun <jiang.kun2@....com.cn>
---
v1->v2:
1. adjust table format.
2. correct some Chinese expressions.

 .../translations/zh_CN/networking/index.rst   |  2 +-
 .../zh_CN/networking/netif-msg.rst            | 93 +++++++++++++++++++
 2 files changed, 94 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/translations/zh_CN/networking/netif-msg.rst

diff --git a/Documentation/translations/zh_CN/networking/index.rst b/Documentation/translations/zh_CN/networking/index.rst
index 07a3933afe92..4dd75ec27dec 100644
--- a/Documentation/translations/zh_CN/networking/index.rst
+++ b/Documentation/translations/zh_CN/networking/index.rst
@@ -22,6 +22,7 @@
 
    msg_zerocopy
    napi.rst
+   netif-msg
 
 Todolist:
 
@@ -100,7 +101,6 @@ Todolist:
 *   netdev-features
 *   netdevices
 *   netfilter-sysctl
-*   netif-msg
 *   netmem
 *   nexthop-group-resilient
 *   nf_conntrack-sysctl
diff --git a/Documentation/translations/zh_CN/networking/netif-msg.rst b/Documentation/translations/zh_CN/networking/netif-msg.rst
new file mode 100644
index 000000000000..4810a3f8fc7c
--- /dev/null
+++ b/Documentation/translations/zh_CN/networking/netif-msg.rst
@@ -0,0 +1,93 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+.. include:: ../disclaimer-zh_CN.rst
+
+:Original: Documentation/networking/netif-msg.rst
+
+:翻译:
+
+   王亚鑫 Wang Yaxin <wang.yaxin@....com.cn>
+
+================
+网络接口消息级别
+================
+
+网络接口消息级别设置的设计方案。
+
+历史背景
+--------
+
+调试消息接口的设计遵循并受制于向后兼容性及历史实践。理解其发展历史有助于把握
+当前实践,并将其与旧版驱动代码相关联。
+
+自Linux诞生之初,每个网络设备驱动均包含一个本地整型变量以控制调试消息级别。
+消息级别范围为0至7,数值越大表示输出越详细。
+
+消息级别的定义在3级之后未明确细化,但实际实现通常与指定级别相差±1。驱动程序
+成熟后,冗余的详细级别消息常被移除。
+
+  - 0  最简消息,仅显示致命错误的关键信息。
+  - 1  标准消息,初始化状态。无运行时消息。
+  - 2  特殊介质选择消息,通常由定时器驱动。
+  - 3  接口开启和停止消息,包括正常状态信息。
+  - 4  Tx/Rx帧错误消息及异常驱动操作。
+  - 5  Tx数据包队列信息、中断事件。
+  - 6  每个完成的Tx数据包和接收的Rx数据包状态。
+  - 7  Tx/Rx数据包初始内容。
+
+最初,该消息级别变量在各驱动中具有唯一名称(如"lance_debug"),便于通过
+内核符号调试器定位和修改其设置。模块化内核出现后,变量统一重命名为"debug",
+并作为模块参数设置。
+
+这种方法效果良好。然而,人们始终对附加功能存在需求。多年来,以下功能逐渐
+成为合理且易于实现的增强方案:
+
+  - 通过ioctl()调用修改消息级别。
+  - 按接口而非驱动设置消息级别。
+  - 对发出的消息类型进行更具选择性的控制。
+
+netif_msg 建议添加了这些功能,仅带来了轻微的复杂性增加和代码规模增长。
+
+推荐方案如下:
+
+  - 保留驱动级整型变量"debug"作为模块参数,默认值为'1'。
+
+  - 添加一个名为 "msg_enable" 的接口私有变量。该变量是位图而非级别,
+    并按如下方式初始化::
+
+       1 << debug
+
+     或更精确地说::
+
+	debug < 0 ? 0 : 1 << min(sizeof(int)-1, debug)
+
+    消息应从以下形式更改::
+
+      if (debug > 1)
+	   printk(MSG_DEBUG "%s: ...
+
+    改为::
+
+      if (np->msg_enable & NETIF_MSG_LINK)
+	   printk(MSG_DEBUG "%s: ...
+
+消息级别命名对应关系
+
+
+  =========   ===================	============
+  旧级别       名称			            位位置
+  =========   ===================	============
+    0         NETIF_MSG_DRV		0x0001
+    1         NETIF_MSG_PROBE		0x0002
+    2         NETIF_MSG_LINK		0x0004
+    2         NETIF_MSG_TIMER		0x0004
+    3         NETIF_MSG_IFDOWN		0x0008
+    3         NETIF_MSG_IFUP		0x0008
+    4         NETIF_MSG_RX_ERR		0x0010
+    4         NETIF_MSG_TX_ERR		0x0010
+    5         NETIF_MSG_TX_QUEUED	0x0020
+    5         NETIF_MSG_INTR		0x0020
+    6         NETIF_MSG_TX_DONE		0x0040
+    6         NETIF_MSG_RX_STATUS	0x0040
+    7         NETIF_MSG_PKTDATA		0x0080
+  =========   ===================	============
-- 
2.25.1
<div class="zcontentRow"><div style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;line-height:1.5"><div style="line-height:1.5">From: Wang Yaxin &lt;wang.yaxin@....com.cn&gt;</div><div style="line-height:1.5"><br></div><div style="line-height:1.5">translate the "netif-msg.rst" into Simplified Chinese.</div><div style="line-height:1.5"><br></div><div style="line-height:1.5">Update to commit c4d5dff60f0a("docs: networking: convert</div><div style="line-height:1.5">&nbsp;netif-msg.txt to ReST")</div><div style="line-height:1.5"><br></div><div style="line-height:1.5">Signed-off-by: Wang Yaxin &lt;wang.yaxin@....com.cn&gt;</div><div style="line-height:1.5">Signed-off-by: Jiang Kun &lt;jiang.kun2@....com.cn&gt;</div><div style="line-height:1.5">---</div><div style="line-height:1.5">v1-&gt;v2:</div><div style="line-height:1.5">1. adjust table format.</div><div style="line-height:1.5">2. correct some Chinese expressions.</div><div style="line-height:1.5"><br></div><div style="line-height:1.5">&nbsp;.../translations/zh_CN/networking/index.rst&nbsp; &nbsp;|&nbsp; 2 +-</div><div style="line-height:1.5">&nbsp;.../zh_CN/networking/netif-msg.rst&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 93 +++++++++++++++++++</div><div style="line-height:1.5">&nbsp;2 files changed, 94 insertions(+), 1 deletion(-)</div><div style="line-height:1.5">&nbsp;create mode 100644 Documentation/translations/zh_CN/networking/netif-msg.rst</div><div style="line-height:1.5"><br></div><div style="line-height:1.5">diff --git a/Documentation/translations/zh_CN/networking/index.rst b/Documentation/translations/zh_CN/networking/index.rst</div><div style="line-height:1.5">index 07a3933afe92..4dd75ec27dec 100644</div><div style="line-height:1.5">--- a/Documentation/translations/zh_CN/networking/index.rst</div><div style="line-height:1.5">+++ b/Documentation/translations/zh_CN/networking/index.rst</div><div style="line-height:1.5">@@ -22,6 +22,7 @@</div><div style="line-height:1.5">&nbsp;</div><div style="line-height:1.5">&nbsp; &nbsp; msg_zerocopy</div><div style="line-height:1.5">&nbsp; &nbsp; napi.rst</div><div style="line-height:1.5">+&nbsp; &nbsp;netif-msg</div><div style="line-height:1.5">&nbsp;</div><div style="line-height:1.5">&nbsp;Todolist:</div><div style="line-height:1.5">&nbsp;</div><div style="line-height:1.5">@@ -100,7 +101,6 @@ Todolist:</div><div style="line-height:1.5">&nbsp;*&nbsp; &nbsp;netdev-features</div><div style="line-height:1.5">&nbsp;*&nbsp; &nbsp;netdevices</div><div style="line-height:1.5">&nbsp;*&nbsp; &nbsp;netfilter-sysctl</div><div style="line-height:1.5">-*&nbsp; &nbsp;netif-msg</div><div style="line-height:1.5">&nbsp;*&nbsp; &nbsp;netmem</div><div style="line-height:1.5">&nbsp;*&nbsp; &nbsp;nexthop-group-resilient</div><div style="line-height:1.5">&nbsp;*&nbsp; &nbsp;nf_conntrack-sysctl</div><div style="line-height:1.5">diff --git a/Documentation/translations/zh_CN/networking/netif-msg.rst b/Documentation/translations/zh_CN/networking/netif-msg.rst</div><div style="line-height:1.5">new file mode 100644</div><div style="line-height:1.5">index 000000000000..4810a3f8fc7c</div><div style="line-height:1.5">--- /dev/null</div><div style="line-height:1.5">+++ b/Documentation/translations/zh_CN/networking/netif-msg.rst</div><div style="line-height:1.5">@@ -0,0 +1,93 @@</div><div style="line-height:1.5">+.. SPDX-License-Identifier: GPL-2.0</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+.. include:: ../disclaimer-zh_CN.rst</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+:Original: Documentation/networking/netif-msg.rst</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+:翻译:</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp;王亚鑫 Wang Yaxin &lt;wang.yaxin@....com.cn&gt;</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+================</div><div style="line-height:1.5">+网络接口消息级别</div><div style="line-height:1.5">+================</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+网络接口消息级别设置的设计方案。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+历史背景</div><div style="line-height:1.5">+--------</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+调试消息接口的设计遵循并受制于向后兼容性及历史实践。理解其发展历史有助于把握</div><div style="line-height:1.5">+当前实践,并将其与旧版驱动代码相关联。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+自Linux诞生之初,每个网络设备驱动均包含一个本地整型变量以控制调试消息级别。</div><div style="line-height:1.5">+消息级别范围为0至7,数值越大表示输出越详细。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+消息级别的定义在3级之后未明确细化,但实际实现通常与指定级别相差±1。驱动程序</div><div style="line-height:1.5">+成熟后,冗余的详细级别消息常被移除。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; - 0&nbsp; 最简消息,仅显示致命错误的关键信息。</div><div style="line-height:1.5">+&nbsp; - 1&nbsp; 标准消息,初始化状态。无运行时消息。</div><div style="line-height:1.5">+&nbsp; - 2&nbsp; 特殊介质选择消息,通常由定时器驱动。</div><div style="line-height:1.5">+&nbsp; - 3&nbsp; 接口开启和停止消息,包括正常状态信息。</div><div style="line-height:1.5">+&nbsp; - 4&nbsp; Tx/Rx帧错误消息及异常驱动操作。</div><div style="line-height:1.5">+&nbsp; - 5&nbsp; Tx数据包队列信息、中断事件。</div><div style="line-height:1.5">+&nbsp; - 6&nbsp; 每个完成的Tx数据包和接收的Rx数据包状态。</div><div style="line-height:1.5">+&nbsp; - 7&nbsp; Tx/Rx数据包初始内容。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+最初,该消息级别变量在各驱动中具有唯一名称(如"lance_debug"),便于通过</div><div style="line-height:1.5">+内核符号调试器定位和修改其设置。模块化内核出现后,变量统一重命名为"debug",</div><div style="line-height:1.5">+并作为模块参数设置。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+这种方法效果良好。然而,人们始终对附加功能存在需求。多年来,以下功能逐渐</div><div style="line-height:1.5">+成为合理且易于实现的增强方案:</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; - 通过ioctl()调用修改消息级别。</div><div style="line-height:1.5">+&nbsp; - 按接口而非驱动设置消息级别。</div><div style="line-height:1.5">+&nbsp; - 对发出的消息类型进行更具选择性的控制。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+netif_msg 建议添加了这些功能,仅带来了轻微的复杂性增加和代码规模增长。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+推荐方案如下:</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; - 保留驱动级整型变量"debug"作为模块参数,默认值为'1'。</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; - 添加一个名为 "msg_enable" 的接口私有变量。该变量是位图而非级别,</div><div style="line-height:1.5">+&nbsp; &nbsp; 并按如下方式初始化::</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp; &nbsp; &nbsp;1 &lt;&lt; debug</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp; &nbsp;或更精确地说::</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+<span style="white-space:pre">	</span>debug &lt; 0 ? 0 : 1 &lt;&lt; min(sizeof(int)-1, debug)</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp; 消息应从以下形式更改::</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp; &nbsp; if (debug &gt; 1)</div><div style="line-height:1.5">+<span style="white-space:pre">	</span>&nbsp; &nbsp;printk(MSG_DEBUG "%s: ...</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp; 改为::</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; &nbsp; &nbsp; if (np-&gt;msg_enable &amp; NETIF_MSG_LINK)</div><div style="line-height:1.5">+<span style="white-space:pre">	</span>&nbsp; &nbsp;printk(MSG_DEBUG "%s: ...</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+消息级别命名对应关系</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+</div><div style="line-height:1.5">+&nbsp; =========&nbsp; &nbsp;===================<span style="white-space:pre">	</span>============</div><div style="line-height:1.5">+&nbsp; 旧级别&nbsp; &nbsp; &nbsp; &nbsp;名称<span style="white-space:pre">			</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 位位置</div><div style="line-height:1.5">+&nbsp; =========&nbsp; &nbsp;===================<span style="white-space:pre">	</span>============</div><div style="line-height:1.5">+&nbsp; &nbsp; 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_DRV<span style="white-space:pre">		</span>0x0001</div><div style="line-height:1.5">+&nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_PROBE<span style="white-space:pre">		</span>0x0002</div><div style="line-height:1.5">+&nbsp; &nbsp; 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_LINK<span style="white-space:pre">		</span>0x0004</div><div style="line-height:1.5">+&nbsp; &nbsp; 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_TIMER<span style="white-space:pre">		</span>0x0004</div><div style="line-height:1.5">+&nbsp; &nbsp; 3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_IFDOWN<span style="white-space:pre">		</span>0x0008</div><div style="line-height:1.5">+&nbsp; &nbsp; 3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_IFUP<span style="white-space:pre">		</span>0x0008</div><div style="line-height:1.5">+&nbsp; &nbsp; 4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_RX_ERR<span style="white-space:pre">		</span>0x0010</div><div style="line-height:1.5">+&nbsp; &nbsp; 4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_TX_ERR<span style="white-space:pre">		</span>0x0010</div><div style="line-height:1.5">+&nbsp; &nbsp; 5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_TX_QUEUED<span style="white-space:pre">	</span>0x0020</div><div style="line-height:1.5">+&nbsp; &nbsp; 5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_INTR<span style="white-space:pre">		</span>0x0020</div><div style="line-height:1.5">+&nbsp; &nbsp; 6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_TX_DONE<span style="white-space:pre">		</span>0x0040</div><div style="line-height:1.5">+&nbsp; &nbsp; 6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_RX_STATUS<span style="white-space:pre">	</span>0x0040</div><div style="line-height:1.5">+&nbsp; &nbsp; 7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NETIF_MSG_PKTDATA<span style="white-space:pre">		</span>0x0080</div><div style="line-height:1.5">+&nbsp; =========&nbsp; &nbsp;===================<span style="white-space:pre">	</span>============</div><div style="line-height:1.5">--&nbsp;</div><div style="line-height:1.5">2.25.1</div></div><br><br><br><br><div><br></div></div>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ