SlideShare uma empresa Scribd logo
1 de 17
Debug & Troubleshooting
bottlenecks & pain Points
Sep 2018
Vipin Varghese
Breakup
• To debug an application, isolate it to run on
 Linux 64|32 bit environment
 user space only
 Uses DPDK PMD and libraries
 Data captures for both static and shared libraries runs.
 use gcc & gnu debug options too.
Sample Packet Life (RX  Classifier + Load balance 
worker cores  crypto (optional)  traffic manager  TX)
RX
TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
meta
data
Tx
meta
data
payload
Mempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … nLcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7
Lcore 8
Lcore 0 Lcore 9
1. Is ‘received PKT rate < send PKT rate’?
are generic configuration correct?
 What is port Speed, Duplex – rte_eth_link_get()
 Is packet of higher sizes are dropped? - rte_eth_get_mtu()
 Are only specific MAC are received? - rte_eth_promiscuous_get()
are there NIC specific drops?
 Check rte_eth_rx_queue_info_get() for nb_desc, scattered_rx,
 Check rte_eth_dev_stats() for Stats per queue
 Is stats of other queues shows no change - rte_eth_dev_dev_rss_hash_conf_get()
If problem still persists, this might be at RX lcore thread not pulling the traffic
 Check if RX thread, distributor or event rx adapater is holding or processing more than required
 try using rte_prefetch_non_temporal() to intimate the mbuf in pulled to cache for temporary
RX TX
Ste_mbuf payload
truct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf Rx meta
data
Tx meta
data
payloadMempool of MBUF
Worker - 1
Worker - 1
Worker - 1Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n
NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7 Lcore 8
Lcore 0
Lcore 9
2. Are there packet drops?
at RX
 Get the rx queues by rte_eth_dev_info_get() for nb_rx_queues
 Check for miss, errors, qerros by rte_eth_dev_stats() for imissed, ierrors, q_erros, rx_nombuf, rte_mbuf_ref_count
at TX
 Are we doing in bulk to reduce the TX descriptor overhead?
 Check rte_eth_dev_stats() oerrors, q_erros, rte_mbuf_ref_count
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
meta
data
Tx
meta
data payload
Mempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n
NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7
Lcore 8
Lcore 0 Lcore 9
3. Drops at producer ring?
Performance for Producer
 Fetch the type of RING – rte_ring_dump() for ‘flags (RING_F_SP_ENQ)’
 If ‘burst enqueue - actual enqueue > 0’ – check rte_ring_count() or rte_ring_free_count()
 If ‘burst or single‘ enqueue results 0, then there is no more space – check rte_ring_full() or not
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
met
a
dat
a
Tx
met
a
dat
a
payloadMempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7
Lcore 8
Lcore 0 Lcore 9
4. Drops at consumer ring?
Performance for Producer
1. Fetch the type of RING – rte_ring_dump() for ‘flags (RING_F_SC_DEQ)’
2. If ‘burst dequeue - actual dequeue > 0’ – rte_ring_free_count()
3. If ‘burst or single’ enqueue always results 0 – check the ring is empty via rte_ring_empty()
RX
TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
met
a
data
Tx
met
a
data payload
Mempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7
Lcore 8
Lcore 0
Lcore 9
5. Are we still not getting packets or objects
at desired rate? Are packets received from multiple NIC? -rte_eth_dev_count_all()
 Are NIC interfaces on different socket? – use rte_eth_dev_socket_id()
 Is mempool created with right socket? - rte_mempool_create() or rte_pktmbuf_pool_create()
 Are we seeing drop on specific socket? – It might require more mempool objects; try allocating more objects
 Is there single RX thread for multiple NIC? – try having
 multiple lcore to read from fixed interface
 we might hitting cache limit. Increase cache_size for pool_create()
 If we are still seeing low performance
 Check if we sufficient objects – rte_mempool_avail_count()
 Failure in some pkt – we might be getting pkts > mbuf data size. Check rte_pktmbuf_is_continguous()
 If user pthread is used to access object access – rte_mempool_cache_create()
 Try using 1GB huge pages instead of 2MB – if yes, try rte_mem_lock_page() for 2MB pages
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
met
a
data
Tx
met
a
data
payloadMempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n
NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7 Lcore 8
Lcore 0 Lcore 9
Stall in release of MBUF can be because
 Processing pipeline is too heavy
 Number of stages are too many
 TX is not transferred at desired rate
 Application missue scenarios
a. not freeing packets
b. Rte_pktmbuf_refcnt_set
c. Rte_pktmbuf_prefree_seg
6. Performance issues in crypto lookaside?
are generic configuration correct?
 Get total crypto devices – rte_cryptodev_count()
 Cross check SW or HW flags are configured properly – rte_cryptodev_info_get() for feature_flags
If enqueue request > actual enqueue (drops)?
 Is the queue pair setup for proper node – rte_cryptodev_queue_pair_setup() for
socket_id
 Is the session_pool created from same socket_id as queue pair?
 Is enqueue thread same socket_id?
 rte_cryptodev_stats() for drops err_count for enqueue or dequeue
 Are there multiple threads enqueue or dequeue from same queue pair?
If enqueue rate > dequeue rate?
 Is dequeue lcore thread is same socket_id?
 If we using SW crypto
 Is the CRYPTO Library build with right flags?
 Is the queue pair using CPU ISA - rte_cryptodev_info_get() for
feature_flags for AVX|SSE
 If we are using HW crypto – Is the card on same numa socket as queue pair
and session pool?
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
meta
data
Tx meta
data payloadMempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7 Lcore 8
Lcore 0 Lcore 9
Single process debug
7. What all to check in a Process for
Bottlenecks?
Debug
 Mode of operation - rte_eal_get_configuration() (master, lcore|service|numa count, process_type)
 Check lcore run mode - rte_eal_lcore_role() (rte, off, service)
 process details- rte_dump_stack(), rte_dump_registers(), rte_memdump()
Performance
 Threads context switches more - Identify lcore with rte_lcore() and lcore index mapping with rte_lcore_index()
 Check lcore role type - rte_eal_lcore_role (rte, off, service)
 Check the cpu core – rte_thread_get_affinity() and rte_eal_get_lcore_state()
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
met
a
dat
a
Tx
met
a
dat
a
payloadMempool of
MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7 Lcore 8
Lcore 0 Lcore 9
8. What all to debug for service core?
 Get service core count – rte_service_lcore_count() and compare with result of rte_eal_get_configuration()
 Check if registered service is available – rte_service_get_by_name(), rte_service_get_count() and rte_service_get_name()
 Is given service running parallel on multiple lcores – rte_service_probe_capability() and rte_service_map_lcore_get()
 Is service running – rte_service_runstate_get()
 Find how many services are running on specific service lcore - rte_service_lcore_count_services()
 Generic debug - rte_service_dump()
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf
Rx
meta
data
Tx
meta
data payload
Mempool of MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7
Lcore 8
Lcore 0
Lcore 9
9. Bottleneck in event_dev?
are generic configuration correct?
 Get event_dev devices – rte_event_dev_count()
 Are they created on correct socket_id? - rte_event_dev_socket_id()
 Check if HW or SW capabilities? - rte_event_dev_info_get() for event_qos, queue_all_types, burst_mode, multiple_queue_port,
max_event_queue|dequeue_depth
 Packet stuck in queue - check for stages (event qeueue) where packets are looped back to same or previous stages.
Performance drops in enqueue event count > actual enqued?
 Dump the event_dev information – rte_event_dev_dump()
 Check stats for queue and port for eventdev
 Check the inflight, current queue element for enqueue|deqeue
