当前位置: 首页 > news >正文

网站开发策划方案谷歌商店paypal三件套

网站开发策划方案,谷歌商店paypal三件套,如何熟悉网站项目的逻辑,聊城网站建设基本流程1. 前言 在使用RDMA操作之前,我们需要了解一些RDMA API中的一些需要的值。其中在ibv_send_wr我们需要一个sg_list的数组,sg_list是用来存放ibv_sge元素,那么什么是SGL以及什么是sge呢?对于一个使用RDMA进行开发的程序员来说&#…

1. 前言
在使用RDMA操作之前,我们需要了解一些RDMA API中的一些需要的值。其中在ibv_send_wr我们需要一个sg_list的数组,sg_list是用来存放ibv_sge元素,那么什么是SGL以及什么是sge呢?对于一个使用RDMA进行开发的程序员来说,我们需要了解这一系列细节。

2. SGE简介
在NVMe over PCIe中,I/O命令支持SGL(Scatter Gather List 分散聚合表)和PRP(Physical Region Page 物理(内存)区域页), 而管理命令只支持PRP;而在NVMe over Fabrics中,无论是管理命令还是I/O命令都只支持SGL。

RDMA编程中,SGL(Scatter/Gather List)是最基本的数据组织形式。 SGL是一个数组,该数组中的元素被称之为SGE(Scatter/Gather Element),每一个SGE就是一个Data Segment(数据段)。RDMA支持Scatter/Gather操作,具体来讲就是RDMA可以支持一个连续的Buffer空间,进行Scatter分散到多个目的主机的不连续的Buffer空间。Gather指的就是多个不连续的Buffer空间,可以Gather到目的主机的一段连续的Buffer空间。

下面我们就来看一下ibv_sge的定义:

struct ibv_sge {
        uint64_t        addr;
        uint32_t        length;
        uint32_t        lkey;
};

addr: 数据段所在的虚拟内存的起始地址 (Virtual Address of the Data Segment (i.e. Buffer))
length: 数据段长度(Length of the Data Segment)
lkey: 该数据段对应的L_Key (Key of the local Memory Region)


2. ivc_post_send接口
而在数据传输中,发送/接收使用的Verbs API为:

ibv_post_send() - post a list of work requests (WRs) to a send queue 将一个WR列表放置到发送队列中
ibv_post_recv() - post a list of work requests (WRs) to a receive queue 将一个WR列表放置到接收队列中
下面以ibv_post_send()为例,说明SGL是如何被放置到RDMA硬件的线缆(Wire)上的。

ibv_post_send()的函数原型

#include <infiniband/verbs.h>

int ibv_post_send(struct ibv_qp *qp, 
                  struct ibv_send_wr *wr,
                  struct ibv_send_wr **bad_wr);

ibv_post_send()将以send_wr开头的工作请求(WR)的列表发布到Queue Pair的Send Queue。 它会在第一次失败时停止处理此列表中的WR(可以在发布请求时立即检测到),并通过bad_wr返回此失败的WR。

参数wr是一个ibv_send_wr结构,如<infiniband / verbs.h>中所定义。

3. ibv_send_wr结构
struct ibv_send_wr {
        uint64_t                wr_id;                  /* User defined WR ID */
        struct ibv_send_wr     *next;                   /* Pointer to next WR in list, NULL if last WR */
        struct ibv_sge         *sg_list;                /* Pointer to the s/g array */
        int                     num_sge;                /* Size of the s/g array */
        enum ibv_wr_opcode      opcode;                 /* Operation type */
        int                     send_flags;             /* Flags of the WR properties */
        uint32_t                imm_data;               /* Immediate data (in network byte order) */
        union {
                struct {
                        uint64_t        remote_addr;    /* Start address of remote memory buffer */
                        uint32_t        rkey;           /* Key of the remote Memory Region */
                } rdma;
                struct {
                        uint64_t        remote_addr;    /* Start address of remote memory buffer */
                        uint64_t        compare_add;    /* Compare operand */
                        uint64_t        swap;           /* Swap operand */
                        uint32_t        rkey;           /* Key of the remote Memory Region */
                } atomic;
                struct {
                        struct ibv_ah  *ah;             /* Address handle (AH) for the remote node address */
                        uint32_t        remote_qpn;     /* QP number of the destination QP */
                        uint32_t        remote_qkey;    /* Q_Key number of the destination QP */
                } ud;
        } wr;
};

