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

How to use multiple cores when replaying PCAP file data? #1151

Open
wly-13 opened this issue Nov 1, 2024 · 1 comment
Open

How to use multiple cores when replaying PCAP file data? #1151

wly-13 opened this issue Nov 1, 2024 · 1 comment

Comments

@wly-13
Copy link

wly-13 commented Nov 1, 2024

Hi team,
When I tried to use trex to load PCAP file and replay the packets data, I found that only one core is fully used even I specified -c 10 in the command line. And the max TX rate is about 3Mpps. How can I use multiple cores to replay packets of PCAP file to get a higher TX rate? Do you have some suggestions on it? Thanks.

Below is my environment and config.

  • OS: Ubuntu22.04
  • Trex version: v3.00
  • python script:
pcap_file = os.path.abspath(pcap_file)
self.client.push_remote(pcap_filename=pcap_file,
                                       ports=self.port,
                                       ipg_usec=self.ipg_usec,
                                       count=1)  
self.client.wait_on_traffic(ports=[0, 1])
  • Trex config:
platform:
    master_thread_id: 0
    latency_thread_id: 20
    dual_if:
        - socket: 0
            threads: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
@DTran0
Copy link
Contributor

DTran0 commented Dec 9, 2024

As I understand it, sending PCAPs is generally limited to one thread. Here is quote from manual:

The profile runs on one DP thread because it has a burst with 1 packet. (Cannot split in this case.)

It makes sense to me as PCAP has defined order of packets. You can't send second packet before first packet. Even if you split packets among cores, you would need to have some synchronization mechanism to guarantee order of packets, which would slow performance.

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

No branches or pull requests

2 participants