Skip to content

Commit

Permalink
dpdk: add packet throughput analysis for ethdev
Browse files Browse the repository at this point in the history
Introduces packet throughput analysis for DPDK applications
using the ethdev library. The analysis calculates packet throughput in
both bits per second (bps) and packets per second (pps) for transmitted
and received Ethernet traffic on a per-queue basis.

Note that the calculation of throughput in bps requires the existence of
custom profiling events in the trace

Signed-off-by: Adel Belkhiri <[email protected]>
  • Loading branch information
adel-belkhiri authored and MatthewKhouzam committed Feb 3, 2025
1 parent 205bcd1 commit d7e345a
Show file tree
Hide file tree
Showing 27 changed files with 1,689 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.tracecompass.analysis.os.linux.core,
org.eclipse.jdt.annotation;bundle-version="2.2.400"
Export-Package: org.eclipse.tracecompass.incubator.dpdk.core.trace,
org.eclipse.tracecompass.incubator.internal.dpdk.core.ethdev.throughput.analysis,
org.eclipse.tracecompass.incubator.internal.dpdk.core.lcore.analysis;x-friends:="org.eclipse.tracecompass.incubator.dpdk.core.tests"
Automatic-Module-Name: org.eclipse.tracecompass.incubator.dpdk.core
Import-Package: com.google.common.collect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,30 @@
class="org.eclipse.tracecompass.incubator.dpdk.core.trace.DpdkTrace">
</tracetype>
</module>
<module
analysis_module="org.eclipse.tracecompass.incubator.internal.dpdk.core.ethdev.throughput.analysis.DpdkEthdevThroughputAnalysisModule"
id="org.eclipse.tracecompass.incubator.dpdk.ethdev.throughput.analysis"
name="DPDK Ethernet Throughput Analysis">
<tracetype
applies="true"
class="org.eclipse.tracecompass.incubator.dpdk.core.trace.DpdkTrace">
</tracetype>
</module>
</extension>
<extension
point="org.eclipse.tracecompass.tmf.core.dataprovider">
<dataProviderFactory
class="org.eclipse.tracecompass.incubator.internal.dpdk.core.lcore.analysis.DpdkLogicalCoreDataProviderFactory"
id="org.eclipse.tracecompass.incubator.dpdk.lcore.dataprovider">
</dataProviderFactory>
<dataProviderFactory
class="org.eclipse.tracecompass.incubator.internal.dpdk.core.ethdev.throughput.analysis.DpdkEthdevThroughputBpsDataProviderFactory"
id="org.eclipse.tracecompass.incubator.dpdk.ethdev.throughput.bps.dataprovider">
</dataProviderFactory>
<dataProviderFactory
class="org.eclipse.tracecompass.incubator.internal.dpdk.core.ethdev.throughput.analysis.DpdkEthdevThroughputPpsDataProviderFactory"
id="org.eclipse.tracecompass.incubator.dpdk.ethdev.throughput.pps.dataprovider">
</dataProviderFactory>
</extension>
<extension
point="org.eclipse.linuxtools.tmf.core.tracetype">
Expand All @@ -31,5 +48,4 @@
trace_type="org.eclipse.tracecompass.incubator.dpdk.core.trace.DpdkTrace">
</type>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/**********************************************************************
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipse.tracecompass.incubator.internal.dpdk.core.ethdev.analysis;

/**
* This class specifies the names of events required for the analysis of
* Ethdev-based applications, and their fields.
*
* To start using an Ethernet port, a Dpdk application must perform the
* following steps:
*
* 1. **Configure the Ethernet port** by calling the API function
* `rte_eth_dev_configure()`. This function requires specifying the number of RX
* and TX queues to enable, along with other parameters that determine the
* features and capabilities of the port (e.g., RSS).
*
* 2. **Set up the receive and transmit queues** by calling the API functions
* `rte_eth_rx_queue_setup()` and `rte_eth_tx_queue_setup()`. The main
* parameters for these functions are the number of descriptors and the memory
* pool from which to allocate the `rte_mbuf` network memory buffers.
*
* 3. **Start the device** by calling the API function `rte_eth_dev_start()`.
* From this point onward, the device becomes operational, and enqueue and
* dequeue operations can be performed on its queues.
*
* 4. **Use the port queues** by polling the RX queues for incoming packets
* using `rte_eth_rx_burst()` and transmit packets by sending them to the TX
* queues using `rte_eth_tx_burst()`.
*
* 5. **Stop the Ethernet port** by calling `rte_eth_dev_stop()`.
*
* 6. **Close the Ethernet port** by calling `rte_eth_dev_close()`.
*
* @author Adel Belkhiri
*/
public class DpdkEthdevEventLayout {
/* Event names */
private static final String ETH_DEV_RX_BURST_EMPTY = "lib.ethdev.rx.burst.empty"; //$NON-NLS-1$
private static final String ETH_DEV_RX_BURST_NON_EMPTY = "lib.ethdev.rx.burst.nonempty"; //$NON-NLS-1$
private static final String ETH_DEV_TX_BURST = "lib.ethdev.tx.burst"; //$NON-NLS-1$
private static final String PROFILE_ETH_DEV_RX_BURST = "lib.ethdev.rx.burst.extended"; //$NON-NLS-1$
private static final String PROFILE_ETH_DEV_TX_BURST = "lib.ethdev.tx.burst.extended"; //$NON-NLS-1$

/* Event field names */
private static final String PORT_ID = "port_id"; //$NON-NLS-1$
private static final String QUEUE_ID = "queue_id"; //$NON-NLS-1$
private static final String NB_RX = "nb_rx"; //$NON-NLS-1$
private static final String NB_TX = "nb_tx"; //$NON-NLS-1$
private static final String NB_PKTS = "nb_pkts"; //$NON-NLS-1$
private static final String SIZE = "size"; //$NON-NLS-1$
private static final String THREAD_NAME = "context.name"; //$NON-NLS-1$
private static final String CPU_ID = "context.cpu_id"; //$NON-NLS-1$

// ------------------------------------------------------------------------
// Event names
// ------------------------------------------------------------------------

/**
* This event is generated when an empty burst of packets is received
*
* @return The event name
*/
public String eventEthdevRxBurstEmpty() {
return ETH_DEV_RX_BURST_EMPTY;
}

/**
* This event is generated when a burst of one or more packets is received
*
* @return The event name
*/
public String eventEthdevRxBurstNonEmpty() {
return ETH_DEV_RX_BURST_NON_EMPTY;
}

/**
* This event is generated when a burst of packets is sent
*
* @return The event name
*/
public String eventEthdevTxBurst() {
return ETH_DEV_TX_BURST;
}

/**
* This event is emitted by the Ethdev profiling library when a non empty
* burst of packets is received
*
* @return The event name
*/
public String eventProfileEthdevRxBurst() {
return PROFILE_ETH_DEV_RX_BURST;
}

/**
* This event is emitted by the Ethdev profiling library when a burst of
* packets is sent
*
* @return The event name
*/
public String eventProfileEthdevTxBurst() {
return PROFILE_ETH_DEV_TX_BURST;
}

// ------------------------------------------------------------------------
// Event field names
// ------------------------------------------------------------------------

/**
* @return The name of the field specifying the NIC port identifier
*/
public String fieldPortId() {
return PORT_ID;
}

/**
* @return The name of the field indicating the id of a queue attached to a
* port
*/
public String fieldQueueId() {
return QUEUE_ID;
}

/**
* @return The name of the field specifying the number of packets received
* in a burst
*/
public String fieldNbRxPkts() {
return NB_RX;
}

/**
* @return The field name specifying the number of packets transmitted as a
* burst
*/
public String fieldNbPkts() {
return NB_PKTS;
}

/**
* @return The field name specifying the number of packets transmitted as a
* burst in the profiling event
*/
public String fieldNbTxPkts() {
return NB_TX;
}

/**
* @return The name of the field specifying the number of bytes denoting the
* size of the received or transmitted burst
*/
public String fieldSize() {
return SIZE;
}

/**
* @return The name of the thread issuing the DPDK event
*/
public String fieldThreadName() {
return THREAD_NAME;
}

/**
* @return The identifier of the CPU on which the DPDK event was recorded
*/
public String fieldCpuId() {
return CPU_ID;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**********************************************************************
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
@org.eclipse.jdt.annotation.NonNullByDefault
package org.eclipse.tracecompass.incubator.internal.dpdk.core.ethdev.analysis;
Loading

0 comments on commit d7e345a

Please sign in to comment.