Bug 930 - ConnectX6 DPDK dpdk-testpmd Receive tcp ,udp Mixed flow performance is very low!
Summary: ConnectX6 DPDK dpdk-testpmd Receive tcp ,udp Mixed flow performance is very low!
Status: CONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: ethdev (show other bugs)
Version: 21.11
Hardware: x86 Linux
: High normal
Target Milestone: ---
Assignee: Asaf Penso
URL:
Depends on:
Blocks:
 
Reported: 2022-01-28 06:47 CET by killers
Modified: 2023-10-21 15:06 CEST (History)
3 users (show)



Attachments

Description killers 2022-01-28 06:47:54 CET
I use Ixia to construct two streams
Total 20Gbps  29760000 pps

flow1 udp 64size small packet
Send per second 10G bps 14880000 pps 

flow2 tcp 64size small packet 
Send per second 10G bps 14880000 pps



./dpdk-testpmd -l 4-22 -n 8 -- -i --rxq 19 --txq 19 --nb-cores 18 --rxd 2048 --txd 2048 --portmask 0xff

set fwd rxonly
start
show port stats all

testpmd> show port stats all

  ######################## NIC statistics for port 0  ########################
  RX-packets: 103906391  RX-missed: 369790696  RX-bytes:  6234383466
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0

  Throughput (since last show)
  Rx-pps:      4205026          Rx-bps:   2018412608
  Tx-pps:            0          Tx-bps:            0
  ############################################################################

Recive per second 
2018412608  bps   2g bps
4205026      pps  4 million pps

rx_discards_phy drop per second 10 million pps

[root@localhost ~]# ethtool -S enp202s0f0 |grep dis
     rx_discards_phy: 35892329864
     tx_discards_phy: 0
     rx_prio0_discards: 35892164419
     rx_prio1_discards: 0
     rx_prio2_discards: 0
     rx_prio3_discards: 0
     rx_prio4_discards: 0
     rx_prio5_discards: 0
     rx_prio6_discards: 0
     rx_prio7_discards: 0


If both flow become TCP, rx_discards_phy will not be drop.
flow1 tcp 64size small packet
flow2 tcp 64size small packet


testpmd> show port stats all

  ######################## NIC statistics for port 0  ########################
  RX-packets: 7177423122 RX-missed: 369790696  RX-bytes:  430645390083
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0

  Throughput (since last show)
  Rx-pps:     29779180          Rx-bps:  14294006816
  Tx-pps:            0          Tx-bps:            0
  ############################################################################
29779180         pps  29 million pps  

rx_discards_phy no drop

[root@localhost ~]# ethtool -S enp202s0f0 |grep dis
     rx_discards_phy: 0
     tx_discards_phy: 0
     rx_prio0_discards: 0
     rx_prio1_discards: 0
     rx_prio2_discards: 0
     rx_prio3_discards: 0
     rx_prio4_discards: 0
     rx_prio5_discards: 0
     rx_prio6_discards: 0
     rx_prio7_discards: 0


server 
dell poweredge r750
[root@localhost proc]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                64
On-line CPU(s) list:   0-63
Thread(s) per core:    1
Core(s) per socket:    32
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 106
Model name:            Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
Stepping:              6
CPU MHz:               2900.000
BogoMIPS:              5800.00
Virtualization:        VT-x
L1d cache:             48K
L1i cache:             32K
L2 cache:              1280K
L3 cache:              55296K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 invpcid_single intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq md_clear pconfig spec_ctrl intel_stibp flush_l1d arch_capabilities





MLX ConnectX6  100G PCIE4 x16

[root@localhost ~]# ofed_info -s
MLNX_OFED_LINUX-5.5-1.0.3.2:

[root@localhost ~]# mlxfwmanager
Querying Mellanox devices firmware ...

Device #1:
----------

  Device Type:      ConnectX6
  Part Number:      MCX653106A-ECA_Ax
  Description:      ConnectX-6 VPI adapter card; H100Gb/s (HDR100; EDR IB and 100GbE); dual-port QSFP56; PCIe3.0 x16; tall bracket; ROHS R6
  PSID:             MT_0000000224
  PCI Device Name:  0000:ca:00.0
  Base MAC:         08c0eb204e5a
  Versions:         Current        Available     
     FW             20.32.1010     20.32.1010    
     PXE            3.6.0502       3.6.0502      
     UEFI           14.25.0017     14.25.0017    

  Status:           Up to date
Comment 1 Asaf Penso 2022-02-03 09:56:06 CET
Hello,

