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

dpdk: add initial unittests for DPDK codebase v5 #12081

Closed
wants to merge 9 commits into from

Conversation

lukashino
Copy link
Contributor

Redmine ticket: https://redmine.openinfosecfoundation.org/issues/6927
Follow-up of: #11728

Describe changes:
v5:

  • fixed the includes
  • github ci runs with experimental DPDK features in the build test for DPDK v23.11.*
  • no more GCC deprecation warning pushes

v4

  • fixed live device cleaning function
  • silenced 23.11 DPDK bond warning about "deprecated" (experimental) function on Fedora 40 builds
  • rebased

v3

  • comments from Philippe
  • I left TAILQ_INIT in the finalize/cleanup functions - all elements of the arrays are cleaned but not the base pointer of the array itself. TAILQ_* functions don't offer reset function but TAILQ_INIT provides the desired outcome
  • moved guards around - per Philippe's suggestions

v2

  • added a FatalError check on the number of LiveDevices
  • changed #if HAVE_DPDK to #if defined(HAVE_DPDK) && defined(UNITTESTS)
  • enabled unit tests in the Github workflow runs on Ubuntu and Fedora tasks

v1

  • function-guarded variable
  • fix the CPU exclude logic
  • add DPDK unit tests

Lukas Sismis added 9 commits November 3, 2024 21:21
To better control the values within the variables and to
prepare for the follow-up unit tests, the variable was moved
into global scope and should accessed only by functions.
This allows reinstantination of the variable value - needed for
unit tests.
The function would incorrectly perform XOR operation. While it
worked when the worker cores were occupying all cores, it is
still not correct operation. The example might be when a core
would be affined to only management and not worker threads.
With the XOR operation it would set affinity to also worker set.
(1 XOR 0 -> 1 where in fact the desired outcome is 0)
For the upcoming changes, skipping a unit test might be beneficial
when testing a function that retrieves hardware data. This can e.g. depend
on the number of CPU cores and systems that does not meet the required
test criteria will need to omit the tests.
The tests should always target minimal system requirements
DPDK Bonding API has been changed in DPDK version 23.11 where
the old *slave* API was marked as deprecated and the new *member*
API was experimental. This is based on a policy in DPDK where
an API change needs to merged in main for 1 stable release before
removing the experimental flag.
@lukashino
Copy link
Contributor Author

fix soon

@lukashino lukashino closed this Nov 3, 2024
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

Attention: Patch coverage is 93.20388% with 21 lines in your changes missing coverage. Please review.

Project coverage is 77.10%. Comparing base (b1e7917) to head (39a73d9).

❗ There is a different number of reports uploaded between BASE (b1e7917) and HEAD (39a73d9). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (b1e7917) HEAD (39a73d9)
livemode 1 0
fuzzcorpus 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12081      +/-   ##
==========================================
- Coverage   83.37%   77.10%   -6.28%     
==========================================
  Files         910      910              
  Lines      257556   257813     +257     
==========================================
- Hits       214748   198795   -15953     
- Misses      42808    59018   +16210     
Flag Coverage Δ
fuzzcorpus ?
livemode ?
pcap 44.48% <33.33%> (-0.02%) ⬇️
suricata-verify 62.77% <33.33%> (+0.01%) ⬆️
unittests 59.12% <93.20%> (-0.24%) ⬇️

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

@lukashino
Copy link
Contributor Author

Followup in #12083

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

Successfully merging this pull request may close these issues.

1 participant