Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DPDK SWX based P4 backend stratum-dpdk #866

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pudelkoM
Copy link
Member

@pudelkoM pudelkoM commented Dec 12, 2021

Compile DPDK

./stratum/hal/lib/dpdk/build-dpdk-install-docker.sh
tar xf dpdk-install.tar.xz
set -Ux DPDK_INSTALL (realpath ./dpdk-install)

Running SWX pipeline from DPDK example code

bazel build //stratum/hal/bin/dpdk:stratum_dpdk_deb
sudo apt-get install --reinstall ./stratum_dpdk_deb.deb
sudo start-stratum.sh

Logs:

EAL: Detected CPU lcores: 96
EAL: Detected NUMA nodes: 2
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available 1048576 kB hugepages reported
EAL: VFIO support initialized
EAL: Probe PCI driver: net_i40e (8086:1583) device: 0000:3b:00.0 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1583) device: 0000:3b:00.1 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1583) device: 0000:5e:00.0 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1583) device: 0000:5e:00.1 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1583) device: 0000:af:00.0 (socket 1)
EAL: Probe PCI driver: net_i40e (8086:1583) device: 0000:af:00.1 (socket 1)
TELEMETRY: No legacy callbacks, legacy socket not created
; SPDX-License-Identifier: BSD-3-Clause
; Copyright(c) 2020 Intel Corporation

mempool MEMPOOL0 buffer 2304 pool 32K cache 256 cpu 0

link LINK0 dev 0000:af:00.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on
link LINK1 dev 0000:af:00.1 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on
link LINK2 dev 0000:5e:00.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on
link LINK3 dev 0000:5e:00.1 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on

pipeline PIPELINE0 create 0

pipeline PIPELINE0 port in 0 link LINK0 rxq 0 bsz 32
pipeline PIPELINE0 port in 1 link LINK1 rxq 0 bsz 32
pipeline PIPELINE0 port in 2 link LINK2 rxq 0 bsz 32
pipeline PIPELINE0 port in 3 link LINK3 rxq 0 bsz 32

pipeline PIPELINE0 port out 0 link LINK0 txq 0 bsz 32
pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32
pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32
pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32

pipeline PIPELINE0 build ./stratum/hal/lib/dpdk/l2fwd.spec

thread 1 pipeline PIPELINE0 enable

CLI:

nc 0.0.0.0 8086

pipeline> link show

LINK0: flags=<UP> mtu 8982
	ether AC:1F:6B:FD:83:5E rxqueues 1 txqueues 1
	port# 4  speed 40 Gbps
	RX packets 2  bytes 180
	RX errors 0  missed 0  no-mbuf 0
	TX packets 0  bytes 0
	TX errors 0

LINK1: flags=<UP> mtu 8982
	ether AC:1F:6B:FD:83:5F rxqueues 1 txqueues 1
	port# 5  speed 40 Gbps
	RX packets 2  bytes 180
	RX errors 0  missed 0  no-mbuf 0
	TX packets 0  bytes 0
	TX errors 0

LINK2: flags=<DOWN> mtu 8982
	ether 40:A6:B7:28:B6:00 rxqueues 1 txqueues 1
	port# 2  speed None
	RX packets 0  bytes 0
	RX errors 0  missed 0  no-mbuf 0
	TX packets 0  bytes 0
	TX errors 0

LINK3: flags=<DOWN> mtu 8982
	ether 40:A6:B7:28:B6:01 rxqueues 1 txqueues 1
	port# 3  speed None
	RX packets 0  bytes 0
	RX errors 0  missed 0  no-mbuf 0
	TX packets 0  bytes 0
	TX errors 0

pipeline> pipeline PIPELINE0 stats
Input ports:
	Port 0: packets 2 bytes 180 empty 281162596
	Port 1: packets 2 bytes 180 empty 281162631
	Port 2: packets 0 bytes 0 empty 281162640
	Port 3: packets 0 bytes 0 empty 281162644

Hello world

./stratum/hal/lib/dpdk/build-dpdk-install-docker.sh
tar xf dpdk-install.tar.xz
export $DPDK_INSTALL=...
bazel build //stratum/hal/lib/dpdk:dpdk_hello
<huge pages setup>
sudo ./bazel-bin/stratum/hal/lib/dpdk/dpdk_hello

EAL: Detected CPU lcores: 96
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: No available 1048576 kB hugepages reported
EAL: VFIO support initialized
TELEMETRY: No legacy callbacks, legacy socket not created
hello from core 1
hello from core 2
hello from core 3
hello from core 4
hello from core 5
hello from core 6
hello from core 7
hello from core 8
hello from core 9
hello from core 10
hello from core 11
hello from core 12
hello from core 13
hello from core 14
hello from core 15
hello from core 16
hello from core 17
hello from core 18
hello from core 19
hello from core 20
hello from core 21
hello from core 22
hello from core 23
hello from core 24
hello from core 25
hello from core 26
hello from core 27
hello from core 28
hello from core 29
hello from core 30
hello from core 31
hello from core 32
hello from core 33
hello from core 34
hello from core 35
hello from core 36
hello from core 37
hello from core 38
hello from core 39
hello from core 40
hello from core 41
hello from core 42
hello from core 43
hello from core 44
hello from core 45
hello from core 46
hello from core 47
hello from core 48
hello from core 49
hello from core 50
hello from core 51
hello from core 52
hello from core 53
hello from core 54
hello from core 55
hello from core 56
hello from core 57
hello from core 58
hello from core 59
hello from core 60
hello from core 61
hello from core 62
hello from core 63
hello from core 64
hello from core 65
hello from core 66
hello from core 67
hello from core 68
hello from core 69
hello from core 70
hello from core 71
hello from core 72
hello from core 73
hello from core 74
hello from core 75
hello from core 76
hello from core 77
hello from core 78
hello from core 79
hello from core 80
hello from core 81
hello from core 82
hello from core 83
hello from core 84
hello from core 85
hello from core 86
hello from core 87
hello from core 92
hello from core 88
hello from core 89
hello from core 94
hello from core 91
hello from core 93
hello from core 90
hello from core 95
hello from core 0

@codecov
Copy link

codecov bot commented Dec 12, 2021

Codecov Report

Merging #866 (b88ffe6) into main (b1b7836) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #866   +/-   ##
=======================================
  Coverage   78.55%   78.55%           
=======================================
  Files         334      334           
  Lines       30077    30077           
=======================================
  Hits        23628    23628           
  Misses       6449     6449           

@pudelkoM pudelkoM changed the title WIP DPDK backend Add DPDK SWX based P4 backend stratum-dpdk Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant