DPDK X710 DDP PPPoE 实践
DPDK version: 21.08
X710 firmware-version: 6.80 0x80003cc1 1.1747.0
DDP PPPoE profile version: 1.0.0.0
# lspci |grep Ethernet |grep X710
04:00.0 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 02)
04:00.1 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 02)
# ethtool -i eth4
driver: i40e
version: 2.8.20-k
firmware-version: 6.80 0x80003cc1 1.1747.0
expansion-rom-version:
bus-info: 0000:04:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
testpmd:
./dpdk-testpmd -c 0xffff --socket-mem=5120,7168 -n 2 -r 2 --no-hpet --create-uio-dev -w 0000:04:00.0 -w 0000:04:00.1 \
-- -i --rxq=8 --txq=8 --pkt-filter-mode=perfect --rss-ip --rss-udp
DDP PPPoE Profile
Intel® Ethernet Controller X710/XXV710/XL710 Adapters Dynamic Device Personalization PPPoE Package 下载 DDP PPPoE Profile 解压.
启动 testpmd 加载 DDP Profile:
port stop all
ddp add 0 /sdd/tmp/ppp-oe-ol2tpv2.pkgo,/sdd/tmp/ppp-oe-ol2tpv2.pkgo.bak
ddp get list 0
Profile number is: 1
Profile 0:
Track id: 0x80000006
Version: 1.0.0.0
Profile name: E710 PPPoE and PPPoL2TPv2
port start all
查看当前网卡 pctype -> flowtype 映射:
testpmd> show port 0 pctype mapping
pctype: 36 -> flowtype: 03
pctype: 33 -> flowtype: 04
pctype: 31 -> flowtype: 05
pctype: 34 -> flowtype: 06
pctype: 35 -> flowtype: 07
pctype: 46 -> flowtype: 09
pctype: 43 -> flowtype: 10
pctype: 41 -> flowtype: 11
pctype: 44 -> flowtype: 12
pctype: 45 -> flowtype: 13
pctype: 63 -> flowtype: 14
pctype: 15 -> flowtype: 15
查看 DDP PPPoE profile :
testpmd> ddp get info /sdd/tmp/ppp-oe-ol2tpv2.pkgo
Global Track id: 0x80000006
Global Version: 1.0.0.0
Global Package name: PPPoE and PPPoL2TPv2
i40e Profile Track id: 0x80000006
i40e Profile Version: 1.0.0.0
i40e Profile name: E710 PPPoE and PPPoL2TPv2
Package Notes:
This profile enables PPPoE and PPPoL2TPv2 parsing
L2TPv2 Tunnel ID extracted to field 46
L2TPv2/PPPoE Session ID extracted to field 47
PPP Protocol ID extracted to field 48
List of supported devices:
8086:1572 FFFF:FFFF
8086:1574 FFFF:FFFF
8086:1580 FFFF:FFFF
8086:1581 FFFF:FFFF
8086:1583 FFFF:FFFF
8086:1584 FFFF:FFFF
8086:1585 FFFF:FFFF
8086:1586 FFFF:FFFF
8086:1587 FFFF:FFFF
8086:1588 FFFF:FFFF
8086:1589 FFFF:FFFF
8086:158A FFFF:FFFF
8086:158B FFFF:FFFF
List of used protocols:
12: IPV4
13: IPV6
15: GRENAT
17: TCP
18: UDP
19: SCTP
20: ICMP
22: L2TPv2CTRL
23: ICMPV6
26: L2TPv2
27: L2TPv2PAY
28: PPPoL2TPv2
29: PPPoE
33: PAY2
34: PAY3
35: PAY4
44: IPV4FRAG
48: IPV6FRAG
52: OIPV4
53: OIPV6
List of defined packet classification types:
14: L2TPv2CTRL
15: PPPoE IPV4
16: PPPoE IPV6
17: PPPoE
18: PPPoL2TPv2 IPV4
19: PPPoL2TPv2 IPV6
20: PPPoL2TPv2
21: L2TPv2PAY
List of defined packet types:
154: PPPoE PAY2
155: PPPoE IPV4FRAG PAY3
156: PPPoE IPV4 PAY3
157: PPPoE IPV4 UDP PAY4
158: PPPoE IPV4 TCP PAY4
159: PPPoE IPV4 SCTP PAY4
160: PPPoE IPV4 ICMP PAY4
161: PPPoE IPV6FRAG PAY3
162: PPPoE IPV6 PAY3
163: PPPoE IPV6 UDP PAY4
164: PPPoE IPV6 TCP PAY4
165: PPPoE IPV6 SCTP PAY4
166: PPPoE IPV6 ICMPV6 PAY4
167: OIPV4 L2TPv2 PPPoL2TPv2 PAY3
168: OIPV4 L2TPv2 PPPoL2TPv2 IPV4F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Y3
15: OIPV6 L2TPv2 L2TPv2PAY PAY3
注意以下信息为 DDP PPPoE profile 新定义的pctype 类型, 与文档介绍一致:
List of defined packet classification types:
14: L2TPv2CTRL
15: PPPoE IPV4
16: PPPoE IPV6
17: PPPoE
18: PPPoL2TPv2 IPV4
19: PPPoL2TPv2 IPV6
20: PPPoL2TPv2
21: L2TPv2PAY