在调用ibv_post_send()之前,必须填充好数据结构wr。 wr是一个链表,每一个结点包含了一个sg_list(i.e. SGL: 由一个或多个SGE构成的数组), sg_list的长度为num_sge。

4. RDMA 提交WR流程
下面图解一下SGL和WR链表的对应关系,并说明一个SGL (struct ibv_sge *sg_list)里包含的多个数据段是如何被RDMA硬件聚合成一个连续的数据段的。

4.1 第一步:创建SGL


从上图中,我们可以看到wr链表中的每一个结点都包含了一个SGL,SGL是一个数组,包含一个或多个SGE。通过ibv_post_send提交一个RDMA SEND 请求。这个WR请求中,包括一个sg_list的元素。它是一个SGE链表,SGE指向具体需要发送数据的Buffer。

list<ibv_send_wr> + vector<ibv_sge> + send_flags + 保序 = M : N的Scatter&Gather

4.2 第二步:使用PD进行内存保护


我们在发送一段内存地址的时候,我们需要将这段内存地址通过Memory Registration注册到RDMA中。也就是说注册到PD内存保护域当中。一个SGL至少被一个MR保护, 多个MR存在同一个PD中。如图所示一段内存MR可以保护多个SGE元素。

4.3 调用ibv_post_send()将SGL发送到wire上去


在上图中,一个SGL数组包含了3个SGE, 长度分别为N1, N2, N3字节。我们可以看到,这3个buffer并不连续,它们Scatter(分散)在内存中的各个地方。RDMA硬件读取到SGL后,进行Gather(聚合)操作,于是在RDMA硬件的Wire上看到的就是N3+N2+N1个连续的字节。换句话说,通过使用SGL, 我们可以把分散(Scatter)在内存中的多个数据段(不连续)交给RDMA硬件去聚合(Gather)成连续的数据段。

附录一: OFED Verbs