10. How to debug HW or SW traffic manager?Is configuration right?
 Get current capabilities for DPDK port – rte_tm_capabilities_get() for max nodes, level, shaper_private, shaper_shared, sched_n_children and stats_mask
 Check if current leaf are configured identically - rte_tm_capabilities_get() for lead_nodes_identicial
 Get leaf nodes for a dpdk port – rte_tn_get_number_of_leaf_node()
 Check level capabilities by rte_tm_level_capabilities_get for n_noeds
• Max, nonleaf_max, leaf_max,
• identical, non_identical
• Shaper_private_supported
• Stats_mask
• Cman wred packet|byte supported
• Camn head drop supported
 Check node capabilities by rte_tm_node_capabilities_get for n_noeds
• Shaper_private_supported
• Stats_mask
• Cman wred packet|byte supported
• Camn head drop supported
 Debug via stats – rte_tm_stats_update() and rte_tm_node_stats_read()
RX TX
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payload
Struct rte_mbuf payloadStruct rte_mbuf
Rx
meta
data
Tx
meta
data payload
Mempool of
MBUF
Worker - 1
Worker - 1
Worker - 1
Worker - 1
Crypto
QoS + TX
PKT RX + Classify and
distribute
CRYPTO DEV
NIC 1,2,3 … n NIC 1,2,3 … n
Lcore 1
Stats +
health
Service core 2
Lcore 3, 4, 5, 6
Lcore 7 Lcore 8
Lcore 0 Lcore 9
memory
 tail: rte_dump_tailq, rte_eal_tailq_lookup
 Memzone: rte_memzone_dump (used to debug in config space for tables and counter)
timer
 rte_timer_manage – only after enabling debug
Crypto inline
 rte_security_session_stats_get
How to develop custom code to debug?
 For single process – the debug functionality is to be added in same process
 For multiple process – the debug functionality can be added to secondary multi process
 Debug functions can be
1. Timer call-back
2. Service function under service core
3. USR1 or USR2 signal handler
11. PKT capture with pdump?
Primary
Secondary
 with primary enabling then secondary can access. Copies packets from specific RX or TX queues to secondary process ring buffers.
 Need to explore:
 if secondary shares same interface can we enable from secondary for rx|tx happening on primary.
 Specific PMD private data dump the details
 User private data if present, dump the details
 Useful to identify the packets passed from RX or TX per queue.

Mais conteúdo relacionado

Mais procurados

DPDK (Data Plane Development Kit)
DPDK (Data Plane Development Kit) DPDK (Data Plane Development Kit)
DPDK (Data Plane Development Kit)
ymtech
 

Mais procurados (20)

DPDK KNI interface
DPDK KNI interfaceDPDK KNI interface
DPDK KNI interface
 
Intel dpdk Tutorial
Intel dpdk TutorialIntel dpdk Tutorial
Intel dpdk Tutorial
 
Understanding DPDK algorithmics
Understanding DPDK algorithmicsUnderstanding DPDK algorithmics
Understanding DPDK algorithmics
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?
 
1 intro to_dpdk_and_hw
1 intro to_dpdk_and_hw1 intro to_dpdk_and_hw
1 intro to_dpdk_and_hw
 
7 hands on
7 hands on7 hands on
7 hands on
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
DPDK (Data Plane Development Kit)
DPDK (Data Plane Development Kit) DPDK (Data Plane Development Kit)
DPDK (Data Plane Development Kit)
 
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
 
BPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLabBPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLab
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
100 M pps on PC.
100 M pps on PC.100 M pps on PC.
100 M pps on PC.
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
Userspace networking
Userspace networkingUserspace networking
Userspace networking
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
 
Poll mode driver integration into dpdk
Poll mode driver integration into dpdkPoll mode driver integration into dpdk
Poll mode driver integration into dpdk
 

Semelhante a Debug dpdk process bottleneck & painpoints

Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
Jeff Larkin
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
Jeff Larkin
 
