当前位置:   article > 正文

DPVS适配Mellanox-25G/100G网卡_mellanox dpdk

mellanox dpdk

安装Mlnx-Ofed

Mellanox 25G网卡

信息搜集

  • 查看固件版本, pci,驱动信息
# ethtool -i ens3f1
driver: mlx5_core
version: 5.0-1.0.0.0
firmware-version: 14.27.1016 (MT_2420110034)
expansion-rom-version:
bus-info: 0000:5e:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 查看speed
# ethtool  ens3f1
Settings for ens3f1:
    Supported ports: [ FIBRE ]
    Supported link modes:   1000baseKX/Full
                            10000baseKR/Full
                            25000baseCR/Full
                            25000baseKR/Full
                            25000baseSR/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Supported FEC modes: None BaseR RS
    Advertised link modes:  1000baseKX/Full
                            10000baseKR/Full
                            25000baseCR/Full
                            25000baseKR/Full
                            25000baseSR/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Advertised FEC modes: RS
    Speed: 25000Mb/s
    Duplex: Full
    Port: FIBRE
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000004 (4)
                   link
    Link detected: yes
    
ps: 只有接口up状态,才可以协商speed;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 查看网卡的队列大小
# ethtool -g ens5f0
Ring parameters for ens5f0:
Pre-set maximums:
RX:		8192
RX Mini:	0
RX Jumbo:	0
TX:		8192
Current hardware settings:
RX:		1024
RX Mini:	0
RX Jumbo:	0
TX:		1024
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 查看网卡的收发队列个数
# ip -d link show dev ens5f0
2: ens5f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 1016 numrxqueues 63 gso_max_size 65536 gso_max_segs 65535

# ethtool -l ens5f0
Channel parameters for ens5f0:
Pre-set maximums:
RX:		0
TX:		0
Other:		512
Combined:	63
Current hardware settings:
RX:		0
TX:		0
Other:		0
Combined:	63
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 查看网卡PN (Part number)
# lspci -vv -s "5e:00.0" | grep -i "part number" -A 3
            [PN] Part number: MCX4121A-ACAT
  • 1
  • 2

下载合适的mlx-ofed

  • 查询合适的Mlnx-ofed版本
    基于上面的网卡的固件版本,PN号来选择MLNX-OFED 驱动的版本
    在这里插入图片描述

参见:mellanox网卡固件和mlnx-ofed版本映射表

  • 查看某版本的MLNX_OFED的详细信息
    通过该文档,可以看出MLNX-OFED支持的系统,网卡,当前版本的新特性,安装,卸载,升级等等;如下所示:
    在这里插入图片描述
    在这里插入图片描述
    参见:mlnx-ofed 5.0.2.1.8.0的详细介绍

  • 下载MLNX-OFED
    确定了MLNX-OFED的版本后,再基于当前的机器的系统(centos)、平台(x86-64)等,再进行下载。
    在这里插入图片描述
    参见:指定版本的mlnx-ofed 的下载

安装MLNX-OFED

参见上面提到的MLNX-OFED的详细信息中的信息,可以得到MLNX-OFED的安装指导。
我的常用的方法入下:

1)下载mlnx-ofed 的 tar包 并解压;
(2) 安装
/opt/mlnx_ofed/mlnxofedinstall --add-kernel-support --upstream-libs --dpdk --skip-repo
(3)机器 reboot
(4) 验证
# ofed_info -s
MLNX_OFED_LINUX-5.0-2.1.8.0:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

Mellanox 100G网卡

同上

DPDK适配网卡

查看DPDK官方信息

在这里插入图片描述

  • dpdk doc文档、手册
https://www.dpdk.org/  ---> DPDK Core --->Document
  • 1

各个版本的手册:
在这里插入图片描述

  • API 手册
    介绍了当前版本的DPDK的 模块,源码(example例子的源码,各个文件分布,头文件、函数的源码等);
    在这里插入图片描述
  • guides 手册

