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 - v2 #11997

Closed
wants to merge 1 commit into from

Conversation

adaki4
Copy link

@adaki4 adaki4 commented Oct 21, 2024

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

Ticket: 7330

Contribution style:

Our Contribution agreements:

Changes (if applicable):

Previous PR #11974

Describe changes:
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 21, 2024 09:48
Copy link

NOTE: This PR may contain new authors.

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.

Added a few nits to fix.

@@ -31,6 +31,7 @@ typedef struct DPDKIfaceConfigAttributes_ {
const char *checksum_checks;
const char *checksum_checks_offload;
const char *mtu;
const char *vlan_strip_enabled;
Copy link
Contributor

@lukashino lukashino Oct 21, 2024

Choose a reason for hiding this comment

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

I would suggest this be renamed to the same as the name of the YAML attribute so:
vlan_strip_offload

const struct rte_eth_dev_info *dev_info, struct rte_eth_conf *port_conf)
{
if (iconf->vlan_strip_enabled) {
SCLogConfig("%s: hardware vlan stripping enabled", iconf->iface);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would only print this in case I actually set the VLAN offload (So a line below L1217)

src/runmode-dpdk.c Show resolved Hide resolved
src/runmode-dpdk.c Show resolved Hide resolved
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.22%. Comparing base (55b922c) to head (c45704a).
Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11997      +/-   ##
==========================================
+ Coverage   82.75%   83.22%   +0.46%     
==========================================
  Files         910      910              
  Lines      249016   258201    +9185     
==========================================
+ Hits       206069   214881    +8812     
- Misses      42947    43320     +373     
Flag Coverage Δ
fuzzcorpus 61.39% <ø> (+0.58%) ⬆️
livemode 19.40% <68.42%> (+0.69%) ⬆️
pcap 44.44% <ø> (+0.31%) ⬆️
suricata-verify 62.77% <ø> (+0.48%) ⬆️
unittests 59.28% <ø> (+0.27%) ⬆️

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

@adaki4
Copy link
Author

adaki4 commented Oct 22, 2024

Continues in 12008

@adaki4 adaki4 closed this Oct 22, 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