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

Port rswitch offload features to xen #119

Closed

Conversation

dsemenets
Copy link

No description provided.

dsemenets and others added 30 commits October 5, 2022 13:13
L3 offload requires implementing FIB notifier for switch device, which
is responsible for handling FIB events and rule changes. The notifier
callback is invoked when interface initializes, or some new IP route
adds. In this case, the notifier should handle add/delete route and
make appropriate configuration on HW side. The L3 HW offload on
S4 R-Switch is implemented using MFWD L3 routing, perfect filters,
and L23 update table. When the IP routing callback is invoked, it adds
a new route via Perfect filters to the existing interface and caches
information about which packets can be routed using this interface.
When packets go from R-Switch to outside they firstly come to
rx_learning_chain, where they will be analyzed, and if match with
cached before routing rules, the appropriate L3 rule will be added
via L3 IPv4/v6 hash extract. After that, packets that match this
stream ID will be forwarded to the appropriate destination port with
updating destination MAC and TTL via L23 Update logic.

Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Dmytro Firsov <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
This commit introduces initial implemantition of traffic control flower
filter HW offload functionality for R-Switch driver.

Signed-off-by: Dmytro Firsov <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
Signed-off-by: Leonid Komarianskyi <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
This commit extends list of TC flower filter match parameters, that are
available for HW offload to R-Switch: EtherType, IP proto, ToS and TTL.

Also, usage of perfect filter was optimized by checking parameters
necessity (if mask for matching is equal to 0 - parameter is not
needed).

Signed-off-by: Dmytro Firsov <[email protected]>
This commit changes define names that are used in R-Switch driver to
less generic for avoiding collisions.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds support of matching by L4 src/dst port for HW
offloaded tc rules in R-Switch.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds support of different perfect filter modes configuration
via rswitch_pf_param structure. Previously only mask mode was supported.

Signed-off-by: Dmytro Firsov <[email protected]>
Signed-off-by: Dmytro Semenets <[email protected]>
This commit removes ACTION_SKBMOD, that was used also for pedit
actions. It was substituted with generic name ACTION_CHANGE_DMAC
- single action, that is supported for both pedit and skbmod.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds additional check for ndev, that are received as target_dev
for redirect in tc filters. This ndev should be one of the R-Switch ports
(tsn0, tsn1...).

Signed-off-by: Dmytro Firsov <[email protected]>
This commit removes parameter, that was not used from
rswitch_tc_flower_validate_match() fuction prototype.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds new action for R-Switch TC flower filter. Now
supported actions are drop and mirror redirect (also with dst MAC
change).

Signed-off-by: Dmytro Firsov <[email protected]>
Kernel TC subsystem somewhy always adds IPv6 flag to IPv4 rule match
dissector, but true IPv6 is not currently supported by R-Switch driver
for offload. IPv6 rules does not contain IPv4 flag in dissector, so
this commit adds correct check to validation process.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds additional check for get_dev_by_ip function to prevent
driver oops, when requested IP will not be found before it reaches number
of valid rdev's in rswitch_private entry.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds helper functions to reduce boilerplate during perfect
filter initialization.

Signed-off-by: Dmytro Firsov <[email protected]>
Previously perfect filter offset for right half of masked MAC address
was calculated incorrectly (decreased, instead of increase).

Signed-off-by: Dmytro Firsov <[email protected]>
…ilter

This commit adds separate function for action setup and for l3fwd
adding for u32 traffic control filter. It helps to reduce amount
of boilerplate code during knode setup.

Signed-off-by: Dmytro Firsov <[email protected]>
firscity and others added 12 commits October 25, 2022 18:23
This commit adds support of IPv6 addresses matching for flower TC
rules - both exact and masked values. It is implemented with perfect
filters functionality.

Signed-off-by: Dmytro Firsov <[email protected]>
…nction

This commit moves match parsing for R-Switch TC flower filter to
dedicated function to make it common with action parsing.

Signed-off-by: Dmytro Firsov <[email protected]>
… filter

This commit introduces offloaded matching by 802.1Q VLAN fields for
R-Switch TC flower filter. It uses C-Tag filtering mode and allows to
match by VLAN ID and VLAN priority fields in hardware.

Signed-off-by: Dmytro Firsov <[email protected]>
…all filters

This commit adds implementation for hardware offload of traffic control
VLAN modify actions for R-Switch flower and matchall filters. It uses
L23 C-Tag update feature and now supports only 802.1Q VLANs.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit fixes VLAN actions validation. Previously the wrong byte
order was used and it caused unexpected '-EOPNOTSUPP' for VLAN actions.

Signed-off-by: Dmytro Firsov <[email protected]>
…river

This commit corrects TC_SETUP_BLOCK logic, that is used for adding new
TC rules to R-Switch driver. Currently driver supports only rules for
ingress qdisc, so egress rules were handled incorrectly. Also
flow_block_cb_setup_simple() should be called both for flow block
binding and unbinding. Previously it was ignored for unbinding, it
probably leaded to wrong content of driver block list.

Signed-off-by: Dmytro Firsov <[email protected]>
Signed-off-by: Dmytro Firsov <[email protected]>
At the current state of matchall and u32 filter they will accept any
number of unsupported action when atleast one supported action is
amongst them. Fix this by returning EOPNOTSUPP when we can't match
action to any of the supported ones.

Signed-off-by: Mykyta Poturai <[email protected]>
Add support for vlan id and priority modification to u32 filter.
Fix skbmod check to allow for more than one action before redirect.

Signed-off-by: Mykyta Poturai <[email protected]>
Move shared code from flower and matchall filters to common file.

Signed-off-by: Mykyta Poturai <[email protected]>
This commit removes issue with SLV value, that defines traffic sources
for TC drop action in u32 and flower filters. Previously, it was
applied to traffic from all sources (all TSNx and GWCAx). Now it is
set only for device, that was specified by traffic control rule.

Signed-off-by: Dmytro Firsov <[email protected]>
This commit adds implementation of S-tag filtering for flower traffic
control filter. It allows to offload 802.1ad match rules to R-Switch
hardware.
@lorc
Copy link
Collaborator

lorc commented Oct 27, 2022

Merged manually.

@lorc lorc closed this Oct 27, 2022
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.

5 participants