To get the best results for mixed traffic, you need to set the correct value for the CQE compress devarg.
See the following documentation snippet (I suggest reading it fully in 36.5.3.2. Driver options:

rxq_cqe_comp_en parameter [int]
Specifying 4 as a rxq_cqe_comp_en value selects L3/L4 Header format for better compression rate in case of mixed TCP/UDP and IPv4/IPv6 traffic. CQE compression format selection requires DevX to be enabled.

Please let us know the result.
Comment 2 killers 2022-03-03 16:04:06 CET
Hello,
use rxq_cqe_comp_en=4 performance will be better.


Now there is a new problem!
3rd Gen Intel® Xeon® Scalable Processors 
Receive error len error checksum UDP tcp packet performance is very low!

The test environment is the same as above,

use Ixia to construct two streams
Total 20Gbps  29760000 pps

flow1 tcp 64size small packet 
incorrect tcp checksum 
Send per second 10G bps 14880000 pps 

flow2 tcp 64size small packet
correct tcp checksum 
Send per second 10G bps 14880000 pps
./dpdk-testpmd -l 4-22 -n 8 -- -i --rxq 19 --txq 19 --nb-cores 18 --rxd 2048 --txd 2048 --portmask 0xff

set fwd rxonly
start

Rx-pps:   5134559     

rx_discards_phy drop ninety percent per second !



This problem only appears on 3rd Gen Intel® Xeon® Scalable Processors platform
Comment 3 Asaf Penso 2022-03-07 19:08:50 CET
Can you please elaborate on the motivation for such a test?
Why would you like to measure bad checksum traffic performance?
Comment 4 killers 2022-03-10 04:57:27 CET
The attacker will send attack traffic, which may be various wrong packets.
Comment 5 Asaf Penso 2022-03-13 12:05:04 CET
Can you please try to change the rx burst function? Currently, it uses vectorized. Can you add devarg of mprq_en=1 and check the result?

Another option to handle this, is to add an rte_flow rule that match on csum integrity bit and does drop action. More info can be found in http://doc.dpdk.org/guides/nics/mlx5.html
Comment 6 killers 2022-03-16 06:52:54 CET
After using the mprq=1 parameter, the problem remains the same.

tcp ,udp Mixed flow 
tcp(header checksum incorrect) ,tcp or udp(header checksum correct) Mixed flow
udp(header checksum incorrect) ,tcp or udp(header checksum correct) Mixed flow
tcp(header length incorrect) ,tcp or udp(header length correct) Mixed flow
....

Many of these combinations performance is very low. 
rx_discards_PHY massive packet drop.
What is the reason behind it?

Is it because netcard and CPU core operate CQE at the same time?

Is there any way to solve it, such as adjusting what parameters?
Comment 7 killers 2022-03-16 06:55:15 CET
Can you please try to change the rx burst function? 

I don't understand. 
Is it for me to modify the code of the rte_eth_rx_burst ?
Comment 8 Asaf Penso 2022-04-11 11:57:04 CEST
I can see two options to handle this case:
1. Add an rte_flow rule that match on csum integrity bit and does drop action. More info can be found in http://doc.dpdk.org/guides/nics/mlx5.html
2. Disable checksum validation altogether in case an application doesn’t care about checksums.
Comment 9 killers 2022-04-14 15:10:59 CEST
(In reply to Asaf Penso from comment #8)
> I can see two options to handle this case:
> 1. Add an rte_flow rule that match on csum integrity bit and does drop
> action. More info can be found in http://doc.dpdk.org/guides/nics/mlx5.html
> 2. Disable checksum validation altogether in case an application doesn’t
> care about checksums.


I tried all the methods, but they didn't take effect in dpdk Disable checksum.
The network card still calculates the checksum
Comment 10 Asaf Penso 2022-05-17 10:43:53 CEST
Hi,

We have continued to look into this issue, and would like to know the following results:
1. mixed traffic TCP/UDP without cqe compression (need to set devarg rxq_cqe_comp_en=0)
2. mixed traffic TCP/UDP with cqe compression
3. mixed traffic TCP/UDP with cqe compression and csum errors
Comment 11 Toby 2022-07-15 18:11:04 CEST
Hi @Asaf,

we are observing the same issue despite rxq_cqe_comp_en=4 .
On a 100Gbps load we still drop at least 40% packets as xstats rx_phy_discard_packets

See bug report https://bugs.dpdk.org/show_bug.cgi?id=1053
Comment 12 Asaf Penso 2022-08-28 22:49:00 CEST
Hello,
Can you please provide the 3 results mentioned in comment #10?
Comment 13 killers 2023-10-21 15:06:05 CEST
Hi @Asaf

It's been a year, are there new network card hardware or new (OFED/FW) solutions to the bad csum performance issue?

Note You need to log in before you can comment on or make changes to this bug.