[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4
Open Networking Summits
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
Kernel TLV
 

Semelhante a Debug dpdk process bottleneck & painpoints (20)

2020 icldla-updated
2020 icldla-updated2020 icldla-updated
2020 icldla-updated
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
 
Stress your DUT
Stress your DUTStress your DUT
Stress your DUT
 
PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...
PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...
PLNOG20 - Paweł Małachowski - Stress your DUT–wykorzystanie narzędzi open sou...
 
Synapse 2018 Guarding against failure in a hundred step pipeline
Synapse 2018 Guarding against failure in a hundred step pipelineSynapse 2018 Guarding against failure in a hundred step pipeline
Synapse 2018 Guarding against failure in a hundred step pipeline
 
design-compiler.pdf
design-compiler.pdfdesign-compiler.pdf
design-compiler.pdf
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
 
Jitsi Videobridge, Octopodes, and Kotlin
Jitsi Videobridge, Octopodes, and KotlinJitsi Videobridge, Octopodes, and Kotlin
Jitsi Videobridge, Octopodes, and Kotlin
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System EmulationQemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAP
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4[Webinar Slides] Programming the Network Dataplane in P4
[Webinar Slides] Programming the Network Dataplane in P4
 
Using Netconf/Yang with OpenDalight
Using Netconf/Yang with OpenDalightUsing Netconf/Yang with OpenDalight
Using Netconf/Yang with OpenDalight
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
 
676.v3
676.v3676.v3
676.v3
 
Postgres clusters
Postgres clustersPostgres clusters
Postgres clusters
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 

Mais de Vipin Varghese (9)

Dynamic user trace
Dynamic user traceDynamic user trace
Dynamic user trace
 
Debug generic process
Debug generic processDebug generic process
Debug generic process
 
Dpdk – IoT packet analyzer
Dpdk – IoT packet analyzerDpdk – IoT packet analyzer
Dpdk – IoT packet analyzer
 
Mmap failure analysis
Mmap failure analysisMmap failure analysis
Mmap failure analysis
 
Dpdk frame pipeline for ips ids suricata
Dpdk frame pipeline for ips ids suricataDpdk frame pipeline for ips ids suricata
Dpdk frame pipeline for ips ids suricata
 
Optimizations for ssl tls certificate lookup
Optimizations for ssl tls certificate lookupOptimizations for ssl tls certificate lookup
Optimizations for ssl tls certificate lookup
 
Optimizations for ssl tls certificate caching on multicore
Optimizations for ssl tls certificate caching on multicoreOptimizations for ssl tls certificate caching on multicore
Optimizations for ssl tls certificate caching on multicore
 
Fast i pv4 lookup using local memory
Fast i pv4 lookup using local memoryFast i pv4 lookup using local memory
Fast i pv4 lookup using local memory
 
DPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDSDPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDS
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Debug dpdk process bottleneck & painpoints

  • 1. Debug & Troubleshooting bottlenecks & pain Points Sep 2018 Vipin Varghese
  • 2. Breakup • To debug an application, isolate it to run on  Linux 64|32 bit environment  user space only  Uses DPDK PMD and libraries  Data captures for both static and shared libraries runs.  use gcc & gnu debug options too.
  • 3. Sample Packet Life (RX  Classifier + Load balance  worker cores  crypto (optional)  traffic manager  TX) RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx meta data Tx meta data payload Mempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … nLcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 4. 1. Is ‘received PKT rate < send PKT rate’? are generic configuration correct?  What is port Speed, Duplex – rte_eth_link_get()  Is packet of higher sizes are dropped? - rte_eth_get_mtu()  Are only specific MAC are received? - rte_eth_promiscuous_get() are there NIC specific drops?  Check rte_eth_rx_queue_info_get() for nb_desc, scattered_rx,  Check rte_eth_dev_stats() for Stats per queue  Is stats of other queues shows no change - rte_eth_dev_dev_rss_hash_conf_get() If problem still persists, this might be at RX lcore thread not pulling the traffic  Check if RX thread, distributor or event rx adapater is holding or processing more than required  try using rte_prefetch_non_temporal() to intimate the mbuf in pulled to cache for temporary RX TX Ste_mbuf payload truct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx meta data Tx meta data payloadMempool of MBUF Worker - 1 Worker - 1 Worker - 1Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 5. 2. Are there packet drops? at RX  Get the rx queues by rte_eth_dev_info_get() for nb_rx_queues  Check for miss, errors, qerros by rte_eth_dev_stats() for imissed, ierrors, q_erros, rx_nombuf, rte_mbuf_ref_count at TX  Are we doing in bulk to reduce the TX descriptor overhead?  Check rte_eth_dev_stats() oerrors, q_erros, rte_mbuf_ref_count RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx meta data Tx meta data payload Mempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 6. 3. Drops at producer ring? Performance for Producer  Fetch the type of RING – rte_ring_dump() for ‘flags (RING_F_SP_ENQ)’  If ‘burst enqueue - actual enqueue > 0’ – check rte_ring_count() or rte_ring_free_count()  If ‘burst or single‘ enqueue results 0, then there is no more space – check rte_ring_full() or not RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx met a dat a Tx met a dat a payloadMempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 7. 4. Drops at consumer ring? Performance for Producer 1. Fetch the type of RING – rte_ring_dump() for ‘flags (RING_F_SC_DEQ)’ 2. If ‘burst dequeue - actual dequeue > 0’ – rte_ring_free_count() 3. If ‘burst or single’ enqueue always results 0 – check the ring is empty via rte_ring_empty() RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx met a data Tx met a data payload Mempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 8. 5. Are we still not getting packets or objects at desired rate? Are packets received from multiple NIC? -rte_eth_dev_count_all()  Are NIC interfaces on different socket? – use rte_eth_dev_socket_id()  Is mempool created with right socket? - rte_mempool_create() or rte_pktmbuf_pool_create()  Are we seeing drop on specific socket? – It might require more mempool objects; try allocating more objects  Is there single RX thread for multiple NIC? – try having  multiple lcore to read from fixed interface  we might hitting cache limit. Increase cache_size for pool_create()  If we are still seeing low performance  Check if we sufficient objects – rte_mempool_avail_count()  Failure in some pkt – we might be getting pkts > mbuf data size. Check rte_pktmbuf_is_continguous()  If user pthread is used to access object access – rte_mempool_cache_create()  Try using 1GB huge pages instead of 2MB – if yes, try rte_mem_lock_page() for 2MB pages RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx met a data Tx met a data payloadMempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9 Stall in release of MBUF can be because  Processing pipeline is too heavy  Number of stages are too many  TX is not transferred at desired rate  Application missue scenarios a. not freeing packets b. Rte_pktmbuf_refcnt_set c. Rte_pktmbuf_prefree_seg
  • 9. 6. Performance issues in crypto lookaside? are generic configuration correct?  Get total crypto devices – rte_cryptodev_count()  Cross check SW or HW flags are configured properly – rte_cryptodev_info_get() for feature_flags If enqueue request > actual enqueue (drops)?  Is the queue pair setup for proper node – rte_cryptodev_queue_pair_setup() for socket_id  Is the session_pool created from same socket_id as queue pair?  Is enqueue thread same socket_id?  rte_cryptodev_stats() for drops err_count for enqueue or dequeue  Are there multiple threads enqueue or dequeue from same queue pair? If enqueue rate > dequeue rate?  Is dequeue lcore thread is same socket_id?  If we using SW crypto  Is the CRYPTO Library build with right flags?  Is the queue pair using CPU ISA - rte_cryptodev_info_get() for feature_flags for AVX|SSE  If we are using HW crypto – Is the card on same numa socket as queue pair and session pool? RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx meta data Tx meta data payloadMempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 11. 7. What all to check in a Process for Bottlenecks? Debug  Mode of operation - rte_eal_get_configuration() (master, lcore|service|numa count, process_type)  Check lcore run mode - rte_eal_lcore_role() (rte, off, service)  process details- rte_dump_stack(), rte_dump_registers(), rte_memdump() Performance  Threads context switches more - Identify lcore with rte_lcore() and lcore index mapping with rte_lcore_index()  Check lcore role type - rte_eal_lcore_role (rte, off, service)  Check the cpu core – rte_thread_get_affinity() and rte_eal_get_lcore_state() RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx met a dat a Tx met a dat a payloadMempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 12. 8. What all to debug for service core?  Get service core count – rte_service_lcore_count() and compare with result of rte_eal_get_configuration()  Check if registered service is available – rte_service_get_by_name(), rte_service_get_count() and rte_service_get_name()  Is given service running parallel on multiple lcores – rte_service_probe_capability() and rte_service_map_lcore_get()  Is service running – rte_service_runstate_get()  Find how many services are running on specific service lcore - rte_service_lcore_count_services()  Generic debug - rte_service_dump() RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf Rx meta data Tx meta data payload Mempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 13. 9. Bottleneck in event_dev? are generic configuration correct?  Get event_dev devices – rte_event_dev_count()  Are they created on correct socket_id? - rte_event_dev_socket_id()  Check if HW or SW capabilities? - rte_event_dev_info_get() for event_qos, queue_all_types, burst_mode, multiple_queue_port, max_event_queue|dequeue_depth  Packet stuck in queue - check for stages (event qeueue) where packets are looped back to same or previous stages. Performance drops in enqueue event count > actual enqued?  Dump the event_dev information – rte_event_dev_dump()  Check stats for queue and port for eventdev  Check the inflight, current queue element for enqueue|deqeue
  • 14. 10. How to debug HW or SW traffic manager?Is configuration right?  Get current capabilities for DPDK port – rte_tm_capabilities_get() for max nodes, level, shaper_private, shaper_shared, sched_n_children and stats_mask  Check if current leaf are configured identically - rte_tm_capabilities_get() for lead_nodes_identicial  Get leaf nodes for a dpdk port – rte_tn_get_number_of_leaf_node()  Check level capabilities by rte_tm_level_capabilities_get for n_noeds • Max, nonleaf_max, leaf_max, • identical, non_identical • Shaper_private_supported • Stats_mask • Cman wred packet|byte supported • Camn head drop supported  Check node capabilities by rte_tm_node_capabilities_get for n_noeds • Shaper_private_supported • Stats_mask • Cman wred packet|byte supported • Camn head drop supported  Debug via stats – rte_tm_stats_update() and rte_tm_node_stats_read() RX TX Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payload Struct rte_mbuf payloadStruct rte_mbuf Rx meta data Tx meta data payload Mempool of MBUF Worker - 1 Worker - 1 Worker - 1 Worker - 1 Crypto QoS + TX PKT RX + Classify and distribute CRYPTO DEV NIC 1,2,3 … n NIC 1,2,3 … n Lcore 1 Stats + health Service core 2 Lcore 3, 4, 5, 6 Lcore 7 Lcore 8 Lcore 0 Lcore 9
  • 15. memory  tail: rte_dump_tailq, rte_eal_tailq_lookup  Memzone: rte_memzone_dump (used to debug in config space for tables and counter) timer  rte_timer_manage – only after enabling debug Crypto inline  rte_security_session_stats_get
  • 16. How to develop custom code to debug?  For single process – the debug functionality is to be added in same process  For multiple process – the debug functionality can be added to secondary multi process  Debug functions can be 1. Timer call-back 2. Service function under service core 3. USR1 or USR2 signal handler
  • 17. 11. PKT capture with pdump? Primary Secondary  with primary enabling then secondary can access. Copies packets from specific RX or TX queues to secondary process ring buffers.  Need to explore:  if secondary shares same interface can we enable from secondary for rx|tx happening on primary.  Specific PMD private data dump the details  User private data if present, dump the details  Useful to identify the packets passed from RX or TX per queue.