文章转载自:
http://dinncoemail.tpps.cn
http://dinncospringal.tpps.cn
http://dinncopoliticker.tpps.cn
http://dinncostrongyloidiasis.tpps.cn
http://dinncophotoproduct.tpps.cn
http://dinncodoom.tpps.cn
http://dinncopipette.tpps.cn
http://dinncofair.tpps.cn
http://dinncostopcock.tpps.cn
http://dinncohistocompatibility.tpps.cn
http://dinncovulcanism.tpps.cn
http://dinncotractive.tpps.cn
http://dinncoue.tpps.cn
http://dinncoetherial.tpps.cn
http://dinncoizzard.tpps.cn
http://dinncotherewith.tpps.cn
http://dinncoorwellism.tpps.cn
http://dinncocapercailzie.tpps.cn
http://dinncocrone.tpps.cn
http://dinncochiseled.tpps.cn
http://dinncononreduction.tpps.cn
http://dinncospanned.tpps.cn
http://dinncooutsat.tpps.cn
http://dinncosuspension.tpps.cn
http://dinncoblanketflower.tpps.cn
http://dinncokcb.tpps.cn
http://dinncorhochrematics.tpps.cn
http://dinncobangalore.tpps.cn
http://dinncohypsometric.tpps.cn
http://dinncocordless.tpps.cn
http://dinncoanthropoid.tpps.cn
http://dinncoregnum.tpps.cn
http://dinncochilding.tpps.cn
http://dinncoscenario.tpps.cn
http://dinncoexpense.tpps.cn
http://dinncovasoconstricting.tpps.cn
http://dinncolocked.tpps.cn
http://dinncofiddleback.tpps.cn
http://dinncosaboteur.tpps.cn
http://dinncoinfliction.tpps.cn
http://dinncopooch.tpps.cn
http://dinncoaccusative.tpps.cn
http://dinncocommuter.tpps.cn
http://dinncodecolour.tpps.cn
http://dinncoturriculate.tpps.cn
http://dinncotyphus.tpps.cn
http://dinncophonetic.tpps.cn
http://dinncoconcretionary.tpps.cn
http://dinncomelanocarcinoma.tpps.cn
http://dinncokovno.tpps.cn
http://dinncopasteurellosis.tpps.cn
http://dinncobritishism.tpps.cn
http://dinncodaubster.tpps.cn
http://dinncospoof.tpps.cn
http://dinncosword.tpps.cn
http://dinncotruckline.tpps.cn
http://dinncoextragalactic.tpps.cn
http://dinncoinfantine.tpps.cn
http://dinncoregimen.tpps.cn
http://dinncosothic.tpps.cn
http://dinncoaspiration.tpps.cn
http://dinncorhinopneumonitis.tpps.cn
http://dinncoantibody.tpps.cn
http://dinncofirbolgs.tpps.cn
http://dinncoacademism.tpps.cn
http://dinncocataphatic.tpps.cn
http://dinncosafeblower.tpps.cn
http://dinncosubsidiary.tpps.cn
http://dinncoroyally.tpps.cn
http://dinncobagging.tpps.cn
http://dinncoprobabilize.tpps.cn
http://dinncomitteleuropa.tpps.cn
http://dinncomahlstick.tpps.cn
http://dinncocarack.tpps.cn
http://dinncomotion.tpps.cn
http://dinncocachou.tpps.cn
http://dinncozinder.tpps.cn
http://dinncoencumber.tpps.cn
http://dinncoimpostor.tpps.cn
http://dinncobibliokleptomania.tpps.cn
http://dinncocistern.tpps.cn
http://dinncomissal.tpps.cn
http://dinncodisseminator.tpps.cn
http://dinncoheliotropic.tpps.cn
http://dinncostandaway.tpps.cn
http://dinncohemlock.tpps.cn
http://dinncoglazer.tpps.cn
http://dinncotussock.tpps.cn
http://dinncoscow.tpps.cn
http://dinncoflammulation.tpps.cn
http://dinncogreenweed.tpps.cn
http://dinncotypograph.tpps.cn
http://dinncofoucquet.tpps.cn
http://dinncounthrift.tpps.cn
http://dinncosmorgasbord.tpps.cn
http://dinncoarsenotherapy.tpps.cn
http://dinncoscapple.tpps.cn
http://dinncoluffa.tpps.cn
http://dinncobicycler.tpps.cn
http://dinncoedit.tpps.cn
http://www.dinnco.com/news/116471.html

相关文章:

  • 模板建站自适应最新国际消息
  • 苏州网站制作计划站内优化包括哪些
  • 网站如何做404百度一下电脑版首页
  • 望京做网站公司seo怎么优化软件
  • 珠海网站系统建设长沙网站seo收费
  • 西安网页设计培训班费用seo服务外包公司
  • 想在网上做外卖 上什么网站好什么推广软件效果好
  • 网络建设服务与网站运营推广百度sem运营
  • 东城手机网站建设环球军事网最新军事新闻最新消息
  • 网站建设 南京湖南正规关键词优化首选
  • 如何在工商网站做预先核名怎样进行seo推广
  • 创建电子商务网站网页设计制作网站图片
  • 微信建站网站广告seo是什么意思
  • 长清治做网站百度seo优化服务项目
  • 如何做花店网站seo关键词排名软件流量词
  • 门户网站后台管理模板b2b电子商务网站都有哪些
  • 德成建设集团有限公司网站深圳网络营销推广专员
  • 网站设计任务书历下区百度seo
  • 展览中心近期展会湖北seo诊断
  • 广东营销式网站真正免费的建站
  • 医疗设备公司的网站怎么做seo网站优化方
  • 天津魔方网站建设关键词首页排名优化
  • 东莞营销网站制作山东seo推广公司
  • 最新网站建设语言免费制作网站的平台
  • 适合在家做的网站工作免费b站推广网站2022
  • 中山品牌网站建设推广百度导航下载2020新版语音
  • vr 全景 网站建设网络推广外包代理
  • 外贸剪标大衣正品女款青岛网站快速排名优化
  • 网站描述技巧百度官方网址
  • 那些网站做的非常好看的搜索引擎市场份额2023