在这里插入图片描述
如上所示, 比较重要的几个方面是:

  • Getting Started Guide for Linux
    主要是编译dpdk需要的环境,包,内核配置等等
  • Sample Applications User Guides
    介绍dpdk中自带的多个范例(sample/examples)的编译方式,如何启动,运行等;
  • Programmer’s Guide
    开发者手册,介绍dpdk的部署的环境变量,eal参数,各个组件/lib库(比如:rcu、ring、eal库,mempool, mbuf, rte_flow等等)/工具的原理、使用;
  • HowTo Guides
  • DPDK Tools User Guides
    dpdk 的辅助工具使用,比如 dpdk-pdump 抓包, dpdk-devbind 网卡绑定等;
  • Testpmd Application User Guide
    testpmd 是dpdk中很重要的一个example
  • Network Interface Controller Drivers
    网卡的特性(speed, link status, LRO, LSO, RSS, Flow control, crc/checksum offload),各个网卡驱动(虚拟设备的驱动,I40e, ixgbe , Mlx5)等等
  • Release Notes
    发布记录,每个版本的new features, bugfixes, known issues 等;
  • FAQ
    dpdk中的常见的问题;
  • dpdk支持的硬件信息
https://www.dpdk.org/  ---> DPDK Core --->
  • 1

在这里插入图片描述

  • dpdk 源码下载
    推荐方法一;
  • 方法一:
    参见:dpdk官方tar包下载
    https://www.dpdk.org/ —> DPDK Core —> Download
    在这里插入图片描述
  • 方法二:
    从github中下载;

DPDK MLX5 PMD支持的特性

在这里插入图片描述

参考:pmd MLX5 Ethernet Poll Mode Driver

DPDK不同版本对于Mellanox网卡的支持

dpdk 19.11才支持Mellanox Cx-6 Dx 100G网卡

在这里插入图片描述
在这里插入图片描述
如下所示,dpdk 18.11 还没有开始支持 Mellanox cx-6 Dx;
在这里插入图片描述

dpdk 17.11 不支持Mellanox cx4-lx 25G的fdir

Mellanox cx-4 lx 25G使用的是Mlx5的驱动,所以看看各个dpdk版本对于mlx5驱动的更新。如下所示:

  • dpdk 16.11对于mlx5的支持
    在这里插入图片描述

  • dpdk17.11 对于mlx5的支持
    在这里插入图片描述

  • dpdk18.11对于mlx5的支持
    在这里插入图片描述

其他

  • 查看当前的网卡的PCI信息
# lspci | grep Mellanox
31:00.0 Ethernet controller: Mellanox Technologies MT28841
31:00.1 Ethernet controller: Mellanox Technologies MT28841
98:00.0 Ethernet controller: Mellanox Technologies MT28841
b1:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]
b1:00.1 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 查看当前系统的MLNX OFED版本信息
# ofed_info -h
Usage: /bin/ofed_info [options]
Options:
	-s       Show package name and version number.
    -n       Show numerical version number only.
    -l       List installed packages details (Default option).

# ofed_info -s
MLNX_OFED_LINUX-5.0-2.1.8.0:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

在这里插入图片描述

参考

InfiniBand IB常用命令|历史命令记录:
https://blog.csdn.net/bandaoyu/article/details/115798693

Mellanox 官网:
https://www.dpdk.org/

(1) DPDK 中对于 Mellanox PMD 之 MLX5


https://doc.dpdk.org/guides/nics/mlx5.html
【DPDK MLX5 Ethernet Poll Mode Driver】

https://fast.dpdk.org/doc/perf/DPDK_18_11_Mellanox_NIC_performance_report.pdf
【DPDK 18.11 在 Mellanox nic 的性能测试报告:】
「学习网卡的性能测试的格式、测试哪些点,怎么测试。」

(2) Mellanox 手册/datasheet:
「没有像样的datasheet, 没有看到像intel 82599 datasheet 这么详尽的datasheet」

https://www.nvidia.com/en-us/networking/ethernet/connectx-5/
【nvidia 官网中介绍:只有product brief,介绍的太简单了】

(3) MLNX-OFED 手册:
https://docs.nvidia.com/networking/display/MLNXOFEDv551032/Introduction
https://network.nvidia.com/related-docs/prod_software/Mellanox_OFED_Linux_User_Manual_v2.4-1.0.0.pdf
【这个 mlnx-ofed 手册,还可以】
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/542017
推荐阅读
  

闽ICP备14008679号