映射 pctype 15: PPPoE IPV4 到 DPDK flow type 15:
testpmd> port config 0 pctype mapping update 15 15
testpmd> port start 0
testpmd> start
testpmd> port config all rss 15
testpmd> show port 0 pctype mapping
pctype: 36 -> flowtype: 03
pctype: 33 -> flowtype: 04
pctype: 31 -> flowtype: 05
pctype: 34 -> flowtype: 06
pctype: 35 -> flowtype: 07
pctype: 46 -> flowtype: 09
pctype: 43 -> flowtype: 10
pctype: 41 -> flowtype: 11
pctype: 44 -> flowtype: 12
pctype: 45 -> flowtype: 13
pctype: 63 -> flowtype: 14
pctype: 15 -> flowtype: 15
-
port config 0 pctype mapping update 15 15调用rte_pmd_i40e_flow_type_mapping_update()映射pctype 22到 DPDKflow type 15. -
port config all rss 22对flowtype 15启用RSS.
scapy 发送测试PPPOE IPv4报文:
from scapy.all import *
pkt=Ether(dst="90:e2:ba:0a:73:0c")/PPPoE(sessionid=0x7)/PPP(proto=0x21)/IP(src="1.1.1.1",dst="2.2.2.2")/UDP(sport=4000,dport=8000)/Raw('x' * 20)
sendp(pkt, iface="enp5s0f1")
pkt=Ether(dst="90:e2:ba:0a:73:0c")/PPPoE(sessionid=0x7)/PPP(proto=0x21)/IP(src="4.4.4.1",dst="3.3.3.2")/UDP(sport=4000,dport=8000)/Raw('x' * 20)
sendp(pkt, iface="enp5s0f1")
检查 testpmd verbose 输出, 2个数据包分别到了 queue 4 和 queue 1:
testpmd> set verbose 8
testpmd> port 0/queue 4: received 1 packets
src=84:8F:69:FE:ED:E0 - dst=90:E2:BA:0A:73:0C - type=0x8864 - length=70 - nb_segs=1 - RSS hash=0x7054557c - RSS queue=0x4 - hw ptype: L2_ETHER_PPPOE L3_IPV4_EXT_UNKNOWN L4_UDP - sw ptype: L2_ETHER - l2_len=14 - Receive queue=0x4
ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
port 1/queue 4: sent 1 packets
src=84:8F:69:FE:ED:E0 - dst=90:E2:BA:0A:73:0C - type=0x8864 - length=70 - nb_segs=1 - RSS hash=0x7054557c - RSS queue=0x4 - hw ptype: L2_ETHER_PPPOE L3_IPV4_EXT_UNKNOWN L4_UDP - sw ptype: L2_ETHER - l2_len=14 - Send queue=0x4
ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
port 0/queue 1: received 1 packets
src=84:8F:69:FE:ED:E0 - dst=90:E2:BA:0A:73:0C - type=0x8864 - length=70 - nb_segs=1 - RSS hash=0x7f119e69 - RSS queue=0x1 - hw ptype: L2_ETHER_PPPOE L3_IPV4_EXT_UNKNOWN L4_UDP - sw ptype: L2_ETHER - l2_len=14 - Receive queue=0x1
ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
port 1/queue 1: sent 1 packets
src=84:8F:69:FE:ED:E0 - dst=90:E2:BA:0A:73:0C - type=0x8864 - length=70 - nb_segs=1 - RSS hash=0x7f119e69 - RSS queue=0x1 - hw ptype: L2_ETHER_PPPOE L3_IPV4_EXT_UNKNOWN L4_UDP - sw ptype: L2_ETHER - l2_len=14 - Send queue=0x1
ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
卸载 DDP PPPoE profile:
testpmd> port stop 0
testpmd> ddp del 0 /sdd/tmp/ppp-oe-ol2tpv2.pkgo.bak
testpmd> ddp get list 0
Profile number is: 0
testpmd>
其他
DDP PPPoE 最新版本为 1.1.6.1, 新定义的 pctype 更详细
testpmd> ddp get info /sdd/tmp/ppp-oe-ol2tpv2.pkg
Global Track id: 0x80000006
Global Version: 1.1.6.1
Global Package name: PPPoE and PPPoL2TPv2
i40e Profile Track id: 0x80000006
i40e Profile Version: 1.1.6.1
i40e Profile name: PPPoE and PPPoL2TPv2
Package Notes:
This profile enables PPPoE and PPPoL2TPv2 parsing
L2TPv2 Tunnel ID extracted to field 46
L2TPv2/PPPoE Session ID extracted to field 47
PPP Protocol ID extracted to field 48
List of supported devices:
8086:1572 FFFF:FFFF
8086:1574 FFFF:FFFF
8086:1580 FFFF:FFFF
8086:1581 FFFF:FFFF
8086:1583 FFFF:FFFF
8086:1584 FFFF:FFFF
8086:1585 FFFF:FFFF
8086:1586 FFFF:FFFF
8086:1587 FFFF:FFFF
8086:1588 FFFF:FFFF
8086:1589 FFFF:FFFF
8086:158A FFFF:FFFF
8086:158B FFFF:FFFF
8086:15FF FFFF:FFFF
8086:104F FFFF:FFFF
8086:104E FFFF:FFFF
List of used protocols:
12: IPV4
13: IPV6
15: GRENAT
17: TCP
18: UDP
19: SCTP
20: ICMP
21: PPPoL2TPv2
22: L2TPv2CTRL
23: ICMPV6
26: L2TPv2
29: PPPoE
33: PAY2
34: PAY3
35: PAY4
44: IPV4FRAG
48: IPFRAG
52: OIPV4
53: OIPV6
List of defined packet classification types:
0: PPPoE IPV4 UDP
1: PPPoE IPV4 TCP
2: PPPoE IPV4 SCTP
3: PPPoE IPV4
4: PPPoE IPV4 IPFRAG
5: PPPoE IPV6 UDP
6: PPPoE IPV6 TCP
7: PPPoE IPV6 SCTP
8: PPPoE IPV6
9: PPPoE IPV6 IPFRAG
10: PPPoL2TPv2 IPV4 UDP
11: PPPoL2TPv2 IPV4 TCP
12: PPPoL2TPv2 IPV4 SCTP
13: PPPoL2TPv2 IPV4
14: PPPoL2TPv2 IPV4 IPFRAG
15: PPPoL2TPv2 IPV6 UDP
16: PPPoL2TPv2 IPV6 TCP
17: PPPoL2TPv2 IPV6 SCTP
18: PPPoL2TPv2 IPV6
19: PPPoL2TPv2 IPV6 IPFRAG
20: PPPoL2TPv2
22: L2TPv2CTRL
24: PPPoE
List of defined packet types:
154: PPPoE PAY2
155: PPPoE IPV4FRAG PAY3
156: PPPoE IPV4 PAY3
157: PPPoE IPV4 UDP PAY4
158: PPPoE IPV4 TCP PAY4
159: PPPoE IPV4 SCTP PAY4
160: PPPoE IPV4 ICMP PAY4
161: PPPoE IPV6 IPFRAG PAY3
162: PPPoE IPV6 PAY3
163: PPPoE IPV6 UDP PAY4
164: PPPoE IPV6 TCP PAY4
165: PPPoE IPV6 SCTP PAY4
166: PPPoE IPV6 ICMPV6 PAY4
167: OIPV4 L2TPv2 PPPoL2TPv2 PAY3
168: OIPV4 L2TPv2 PPPoL2TPv2 IPV4FRAG PAY3
169: OIPV4 L2TPv2 PPPoL2TPv2 IPV4 PAY3
170: OIPV4 L2TPv2 PPPoL2TPv2 IPV4 UDP PAY4
171: OIPV4 L2TPv2 PPPoL2TPv2 IPV4 TCP PAY4
172: OIPV4 L2TPv2 PPPoL2TPv2 IPV4 SCTP PAY4
173: OIPV4 L2TPv2 PPPoL2TPv2 IPV4 ICMP PAY4
174: OIPV4 L2TPv2 PPPoL2TPv2 IPV6 IPFRAG PAY3
175: OIPV4 L2TPv2 PPPoL2TPv2 IPV6 PAY3
176: OIPV4 L2TPv2 PPPoL2TPv2 IPV6 UDP PAY4
177: OIPV4 L2TPv2 PPPoL2TPv2 IPV6 TCP PAY4
178: OIPV4 L2TPv2 PPPoL2TPv2 IPV6 SCTP PAY4
179: OIPV4 L2TPv2 PPPoL2TPv2 IPV6 ICMPV6 PAY4
180: OIPV6 L2TPv2 PPPoL2TPv2 PAY3
181: OIPV6 L2TPv2 PPPoL2TPv2 IPV4FRAG PAY3
182: OIPV6 L2TPv2 PPPoL2TPv2 IPV4 PAY3
183: OIPV6 L2TPv2 PPPoL2TPv2 IPV4 UDP PAY4
184: OIPV6 L2TPv2 PPPoL2TPv2 IPV4 TCP PAY4
185: OIPV6 L2TPv2 PPPoL2TPv2 IPV4 SCTP PAY4
186: OIPV6 L2TPv2 PPPoL2TPv2 IPV4 ICMP PAY4
187: OIPV6 L2TPv2 PPPoL2TPv2 IPV6 IPFRAG PAY3
188: OIPV6 L2TPv2 PPPoL2TPv2 IPV6 PAY3
189: OIPV6 L2TPv2 PPPoL2TPv2 IPV6 UDP PAY4
190: OIPV6 L2TPv2 PPPoL2TPv2 IPV6 TCP PAY4
191: OIPV6 L2TPv2 PPPoL2TPv2 IPV6 SCTP PAY4
150: OIPV6 L2TPv2 PPPoL2TPv2 IPV6 ICMPV6 PAY4
12: OIPV4 L2TPv2 L2TPv2CTRL PAY4
13: OIPV6 L2TPv2 L2TPv2CTRL PAY4
16: OIPV4 UDP L2TPv2 L2TPv2CTRL PAY4
17: OIPV6 UDP L2TPv2 L2TPv2CTRL PAY4
testpmd>
但是映射 0: PPPoE IPV4 UDP 到 DPDK flowtype 会报错, 追踪代码发现pctype 与 i40e pmd 中预定义相冲突, 有待进一步研究:
testpmd> port config 0 pctype mapping update 0,1,2,3,4,5,6,7,8 15
invalid pctype or flow type
testpmd> port config 0 pctype mapping update 1,2,3,4,5,6,7,8 15
testpmd> show port 0 pctype mapping
pctype: 36 -> flowtype: 03
pctype: 33 -> flowtype: 04
pctype: 15 -> flowtype: 05
pctype: 16 -> flowtype: 06
pctype: 17 -> flowtype: 07
pctype: 46 -> flowtype: 09
pctype: 43 -> flowtype: 10
pctype: 41 -> flowtype: 11
pctype: 44 -> flowtype: 12
pctype: 45 -> flowtype: 13
pctype: 63 -> flowtype: 14
pctype: 01,02,03,04,05,06,07,08 -> flowtype: 15
testpmd> port config all rss 15
References
Intel® Ethernet Controller 700 Series: Hash and Flow Director Filters
Intel® Ethernet Controller XL710 datasheet
Intel Ethernet 700 Series firmware 6.01
Dynamic Device Personalization for Intel® Ethernet 700 Series
Intel® Ethernet Controller X710/XXV710/XL710 Adapters Dynamic Device Personalization PPPoE Package
本文详细介绍了使用DPDK 21.08版本和X710 6.800系列固件配置Intel X710网卡的DDPPPPoE Profile,包括跟踪ID、版本管理、pctype到flowtype映射及Scapy测试。展示了如何更新映射、启用RSS和处理不同Packets类型的抓包分析。
1697

被折叠的 条评论
为什么被折叠?



