428 Star 1.5K Fork 1.6K

GVPopenEuler/kernel

 / 详情

增加支持hns RoCE自适应PBL功能

已完成
需求 成员
创建于  
2022-10-28 11:24

【特性描述】
支持hns roce根据申请的页面的实际情况去动态计算PBL表的page size以及PBL表的hopnum。
【特性竞争力】
该特性能够减小RoCEE硬件访问MR时的寻址级数,从而减少时延。
【硬件架构】
鲲鹏板载网卡ROCEE
【特性约束】
不支持FRMR类型的MR,其余操作都支持
【涉及仓库】
driver/inifiband/hw/hns

评论 (5)

tcc@hello 创建了需求 2年前
openeuler-ci-bot 添加了
 
sig/Kernel
标签
2年前
tcc@hello 修改了描述 2年前

涉及基础功能进行压力,测试脚本:

#!/bin/bash
set -x
set -e

while [ 1 ]
do

a=$RANDOM
b=$RANDOM

pg_sz=`expr $a \* $b`
pg_sz=`expr $pg_sz % 2147483648`
sleep 2
ib_send_bw -d hns_0 -s $pg_sz &
sleep 2
ib_send_bw -d hns_0 -s $pg_sz 192.168.100.100
sleep 2

ib_write_bw -d hns_0 -s $pg_sz &
sleep 2
ib_write_bw -d hns_0 -s $pg_sz 192.168.100.100
sleep 2

ib_read_bw -d hns_0 -s $pg_sz &
sleep 2
ib_read_bw -d hns_0 -s $pg_sz 192.168.100.100

done

压力测试部分日志:

+ ib_write_bw -d hns_0 -s 56541943

************************************
* Waiting for client to connect... *
************************************
+ ib_write_bw -d hns_0 -s 56541943 192.168.100.100
--------------------------------------------------------------------                                                                                          -------------------
                    RDMA_Write BW Test
 Dual-port       : OFF          Device         : hns_0
 Number of qps   : 1            Transport type : IB
 Connection type : RC           Using SRQ      : OFF
 TX depth        : 128
 CQ Moderation   : 100
 Mtu             : 1024[B]
 Link type       : Ethernet
 GID index       : 2
 Max inline data : 0[B]
 rdma_cm QPs     : OFF
 Data ex. method : Ethernet
--------------------------------------------------------------------                                                                                          -------------------
 local address: LID 0000 QPN 0x03d8 PSN 0x6283be RKey 0x000200 VAddr                                                                                           0x00ffffb16402f7
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
--------------------------------------------------------------------                                                                                          -------------------
                    RDMA_Write BW Test
 Dual-port       : OFF          Device         : hns_0
 Number of qps   : 1            Transport type : IB
 Connection type : RC           Using SRQ      : OFF
 CQ Moderation   : 100
 Mtu             : 1024[B]
 Link type       : Ethernet
 GID index       : 2
 Max inline data : 0[B]
 rdma_cm QPs     : OFF
 Data ex. method : Ethernet
--------------------------------------------------------------------                                                                                          -------------------
 local address: LID 0000 QPN 0x03d9 PSN 0x3745ae RKey 0x000300 VAddr                                                                                           0x00ffff8d3c62f7
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 remote address: LID 0000 QPN 0x03d8 PSN 0x6283be RKey 0x000200 VAdd                                                                                          r 0x00ffffb16402f7
 remote address: LID 0000 QPN 0x03d9 PSN 0x3745ae RKey 0x000300 VAdd                                                                                          r 0x00ffff8d3c62f7
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
--------------------------------------------------------------------                                                                                          -------------------
--------------------------------------------------------------------                                                                                          -------------------
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]   M                                                                                          sgRate[Mpps]
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]   M                                                                                          sgRate[Mpps]
 56541943    5000             2717.02            2714.78                                                                                                        0.000050
--------------------------------------------------------------------                                                                                          -------------------
 56541943    5000             2717.02            2714.78                                                                                                        0.000050
--------------------------------------------------------------------                                                                                          -------------------

查看自适应的效果,利用perftest测试有概率触发page size的变化。利用rdma tool进行查询,不同的mr的drv_buf_pg_shift可能不一样

root:/root/$ ib_write_bw -d hns_0 -s 1 --run_infinite &
[1] 14995
root:/root/$
************************************
* Waiting for client to connect... *
************************************

root:/root/$ ib_write_bw -d hns_0 -s 1 --run_infinite 192.168.100.100 &
[2] 14996
root:/root/$
root:/root/$ ---------------------------------------------------------------------------------------
                    RDMA_Write BW Test
---------------------------------------------------------------------------------------
 Dual-port       : OFF          Device         : hns_0
                    RDMA_Write BW Test
 Number of qps   : 1            Transport type : IB
 Dual-port       : OFF          Device         : hns_0
 Connection type : RC           Using SRQ      : OFF
 Number of qps   : 1            Transport type : IB
 TX depth        : 128
 Connection type : RC           Using SRQ      : OFF
 CQ Moderation   : 100
 CQ Moderation   : 100
 Mtu             : 1024[B]
 Mtu             : 1024[B]
 Link type       : Ethernet
 Link type       : Ethernet
 GID index       : 2
 GID index       : 2
 Max inline data : 0[B]
 Max inline data : 0[B]
 rdma_cm QPs     : OFF
 rdma_cm QPs     : OFF
 Data ex. method : Ethernet
 Data ex. method : Ethernet
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
 local address: LID 0000 QPN 0x5b80 PSN 0xdd83b8 RKey 0x000300 VAddr 0x00aaab08f64000
 local address: LID 0000 QPN 0x5b71 PSN 0x618f77 RKey 0x000200 VAddr 0x00aaaadacc5000
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 remote address: LID 0000 QPN 0x5b80 PSN 0xdd83b8 RKey 0x000300 VAddr 0x00aaab08f64000
 remote address: LID 0000 QPN 0x5b71 PSN 0x618f77 RKey 0x000200 VAddr 0x00aaaadacc5000
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]   MsgRate[Mpps]
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]   MsgRate[Mpps]
root:/root/$ rdma res show mr -ddd -j -p
[ {
        "ifindex": 0,
        "ifname": "hns_0",
        "mrn": 5851,
        "rkey": "200",
        "lkey": "200",
        "mrlen": 8192,
        "pdn": 5852,
        "pid": 14995,
        "comm": "ib_write_bw",{
            "drv_pbl_hop_num": 1,
            "drv_ba_pg_shift": 14,
            "drv_buf_pg_shift": 12
        }
    },{
        "ifindex": 0,
        "ifname": "hns_0",
        "mrn": 5852,
        "rkey": "300",
        "lkey": "300",
        "mrlen": 8192,
        "pdn": 5853,
        "pid": 14996,
        "comm": "ib_write_bw",{
            "drv_pbl_hop_num": 1,
            "drv_ba_pg_shift": 14,
            "drv_buf_pg_shift": 14
        }
    } ]

大页测试,大页测试时,hopnum变为0

[root@localhost ~]# echo 1000 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
[root@localhost ~]# mkdir -p /mnt/huge

[root@localhost ~]#
[root@localhost ~]# mount -t hugetlbfs nodev /mnt/huge
[root@localhost ~]#
[root@localhost ~]# cat /proc/meminfo
MemTotal:       129875076 kB
MemFree:        123508852 kB
MemAvailable:   123254328 kB
Buffers:           26080 kB
Cached:           289552 kB
SwapCached:            0 kB
Active:            84452 kB
Inactive:         307200 kB
Active(anon):       4120 kB
Inactive(anon):    83824 kB
Active(file):      80332 kB
Inactive(file):   223376 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4194300 kB
SwapFree:        4194300 kB
Dirty:                24 kB
Writeback:             0 kB
AnonPages:         76020 kB
Mapped:            52532 kB
Shmem:             11924 kB
KReclaimable:     173228 kB
Slab:             923648 kB
SReclaimable:     173228 kB
SUnreclaim:       750420 kB
KernelStack:       25152 kB
PageTables:         2208 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    68107836 kB
Committed_AS:     348420 kB
VmallocTotal:   135290159040 kB
VmallocUsed:      156600 kB
VmallocChunk:          0 kB
Percpu:           157184 kB
HardwareCorrupted:     0 kB
AnonHugePages:     10240 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:          32768 kB
CmaFree:            3344 kB
HugePages_Total:    1000
HugePages_Free:     1000
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         2048000 kB
[root@localhost ~]# ib_send_bw -d hns_0 -s 1 --use_hugepages --run_infinite &
[1] 24612
[root@localhost ~]#
************************************
* Waiting for client to connect... *
************************************

[root@localhost ~]# ib_send_bw -d hns_0 -s 1 --use_hugepages --run_infinite 192.168.100.100 &
[2] 24613
[root@localhost ~]# ---------------------------------------------------------------------------------------
                    Send BW Test
---------------------------------------------------------------------------------------
 Dual-port       : OFF          Device         : hns_0
                    Send BW Test
 Number of qps   : 1            Transport type : IB
 Dual-port       : OFF          Device         : hns_0
 Connection type : RC           Using SRQ      : OFF
 Number of qps   : 1            Transport type : IB
 RX depth        : 512
 Connection type : RC           Using SRQ      : OFF
 CQ Moderation   : 100
 TX depth        : 128
 Mtu             : 1024[B]
 CQ Moderation   : 100
 Link type       : Ethernet
 Mtu             : 1024[B]
 GID index       : 2
 Link type       : Ethernet
 Max inline data : 0[B]
 GID index       : 2
 rdma_cm QPs     : OFF
 Max inline data : 0[B]
 Data ex. method : Ethernet
 rdma_cm QPs     : OFF
---------------------------------------------------------------------------------------
 Data ex. method : Ethernet
 local address: LID 0000 QPN 0x0020 PSN 0xa737f0
---------------------------------------------------------------------------------------
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 local address: LID 0000 QPN 0x0021 PSN 0xd82fac
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 remote address: LID 0000 QPN 0x0020 PSN 0xa737f0
 remote address: LID 0000 QPN 0x0021 PSN 0xd82fac
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
 GID: 00:00:00:00:00:00:00:00:00:00:255:255:192:168:100:100
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]   MsgRate[Mpps]
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]   MsgRate[Mpps]

[root@localhost ~]#  1          20551800         0.00               3.92                   4.110358

[root@localhost ~]# rdma res show mr -ddd -j -p
[ {
        "ifindex": 14,
        "ifname": "hns_0",
        "mrn": 4,
        "rkey": "200",
        "lkey": "200",
        "mrlen": 8192,
        "pdn": 5,
        "pid": 24613,
        "comm": "ib_send_bw",{
            "drv_pbl_hop_num": 0,
            "drv_ba_pg_shift": 13,
            "drv_buf_pg_shift": 13
        }
    },{
        "ifindex": 14,
        "ifname": "hns_0",
        "mrn": 5,
        "rkey": "300",
        "lkey": "300",
        "mrlen": 8192,
        "pdn": 6,
        "pid": 24612,
        "comm": "ib_send_bw",{
            "drv_pbl_hop_num": 0,
            "drv_ba_pg_shift": 13,
            "drv_buf_pg_shift": 13
        }
    } ]

登录 后才可以发表评论

状态
负责人
项目
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
预计工期 (小时)
开始日期   -   截止日期
-
置顶选项
优先级
分支
参与者(2)
5329419 openeuler ci bot 1632792936 tcc@hello-hellotcc
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助