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/hw_offload: add support for vlan stripping - v3 #12008

Closed
wants to merge 1 commit into from

Conversation

adaki4
Copy link

@adaki4 adaki4 commented Oct 22, 2024

Utilize DPDK API for hardware vlan stripping if supported by NIC.

Ticket: 7330

Contribution style:

Our Contribution agreements:

Changes (if applicable):

Previous PR #11997

Describe changes:
v3

  • minor changes in variable names
  • call SCLogConfig only when VLAN stripping is supported
  • change return type of ConfigSetVlanStrip to void

v2

  • add SCLogWarning, SCLogConfig for setting vlan stripping
  • create function PortConfSetVlanOffload that enables the vlan stripping and logging

v1

  • add option to enable hardware offload / strip of vlan tags with DPDK API on supported NICs
  • option can be enabled in suricata.yaml

Utilize DPDK API for hardware vlan stripping if supported by NIC.

Ticket: 7330
@adaki4 adaki4 requested review from victorjulien and a team as code owners October 22, 2024 14:56
Copy link

NOTE: This PR may contain new authors.

@@ -616,6 +618,13 @@ static int ConfigSetChecksumOffload(DPDKIfaceConfig *iconf, int entry_bool)
SCReturnInt(0);
}

static int ConfigSetVlanStrip(DPDKIfaceConfig *iconf, int entry_bool)
Copy link
Contributor

Choose a reason for hiding this comment

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

you didn't change the function to void

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I noticed it only at the tests, my bad. I will make one more iteration of PR.

@@ -807,6 +816,13 @@ static int ConfigLoad(DPDKIfaceConfig *iconf, const char *iface)
if (retval < 0)
SCReturnInt(retval);

retval = ConfGetChildValueBoolWithDefault(
Copy link
Contributor

Choose a reason for hiding this comment

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

if the function is void then retval should not be assigned. Then you don't need to check for the return code of retval (if-statement at L823)

Copy link
Contributor

@lukashino lukashino left a comment

Choose a reason for hiding this comment

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

Left inline comments, we are moving forward! 🚅

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.34%. Comparing base (30806ce) to head (327f2b0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12008      +/-   ##
==========================================
- Coverage   83.22%   82.34%   -0.89%     
==========================================
  Files         910      904       -6     
  Lines      258136   256357    -1779     
==========================================
- Hits       214831   211093    -3738     
- Misses      43305    45264    +1959     
Flag Coverage Δ
fuzzcorpus 61.44% <ø> (+0.03%) ⬆️
livemode ?
pcap 44.43% <ø> (-0.04%) ⬇️
suricata-verify 62.73% <ø> (-0.02%) ⬇️
unittests 59.29% <ø> (-0.01%) ⬇️

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

@adaki4
Copy link
Author

adaki4 commented Oct 23, 2024

Continues in #12014

@adaki4 adaki4 closed this Oct 23, 2024
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.

2 participants