// 1)ens255f2(pci id 0000:98:00.2)及 ens255f3(pci id 0000:98:00.3)是同一块网卡上的2个网口,已经把这两个网口用网线直连(没有经过任何交换机) [root@localhost dpdk]# dpdk-devbind --status-dev net
Network devices using kernel driver
===================================
0000:98:00.0 'I350 Gigabit Network Connection 1521' if=ens255f0 drv=igb unused=vfio-pci
0000:98:00.1 'I350 Gigabit Network Connection 1521' if=ens255f1 drv=igb unused=vfio-pci
0000:98:00.2 'I350 Gigabit Network Connection 1521' if=ens255f2 drv=igb unused=vfio-pci *Active*
0000:98:00.3 'I350 Gigabit Network Connection 1521' if=ens255f3 drv=igb unused=vfio-pci *Active*
0000:b8:00.0 'I350 Gigabit Network Connection 1521' if=ens66f0 drv=igb unused=vfio-pci *Active*
0000:b8:00.1 'I350 Gigabit Network Connection 1521' if=ens66f1 drv=igb unused=vfio-pci *Active*
// 2)把ens255f2及 ens255f3置为down并清除相关路由,再绑定到dpdk成功
[root@localhost dpdk]# ip link set dev ens255f2 down
[root@localhost dpdk]# ip link set dev ens255f3 down
[root@localhost dpdk]# ip addr flush dev ens255f2
[root@localhost dpdk]# ip addr flush dev ens255f3
[root@localhost dpdk]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
70.167.0.0 0.0.0.0 255.255.192.0 U 100 0 0 ens66f0
70.167.0.0 0.0.0.0 255.255.192.0 U 101 0 0 ens66f1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[root@localhost dpdk]# dpdk-devbind -b vfio-pci ens255f2
[root@localhost dpdk]# dpdk-devbind -b vfio-pci ens255f3
^[[A[root@localhost dpddpdk-devbind --status-dev net
Network devices using DPDK-compatible driver
============================================
0000:98:00.2 'I350 Gigabit Network Connection 1521' drv=vfio-pci unused=igb
0000:98:00.3 'I350 Gigabit Network Connection 1521' drv=vfio-pci unused=igb
Network devices using kernel driver
===================================
0000:98:00.0 'I350 Gigabit Network Connection 1521' if=ens255f0 drv=igb unused=vfio-pci
0000:98:00.1 'I350 Gigabit Network Connection 1521' if=ens255f1 drv=igb unused=vfio-pci
0000:b8:00.0 'I350 Gigabit Network Connection 1521' if=ens66f0 drv=igb unused=vfio-pci *Active*
0000:b8:00.1 'I350 Gigabit Network Connection 1521' if=ens66f1 drv=igb unused=vfio-pci *Active*
// 3)node0及node1各配置8GB大页内存(2MB大小)
[root@localhost app]# cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
4096
[root@localhost app]# cat /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
4096
// 4) 执行dpdk自带的dpdk-testpmd
[root@localhost app]# ./dpdk-testpmd -c7 -- -i --nb-cores=2 --nb-ports=2
EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized
EAL: Using IOMMU type 1 (Type 1)
Interactive-mode selected
testpmd: create a new mbuf pool <mb_pool_0>: n=163456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
testpmd: create a new mbuf pool <mb_pool_1>: n=163456, size=2176, socket=1
testpmd: preferred mempool ops selected: ring_mp_mc
Configuring Port 0 (socket 1)
Port 0: 34:73:79:03:4E:86
Configuring Port 1 (socket 1)
Port 1: 34:73:79:03:4E:87
Checking link statuses...
Done
testpmd>
Port 1: link state change event
Port 0: link state change event
testpmd> start tx_first
io packet forwarding - ports=2 - cores=2 - streams=2 - NUMA support enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 1 streams:
RX P=0/Q=0 (socket 1) -> TX P=1/Q=0 (socket 1) peer=02:00:00:00:00:01
Logical Core 2 (socket 0) forwards packets on 1 streams:
RX P=1/Q=0 (socket 1) -> TX P=0/Q=0 (socket 1) peer=02:00:00:00:00:00
io packet forwarding packets/burst=32
nb forwarding cores=2 - nb forwarding ports=2
port 0: RX queue number: 1 Tx queue number: 1
Rx offloads=0x0 Tx offloads=0x0
RX queue: 0
RX desc=512 - RX free threshold=32
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=512 - TX free threshold=0
TX threshold registers: pthresh=8 hthresh=1 wthresh=16
TX offloads=0x0 - TX RS bit threshold=0
port 1: RX queue number: 1 Tx queue number: 1
Rx offloads=0x0 Tx offloads=0x0
RX queue: 0
RX desc=512 - RX free threshold=32
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=512 - TX free threshold=0
TX threshold registers: pthresh=8 hthresh=1 wthresh=16
TX offloads=0x0 - TX RS bit threshold=0
testpmd> show port info all
********************* Infos for port 0 *********************
MAC address: 34:73:79:03:4E:86
Device name: 0000:98:00.2
Driver name: net_e1000_igb
Firmware-version: 1.63, 0x800009fa
Connect to socket: 1
memory allocation on the socket: 1
Link status: up
Link speed: 1 Gbps
Link duplex: full-duplex
Autoneg status: On
MTU: 1500
Promiscuous mode: enabled
Allmulticast mode: disabled
Maximum number of MAC addresses: 32
Maximum number of MAC addresses of hash filtering: 0
VLAN offload:
strip off, filter off, extend off, qinq strip off
Hash key size in bytes: 40
Redirection table size: 128
Supported RSS offload flow types:
ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp ipv6-udp ipv6-ex
ipv6-tcp-ex ipv6-udp-ex
Minimum size of RX buffer: 256
Maximum configurable length of RX packet: 16383
Maximum configurable size of LRO aggregated packet: 0
Maximum number of VMDq pools: 8
Current number of RX queues: 1
Max possible RX queues: 8
Max possible number of RXDs per queue: 4096
Min possible number of RXDs per queue: 32
RXDs number alignment: 8
Current number of TX queues: 1
Max possible TX queues: 8
Max possible number of TXDs per queue: 4096
Min possible number of TXDs per queue: 32
TXDs number alignment: 8
Max segment number per packet: 255
Max segment number per MTU/TSO: 255
Device capabilities: 0x0( )
Device error handling mode: none
Device private info:
none
********************* Infos for port 1 *********************
MAC address: 34:73:79:03:4E:87
Device name: 0000:98:00.3
Driver name: net_e1000_igb
Firmware-version: 1.63, 0x800009fa
Connect to socket: 1
memory allocation on the socket: 1
Link status: up
Link speed: 1 Gbps
Link duplex: full-duplex
Autoneg status: On
MTU: 1500
Promiscuous mode: enabled
Allmulticast mode: disabled
Maximum number of MAC addresses: 32
Maximum number of MAC addresses of hash filtering: 0
VLAN offload:
strip off, filter off, extend off, qinq strip off
Hash key size in bytes: 40
Redirection table size: 128
Supported RSS offload flow types:
ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp ipv6-udp ipv6-ex
ipv6-tcp-ex ipv6-udp-ex
Minimum size of RX buffer: 256
Maximum configurable length of RX packet: 16383
Maximum configurable size of LRO aggregated packet: 0
Maximum number of VMDq pools: 8
Current number of RX queues: 1
Max possible RX queues: 8
Max possible number of RXDs per queue: 4096
Min possible number of RXDs per queue: 32
RXDs number alignment: 8
Current number of TX queues: 1
Max possible TX queues: 8
Max possible number of TXDs per queue: 4096
Min possible number of TXDs per queue: 32
TXDs number alignment: 8
Max segment number per packet: 255
Max segment number per MTU/TSO: 255
Device capabilities: 0x0( )
Device error handling mode: none
Device private info:
none
// 5) 报文收发速度极低
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 569866 RX-missed: 0 RX-bytes: 36994590
RX-errors: 0
RX-nombuf: 0
TX-packets: 575843 TX-errors: 0 TX-bytes: 37372327
Throughput (since last show)
Rx-pps: 0 Rx-bps: 0
Tx-pps: 0 Tx-bps: 0
############################################################################
######################## NIC statistics for port 1 ########################
RX-packets: 576209 RX-missed: 0 RX-bytes: 37408037
RX-errors: 0
RX-nombuf: 0
TX-packets: 569490 TX-errors: 0 TX-bytes: 36957782
Throughput (since last show)
Rx-pps: 0 Rx-bps: 0
Tx-pps: 0 Tx-bps: 0
############################################################################
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 571384 RX-missed: 0 RX-bytes: 37314593
RX-errors: 0
RX-nombuf: 0
TX-packets: 575860 TX-errors: 0 TX-bytes: 37376083
Throughput (since last show)
Rx-pps: 9 Rx-bps: 16640
Tx-pps: 0 Tx-bps: 192
############################################################################
######################## NIC statistics for port 1 ########################
RX-packets: 576226 RX-missed: 0 RX-bytes: 37411793
RX-errors: 0
RX-nombuf: 0
TX-packets: 571008 TX-errors: 0 TX-bytes: 37277785
Throughput (since last show)
Rx-pps: 0 Rx-bps: 192
Tx-pps: 9 Tx-bps: 16640
############################################################################
[root@localhost dpdk]# dpdk-devbind --status-dev net
Network devices using kernel driver
===================================
0000:98:00.0 'I350 Gigabit Network Connection 1521' if=ens255f0 drv=igb unused=vfio-pci
0000:98:00.1 'I350 Gigabit Network Connection 1521' if=ens255f1 drv=igb unused=vfio-pci
0000:98:00.2 'I350 Gigabit Network Connection 1521' if=ens255f2 drv=igb unused=vfio-pci *Active*
0000:98:00.3 'I350 Gigabit Network Connection 1521' if=ens255f3 drv=igb unused=vfio-pci *Active*
0000:b8:00.0 'I350 Gigabit Network Connection 1521' if=ens66f0 drv=igb unused=vfio-pci *Active*
0000:b8:00.1 'I350 Gigabit Network Connection 1521' if=ens66f1 drv=igb unused=vfio-pci *Active*
// 2)把ens255f2及 ens255f3置为down并清除相关路由,再绑定到dpdk成功
[root@localhost dpdk]# ip link set dev ens255f2 down
[root@localhost dpdk]# ip link set dev ens255f3 down
[root@localhost dpdk]# ip addr flush dev ens255f2
[root@localhost dpdk]# ip addr flush dev ens255f3
[root@localhost dpdk]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
70.167.0.0 0.0.0.0 255.255.192.0 U 100 0 0 ens66f0
70.167.0.0 0.0.0.0 255.255.192.0 U 101 0 0 ens66f1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[root@localhost dpdk]# dpdk-devbind -b vfio-pci ens255f2
[root@localhost dpdk]# dpdk-devbind -b vfio-pci ens255f3
^[[A[root@localhost dpddpdk-devbind --status-dev net
Network devices using DPDK-compatible driver
============================================
0000:98:00.2 'I350 Gigabit Network Connection 1521' drv=vfio-pci unused=igb
0000:98:00.3 'I350 Gigabit Network Connection 1521' drv=vfio-pci unused=igb
Network devices using kernel driver
===================================
0000:98:00.0 'I350 Gigabit Network Connection 1521' if=ens255f0 drv=igb unused=vfio-pci
0000:98:00.1 'I350 Gigabit Network Connection 1521' if=ens255f1 drv=igb unused=vfio-pci
0000:b8:00.0 'I350 Gigabit Network Connection 1521' if=ens66f0 drv=igb unused=vfio-pci *Active*
0000:b8:00.1 'I350 Gigabit Network Connection 1521' if=ens66f1 drv=igb unused=vfio-pci *Active*
// 3)node0及node1各配置8GB大页内存(2MB大小)
[root@localhost app]# cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
4096
[root@localhost app]# cat /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
4096
// 4) 执行dpdk自带的dpdk-testpmd
[root@localhost app]# ./dpdk-testpmd -c7 -- -i --nb-cores=2 --nb-ports=2
EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized
EAL: Using IOMMU type 1 (Type 1)
Interactive-mode selected
testpmd: create a new mbuf pool <mb_pool_0>: n=163456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
testpmd: create a new mbuf pool <mb_pool_1>: n=163456, size=2176, socket=1
testpmd: preferred mempool ops selected: ring_mp_mc
Configuring Port 0 (socket 1)
Port 0: 34:73:79:03:4E:86
Configuring Port 1 (socket 1)
Port 1: 34:73:79:03:4E:87
Checking link statuses...
Done
testpmd>
Port 1: link state change event
Port 0: link state change event
testpmd> start tx_first
io packet forwarding - ports=2 - cores=2 - streams=2 - NUMA support enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 1 streams:
RX P=0/Q=0 (socket 1) -> TX P=1/Q=0 (socket 1) peer=02:00:00:00:00:01
Logical Core 2 (socket 0) forwards packets on 1 streams:
RX P=1/Q=0 (socket 1) -> TX P=0/Q=0 (socket 1) peer=02:00:00:00:00:00
io packet forwarding packets/burst=32
nb forwarding cores=2 - nb forwarding ports=2
port 0: RX queue number: 1 Tx queue number: 1
Rx offloads=0x0 Tx offloads=0x0
RX queue: 0
RX desc=512 - RX free threshold=32
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=512 - TX free threshold=0
TX threshold registers: pthresh=8 hthresh=1 wthresh=16
TX offloads=0x0 - TX RS bit threshold=0
port 1: RX queue number: 1 Tx queue number: 1
Rx offloads=0x0 Tx offloads=0x0
RX queue: 0
RX desc=512 - RX free threshold=32
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
RX Offloads=0x0
TX queue: 0
TX desc=512 - TX free threshold=0
TX threshold registers: pthresh=8 hthresh=1 wthresh=16
TX offloads=0x0 - TX RS bit threshold=0
testpmd> show port info all
********************* Infos for port 0 *********************
MAC address: 34:73:79:03:4E:86
Device name: 0000:98:00.2
Driver name: net_e1000_igb
Firmware-version: 1.63, 0x800009fa
Connect to socket: 1
memory allocation on the socket: 1
Link status: up
Link speed: 1 Gbps
Link duplex: full-duplex
Autoneg status: On
MTU: 1500
Promiscuous mode: enabled
Allmulticast mode: disabled
Maximum number of MAC addresses: 32
Maximum number of MAC addresses of hash filtering: 0
VLAN offload:
strip off, filter off, extend off, qinq strip off
Hash key size in bytes: 40
Redirection table size: 128
Supported RSS offload flow types:
ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp ipv6-udp ipv6-ex
ipv6-tcp-ex ipv6-udp-ex
Minimum size of RX buffer: 256
Maximum configurable length of RX packet: 16383
Maximum configurable size of LRO aggregated packet: 0
Maximum number of VMDq pools: 8
Current number of RX queues: 1
Max possible RX queues: 8
Max possible number of RXDs per queue: 4096
Min possible number of RXDs per queue: 32
RXDs number alignment: 8
Current number of TX queues: 1
Max possible TX queues: 8
Max possible number of TXDs per queue: 4096
Min possible number of TXDs per queue: 32
TXDs number alignment: 8
Max segment number per packet: 255
Max segment number per MTU/TSO: 255
Device capabilities: 0x0( )
Device error handling mode: none
Device private info:
none
********************* Infos for port 1 *********************
MAC address: 34:73:79:03:4E:87
Device name: 0000:98:00.3
Driver name: net_e1000_igb
Firmware-version: 1.63, 0x800009fa
Connect to socket: 1
memory allocation on the socket: 1
Link status: up
Link speed: 1 Gbps
Link duplex: full-duplex
Autoneg status: On
MTU: 1500
Promiscuous mode: enabled
Allmulticast mode: disabled
Maximum number of MAC addresses: 32
Maximum number of MAC addresses of hash filtering: 0
VLAN offload:
strip off, filter off, extend off, qinq strip off
Hash key size in bytes: 40
Redirection table size: 128
Supported RSS offload flow types:
ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp ipv6-udp ipv6-ex
ipv6-tcp-ex ipv6-udp-ex
Minimum size of RX buffer: 256
Maximum configurable length of RX packet: 16383
Maximum configurable size of LRO aggregated packet: 0
Maximum number of VMDq pools: 8
Current number of RX queues: 1
Max possible RX queues: 8
Max possible number of RXDs per queue: 4096
Min possible number of RXDs per queue: 32
RXDs number alignment: 8
Current number of TX queues: 1
Max possible TX queues: 8
Max possible number of TXDs per queue: 4096
Min possible number of TXDs per queue: 32
TXDs number alignment: 8
Max segment number per packet: 255
Max segment number per MTU/TSO: 255
Device capabilities: 0x0( )
Device error handling mode: none
Device private info:
none
// 5) 报文收发速度极低
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 569866 RX-missed: 0 RX-bytes: 36994590
RX-errors: 0
RX-nombuf: 0
TX-packets: 575843 TX-errors: 0 TX-bytes: 37372327
Throughput (since last show)
Rx-pps: 0 Rx-bps: 0
Tx-pps: 0 Tx-bps: 0
############################################################################
######################## NIC statistics for port 1 ########################
RX-packets: 576209 RX-missed: 0 RX-bytes: 37408037
RX-errors: 0
RX-nombuf: 0
TX-packets: 569490 TX-errors: 0 TX-bytes: 36957782
Throughput (since last show)
Rx-pps: 0 Rx-bps: 0
Tx-pps: 0 Tx-bps: 0
############################################################################
testpmd> show port stats all
######################## NIC statistics for port 0 ########################
RX-packets: 571384 RX-missed: 0 RX-bytes: 37314593
RX-errors: 0
RX-nombuf: 0
TX-packets: 575860 TX-errors: 0 TX-bytes: 37376083
Throughput (since last show)
Rx-pps: 9 Rx-bps: 16640
Tx-pps: 0 Tx-bps: 192
############################################################################
######################## NIC statistics for port 1 ########################
RX-packets: 576226 RX-missed: 0 RX-bytes: 37411793
RX-errors: 0
RX-nombuf: 0
TX-packets: 571008 TX-errors: 0 TX-bytes: 37277785
Throughput (since last show)
Rx-pps: 0 Rx-bps: 192
Tx-pps: 9 Tx-bps: 16640
############################################################################