Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp607836rwb; Thu, 10 Nov 2022 05:20:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM5xdDHReZwZMtc5B50d8X+syN6qDImBz3I3zi9gw6er8I2xcDpRcwfroETDhQfqwpHKnA3F X-Received: by 2002:a17:907:2723:b0:7ad:e01d:1ff5 with SMTP id d3-20020a170907272300b007ade01d1ff5mr48825683ejl.368.1668086420116; Thu, 10 Nov 2022 05:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668086420; cv=none; d=google.com; s=arc-20160816; b=pzIrWfp1/8lZfSx4+h6V478Ak+LOnZvV/8ElJcDCZWI/OF8y7lRXVhcWoj0Bw8v0n+ gXuU/KItYe+1ECoc7BuWktpGOYYkh8jsk1mKaBlLqN3dTw/ZfUHdPclYcIbNP2pTjIJi Rq0HR8lBozjEb3UZP6+a0fzOJcdGmKrRhCxCQMR1mh0eywxbGFJNObGniSehQ50O0urk /+9+75YETwWw4KhzEt/jSaW6Q7qyjZYh9ZMkeyqyzwfK8VSBxW9RevYr0u5+dxKSfCSR uxBPJi/yj2R0BLJ676zOWCna7gxWrr6zltZRR2ZJbbV7xFNwW7qgTDD1Jh799b/u3Kt0 bGUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:mime-version:date :dkim-signature:message-id; bh=ATm4kAH7JE8hj5bSRwpeVJYUJXALD5eBvNbcqQ5KEok=; b=WEgMe3tRSb9EQ33h1qBxJhHH5pfF/kw8tgKP9bI5OEePavBeAOnE7KyaWt61pwEWXJ tMKEWLHTyhBlL27DRvMH0Ii77VgYIhOJEPUJacccD4SeznuPK44rs/JsrtdgfMSyLMhw EkLmUNl84bUuQyHCKuMN2fSBTUv+4z07CHnArPy3sQDstVepuO79MpICPFy6RhMsA+Fu TVUTWqQtK1dKea1uFwwVGFlSfkU7mT7gPz+7JlinhTHBi5x+vc288u1vOkofnJ2NgcxJ 87qHGe5Bgg51vMX+/uqIIHLjQEHH/Jefw9NLg/2BxNQGD3DaPQZoLvO8spSsAJEu+qRv JOFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lirui.org header.s=key1 header.b=i+KZWU8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lirui.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a056402359600b0045c13366de4si20352963edc.572.2022.11.10.05.19.56; Thu, 10 Nov 2022 05:20:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lirui.org header.s=key1 header.b=i+KZWU8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=lirui.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbiKJNCH (ORCPT + 92 others); Thu, 10 Nov 2022 08:02:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230062AbiKJNCF (ORCPT ); Thu, 10 Nov 2022 08:02:05 -0500 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE0C701B7; Thu, 10 Nov 2022 05:02:02 -0800 (PST) Message-ID: <618523aa-58bf-229c-19ef-eb752937e9ad@lirui.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lirui.org; s=key1; t=1668085321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ATm4kAH7JE8hj5bSRwpeVJYUJXALD5eBvNbcqQ5KEok=; b=i+KZWU8vL9h9Jzf74xxQxeAssbFKqevbDRdzEo3O8v6TVo9thSoMDoniwZ6tTlqMUBcMm8 hdRNAW0PfYZQJnUnBhTQEVvfRTi100MxNqJGyzN55/K+nALlg449uHSiUbNT4bRcqKQQg4 h2lY5PxPtpIJ8EgqQGcmrndfIknYC+nMZQf5OrQ+18Cfmh1OYwgikP22rQeFy1vU3C+c4O ZICHZveYu+GHNpSpwC7JQGrHGOYAvAIs68ol5FDq0UVPeyeHuhJ+4jaCMqm9DOCUuwvab/ OsrB7mBr0UVoQw5zbruH7KTw/u5sG0/0yi9RZ9V8Vs7dedkFoZRB3LwYAfZyMQ== Date: Thu, 10 Nov 2022 21:01:49 +0800 MIME-Version: 1.0 Subject: Re: [PATCH] docs/zh_CN: Add userspace-api/accelerators/ocxl Chinese translation To: Wu XiangCheng Cc: Alex Shi , Yanteng Si , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221110062609.377848-1-me@lirui.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Rui Li In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/10 20:14, Wu XiangCheng wrote: >> Translate the following documents into Chinese: >> >> - userspace-api/accelerators/ocxl.rst >> >> Signed-off-by: Rui Li >> --- >> .../zh_CN/userspace-api/accelerators/ocxl.rst | 168 ++++++++++++++++++ >> .../zh_CN/userspace-api/index.rst | 2 +- >> 2 files changed, 169 insertions(+), 1 deletion(-) >> create mode 100644 Documentation/translations/zh_CN/userspace-api/accelerators/ocxl.rst >> >> diff --git a/Documentation/translations/zh_CN/userspace-api/accelerators/ocxl.rst b/Documentation/translations/zh_CN/userspace-api/accelerators/ocxl.rst >> new file mode 100644 >> index 000000000000..274dcf4667db >> --- /dev/null >> +++ b/Documentation/translations/zh_CN/userspace-api/accelerators/ocxl.rst >> @@ -0,0 +1,168 @@ >> +.. SPDX-License-Identifier: GPL-2.0 >> +.. include:: ../../disclaimer-zh_CN.rst >> + >> +:Original: Documentation/userspace-api/accelerators/ocxl.rst >> + >> +:翻译: >> + >> + 李睿 Rui Li >> + >> +===================================== >> +OpenCAPI (开放相干加速器处理器接口) >> +===================================== >> + >> +*OpenCAPI: Open Coherent Accelerator Processor Interface* >> + >> +OpenCAPI是处理器和加速器之间的一个接口,致力于达到低延迟和高带宽。该规范 >> +由 `OpenCAPI Consortium `_ 开发。 >> + >> +它允许加速器(可以是FPGA、ASIC等)使用虚拟地址连贯地访问主机内存。一个OpenCAPI >> +设备也可以托管它自己的内存,并可以由主机访问。 >> + >> +OpenCAPI在Linux中称为“ocxl”,它作为“cxl”的开放、处理器无关的演进,这么命 > missed: > 'cxl' (the driver for the IBM CAPI interface for powerpc) > >> +名是为了避免与ISDN CAPI子系统相混淆。 >> + >> + >> +高层视角 >> +======== >> + >> +OpenCAPI定义了一个在物理链路层上实现的数据链路层(TL)和传输层(TL)。任何 >> +实现DL和TL的处理器或者设备都可以开始共享内存。 >> + >> +:: >> + >> + +-----------+ +-------------+ >> + | | | | >> + | | | Accelerated | >> + | Processor | | Function | >> + | | +--------+ | Unit | +--------+ >> + | |--| Memory | | (AFU) |--| Memory | >> + | | +--------+ | | +--------+ >> + +-----------+ +-------------+ >> + | | >> + +-----------+ +-------------+ >> + | TL | | TLX | >> + +-----------+ +-------------+ >> + | | >> + +-----------+ +-------------+ >> + | DL | | DLX | >> + +-----------+ +-------------+ >> + | | >> + | PHY | >> + +---------------------------------------+ >> + >> + Processor:处理器 >> + Memory:内存 >> + Accelerated Function Unit:加速函数单元 >> + >> + >> + >> +设备发现 >> +======== >> + >> +OpenCAPI依赖一个在设备上实现的与PCI类似的配置空间。因此主机可以通过查询 >> +配置空间来发现AFU。 >> + >> +OpenCAPI设备在Linux中被当作PCI设备(有一些注意事项)。固件需要对硬件进行 > 类PCI设备 > >> +抽象,就好像它是一个PCI链路。许多已有的PCI架构被重用:在模拟标准PCI时, >> +设备被扫描并且BAR(基址寄存器)被分配。像“lspci”的命令因此可以被用于查看 >> +哪些设备可用。 >> + >> +配置空间定义了可以在物理适配器上可以被找到的AFU,比如它的名字、支持多少内 >> +存上下文、内存映射IO(MMIO)区域的大小等。 >> + >> + >> + >> +MMIO >> +==== >> + >> +OpenCAPI为每个AFU定义了两个MMIO区域: >> + >> +* 全局MMIO区域,保存和整个AFU相关的寄存器。 >> +* 每个进程的MMIO区域,对于每个上下文固定大小。 >> + >> + >> + >> +AFU中断 >> +======= >> + >> +OpenCAPI拥有AFU向主机进程发送中断的可能性。它通过定义在传输层的“intrp_req” >> +来完成,指定一个定义中断的64位对象句柄。 >> + >> +驱动允许一个进程分配中断并获取可以传递给AFU的64位对象句柄。 >> + >> + >> + >> +字符设备 >> +======== >> + >> +驱动为每个在物理设备上发现的AFU创建一个字符设备。一个物理设备可能拥有多个 >> +函数,一个函数可以拥有多个AFU。不过编写这篇文档之时,只对导出一个AFU的设备 >> +测试过。 >> + >> +字符设备可以在 /dev/ocxl/ 中被找到,其命名为: >> +/dev/ocxl/.<位置>.<索引> >> + >> + 是一个最长20个字符的名称,和在AFU配置空间中找到的相同。 >> +<位置>由驱动添加,可在系统有不止一个相同的OpenCAPI设备时帮助区分设备。 >> +<索引>也是为了在少见情况下帮助区分AFU,即设备携带多个同样的AFU副本时。 >> + >> + >> + >> +Sysfs 类 >> +========= > Sysfs类 > ======= > >> + >> +添加了代表AFU的ocxl类。查看/sys/class/ocxl。布局在 >> +Documentation/ABI/testing/sysfs-class-ocxl 中描述。 >> + >> + >> + >> +用户API >> +======= >> + >> +开放 > 打开 > > > Thanks, > > Oops, thanks for correction. I will send updated one later. Thanks. -- Rui Li 0x77E6D821D7AE84FE