Skip to content

Add extended core mask for up to 256 cores. - #2197

Draft
Dimi1010 wants to merge 43 commits into
seladb:devfrom
Dimi1010:feature/long-core-mask
Draft

Dimi1010 wants to merge 43 commits into
seladb:devfrom
Dimi1010:feature/long-core-mask

Conversation

@Dimi1010

@Dimi1010 Dimi1010 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds infrastructure for extended core mask that allows addressing up to 256 machine cores.
Part of #1717

Proposal

Current server grade processors frequently exceed 32 cores. The current core mask implementation cannot address these cores as it is limited to 32 bits. The PR proposes adding a new mask object LongCoreMask that is based on std::bitmask instead of uint32_t that can accommodate up to 256 machine cores. The maximum of 256 was chosen as it is the highest available count that would not require changing SystemCore::CoreId data type from uint8_t to uint16_t. Further expansion can happen in a future PR.

Changes

  • Added LongCoreMask to support larger machine core count.
  • The field SystemCore::Mask has been deprecated to disambiguate between the short and long core masks. The field would also be unsafe for system cores with IDs over 32, as they can't be represented. It has been replaced by SystemCore::getShortCoreMask() which dynamically computes the mask from the current SystemCore::CoreId.
  • Added an overload to createCoreVectorFromCoreMask which uses return value instead of out parameter.
  • Added validation for functions createCoreMaskFromCoreVector and createCoreMaskFromCoreIds. They will now throw std::out_of_range exception if they encounter CoreId >= 32.
  • Fixed documentation comments. Comments without @brief did not have their documentation added as short documentation.

Not planned in this PR

  • Add support for LongCoreMask in PfRingDevice.
  • Add support for LongCoreMask in DpdkDevice.

@Dimi1010 Dimi1010 closed this Jul 30, 2026
@Dimi1010 Dimi1010 reopened this Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.36111% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.11%. Comparing base (8f67db8) to head (39bb856).
⚠️ Report is 22 commits behind head on dev.

Files with missing lines Patch % Lines
Common++/src/SystemUtils.cpp 76.08% 9 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2197      +/-   ##
==========================================
+ Coverage   79.79%   84.11%   +4.32%     
==========================================
  Files         332      319      -13     
  Lines       54066    58512    +4446     
  Branches    12864    12420     -444     
==========================================
+ Hits        43140    49217    +6077     
+ Misses       8887     8076     -811     
+ Partials     2039     1219     -820     
Flag Coverage Δ
23.11.6 ?
24.11.5 ?
alpine320 76.85% <81.96%> (-0.01%) ⬇️
fedora42 76.45% <83.63%> (+0.02%) ⬆️
macos-15 82.28% <91.15%> (+0.01%) ⬆️
macos-26 82.29% <91.15%> (+0.02%) ⬆️
macos-26-intel 82.21% <91.15%> (+0.01%) ⬆️
mingw32 71.47% <70.27%> (-0.02%) ⬇️
mingw64 ?
rhel94 76.23% <82.45%> (-0.02%) ⬇️
ubuntu2204 76.27% <82.45%> (-0.01%) ⬇️
ubuntu2404 76.59% <83.92%> (+0.03%) ⬆️
ubuntu2604 76.51% <83.63%> (-0.03%) ⬇️
ubuntu2604-arm64 76.38% <84.48%> (+0.03%) ⬆️
ubuntu2604-icpx 59.10% <81.35%> (+0.04%) ⬆️
unittest 84.11% <92.36%> (+4.32%) ⬆️
windows-2022 85.79% <88.15%> (?)
windows-2025 85.54% <88.15%> (?)
winpcap 85.83% <88.15%> (?)
xdp 52.83% <1.13%> (-0.13%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

Dimi1010 added 5 commits July 30, 2026 11:40
- Support for equality operators ==, != on pairs:
  - LongCoreMask and LongCoreMask
  - LongCoreMask and SystemCore
  - LongCoreMask and CoreMask

- Support for bitwise operators AND, OR, XOR on pairs:
  - LongCoreMask and LongCoreMask
  - LongCoreMask and SystemCore
  - LongCoreMask and CoreMask

@Dimi1010 Dimi1010 Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Bumped cppcheck version to 2.21.0 due to false positive during the pre-commit checks:
https://github.com/seladb/PcapPlusPlus/actions/runs/30527830962/job/90822810175#step:6:90

Also, updated the GH repository URL, since it has been moved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant