Skip to content

Few fixes to support DPDK 23.11 and 24.11 #1774

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

Merged
merged 7 commits into from
Apr 19, 2025
Merged

Conversation

seladb
Copy link
Owner

@seladb seladb commented Apr 16, 2025

The first PR to address issue #1770 (there'll be a follow-up PR).

I'm working on adding DPDK 23.11 and 24.11. These fixes are needed to support these versions. They should all be backward-compatible and work on older DPDK versions as well.

Once this PR is merged, I'll add Docker images for DPDK 23.11 and 24.11 (here is a draft PR for it: seladb/PcapPlusPlus-DockerImages#49) and open another PR to update our CI with the new images.

Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.10%. Comparing base (8f12193) to head (415b69c).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1774      +/-   ##
==========================================
- Coverage   83.10%   83.10%   -0.01%     
==========================================
  Files         283      283              
  Lines       48929    48929              
  Branches    10516    10516              
==========================================
- Hits        40664    40661       -3     
- Misses       7129     7130       +1     
- Partials     1136     1138       +2     
Flag Coverage Δ
alpine320 75.07% <ø> (ø)
fedora40 75.11% <ø> (-0.03%) ⬇️
macos-13 80.60% <ø> (ø)
macos-14 80.60% <ø> (ø)
macos-15 80.58% <ø> (ø)
mingw32 70.73% <ø> (-0.02%) ⬇️
mingw64 70.71% <ø> (ø)
npcap 85.07% <ø> (ø)
rhel94 74.94% <ø> (-0.03%) ⬇️
ubuntu2004 58.56% <ø> (ø)
ubuntu2004-zstd 58.65% <ø> (-0.02%) ⬇️
ubuntu2204 74.86% <ø> (-0.03%) ⬇️
ubuntu2204-icpx 61.46% <ø> (-0.04%) ⬇️
ubuntu2404 75.14% <ø> (+0.01%) ⬆️
unittest 83.10% <ø> (-0.01%) ⬇️
windows-2019 85.09% <ø> (ø)
windows-2022 85.11% <ø> (ø)
winpcap 85.25% <ø> (ø)
xdp 50.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seladb seladb marked this pull request as ready for review April 16, 2025 08:04
@seladb seladb changed the title DPDK fixes to support 23.11 and 24.11 Few fixes to support DPDK 23.11 and 24.11 Apr 16, 2025
Comment on lines +276 to +277
m_Config.rssKey = nullptr;
m_Config.rssKeyLength = 0;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DPDK 23.11/24.11 it won't let setting the RSS has function to RSS_NONE but have something in rssKey

@@ -346,7 +348,11 @@ namespace pcpp
bool DpdkDevice::initQueues(uint8_t numOfRxQueuesToInit, uint8_t numOfTxQueuesToInit)
{
rte_eth_dev_info devInfo;
rte_eth_dev_info_get(m_Id, &devInfo);
if (rte_eth_dev_info_get(m_Id, &devInfo) < 0)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In recent DPDK 24.11 they added __rte_warn_unused_result to rte_eth_dev_info_get and rte_eth_link_get so we have to consider the return value

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add PCPP_LOG_ERROR no ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree, update in this commit: 6a44d08

RawPacket::setRawData(rte_pktmbuf_mtod(mBuf, const uint8_t*), rte_pktmbuf_pkt_len(mBuf), timestamp,
LINKTYPE_ETHERNET);
m_MBuf = mBuf;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug that was introduced somewhere, not sure where: when calling RawPacket::setRawData() it calls MBufRawPacket::clear() which sets m_MBuf to nullptr, so we have to set the mbuf after calling RawPacket::setRawData(), otherwise we get a segmentation fault

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good explanation that should go in the commit log of "Fix a bug in MBufRawPacket::setMBuf"

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We run "Squash and merge" so these commits go away after merging. That's why it's better to put them as comments, so anyone can go to the PR that made the change and look

@seladb
Copy link
Owner Author

seladb commented Apr 18, 2025

@clementperon @egecetin @tigercosmos @Dimi1010 can one of you review this PR?

@seladb seladb merged commit 74322eb into dev Apr 19, 2025
41 checks passed
@seladb seladb deleted the dpdk-support-23-and-24 branch April 19, 2025 08:41
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

Successfully merging this pull request may close these issues.

2 participants