Skip to content

Conversation

@JasMetzger
Copy link
Contributor

The queue id can be specified as an additional configuration parameter. It is checked against the maximum queues available by the device using a utility provided as a static function. In the open() function, the configured queue id is used in place of the hardwired zero value that was used before. Added a convenience function to obtain the queue id from device.

Community may consider renaming the XdpDevice to XdpSocketDevice as each instance of the XdpDevice class pertains to a single queue id / socket.

@JasMetzger JasMetzger requested a review from seladb as a code owner October 27, 2025 20:03
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.45%. Comparing base (0132d27) to head (e6a1e9b).
⚠️ Report is 4 commits behind head on dev.

Files with missing lines Patch % Lines
Pcap++/src/XdpDevice.cpp 73.68% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2009      +/-   ##
==========================================
+ Coverage   83.41%   83.45%   +0.03%     
==========================================
  Files         311      311              
  Lines       55019    54562     -457     
  Branches    11816    11814       -2     
==========================================
- Hits        45892    45532     -360     
+ Misses       7852     7792      -60     
+ Partials     1275     1238      -37     
Flag Coverage Δ
alpine320 75.89% <ø> (ø)
fedora42 75.45% <ø> (-0.39%) ⬇️
macos-14 81.58% <ø> (+0.07%) ⬆️
macos-15 81.57% <ø> (+0.05%) ⬆️
mingw32 70.02% <ø> (-0.52%) ⬇️
mingw64 69.99% <ø> (-0.41%) ⬇️
npcap ?
rhel94 75.45% <ø> (-0.42%) ⬇️
ubuntu2004 59.46% <ø> (-0.67%) ⬇️
ubuntu2004-zstd 59.56% <ø> (-0.67%) ⬇️
ubuntu2204 75.38% <ø> (-0.42%) ⬇️
ubuntu2204-icpx 57.83% <ø> (-2.72%) ⬇️
ubuntu2404 75.51% <ø> (-0.38%) ⬇️
ubuntu2404-arm64 75.54% <ø> (-0.03%) ⬇️
unittest 83.45% <75.00%> (+0.03%) ⬆️
windows-2022 85.42% <ø> (+0.16%) ⬆️
windows-2025 85.45% <ø> (+0.11%) ⬆️
winpcap 85.45% <ø> (-0.09%) ⬇️
xdp 53.02% <75.00%> (-0.52%) ⬇️

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.

Copy link
Collaborator

@Dimi1010 Dimi1010 left a comment

Choose a reason for hiding this comment

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

Looks good overall. Some minor notes.

XDP CI is failing tho. If you could look into that. 🤔

XdpDeviceStats getStatistics();

/// @return Return queue identifier for underlying socket
uint32_t getQueueId()
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I think this method can be marked as const?

uint32_t XdpDevice::getNumQueues(const std::string& iface, bool tx)
{
// returns number of hardware queues associated with the device
uint32_t rxtxqueues = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we rename this to numQueues?

{
std::regex rxtx_regex("^" + prefix + "[0-9]+$");

struct dirent* entry;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Curious why the struct dirent*? Can't we just do dirent*?

@seladb
Copy link
Owner

seladb commented Nov 6, 2025

@JasMetzger, please notice that clang-format fails in CI

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.

3 participants