There are two different internal steering modes, abstracted from the
rest of the driver. In order to keep upper layer of the driver agnostic
to the differences in capabilities of the steering modes, this patch
introduces mlx5_fs_get_capabilities() API to check if a certain software
defined capability is supported. It differs from the capabilities
exposed by the hardware, as it takes into account the flow steering mode
(SMFS/DMFS) currently enabled.
This implementation supports only two capability flags:
They map to DR_ACTION_STATE_PUSH_VLAN and DR_ACTION_STATE_POP_VLAN
actions, implemented in SW steering earlier in commit f5e22be534e0
("net/mlx5: DR, Split modify VLAN state to separate pop/push states").
Which enables using of pop/push vlan without restrictions, e.g. doing
vlan pop on TX and RX, compared to FW steering that supports only vlan
pop on RX and push on TX.
Other capabilities can be added in the future.
Signed-off-by: Dima Chumak <email address hidden>
Reviewed-by: Mark Bloch <email address hidden>
Reviewed-by: Yevgeny Kliteynik <email address hidden>
Signed-off-by: Saeed Mahameed <email address hidden>
(backported from commit 8348b71ccd921d0bff21b6f480ecc1e3a5033359)
[ dannf: minor context adjustmens in fs_cmd.* ]
Signed-off-by: dann frazier <email address hidden>
33bf702...
by
Yevgeny Kliteynik <email address hidden>
net/mlx5: DR, Refactor ste_ctx handling for STE v0/1
As preparation for supporting ConnectX-7, this patches changes handling
of ste_ctx handling for existing STE v0 and V1:
- each context is now a static struct, and it has a corresponding getter
- v0 and v1 were extended to contain the fields that are required for
integrating STEv2.
Signed-off-by: Yevgeny Kliteynik <email address hidden>
Reviewed-by: Alex Vesker <email address hidden>
Signed-off-by: Saeed Mahameed <email address hidden>
(cherry picked from commit 638a07f1090ea79fa6720b4d0265c6f8206f0c1b)
Signed-off-by: dann frazier <email address hidden>
410ba72...
by
Yevgeny Kliteynik <email address hidden>
net/mlx5: DR, Rename action modify fields to reflect naming in HW spec
As preparation for supporting ConnectX-7, rename action modify fields
steering registers from arbitrary names to the names that reflect the
corresponding naming and location of the steering registers in HW.
These registers mapping has changed in ConnectX-7, so the renaming allows
to keep track of their mapping better.
Signed-off-by: Yevgeny Kliteynik <email address hidden>
Reviewed-by: Alex Vesker <email address hidden>
Signed-off-by: Saeed Mahameed <email address hidden>
(cherry picked from commit 75a3926ca6a434651d4086a8a9152c1da7d7852e)
Signed-off-by: dann frazier <email address hidden>
b2a83ce...
by
Yevgeny Kliteynik <email address hidden>
net/mlx5: DR, Fix handling of different actions on the same STE in STEv1
When adding a rule with 32 destinations, we hit the following out-of-band
access issue:
BUG: KASAN: slab-out-of-bounds in mlx5_cmd_dr_create_fte+0x18ee/0x1e70
This patch fixes the issue by both increasing the allocated buffers to
accommodate for the needed actions and by checking the number of actions
to prevent this issue when a rule with too many actions is provided.
Fixes: 1ffd498901c1 ("net/mlx5: DR, Increase supported num of actions to 32")
Signed-off-by: Yevgeny Kliteynik <email address hidden>
Reviewed-by: Alex Vesker <email address hidden>
Signed-off-by: Saeed Mahameed <email address hidden>
(cherry picked from commit 0aec12d97b2036af0946e3d582144739860ac07b)
Signed-off-by: dann frazier <email address hidden>
bffe6ab...
by
Yevgeny Kliteynik <email address hidden>
net/mlx5: Set SMFS as a default steering mode if device supports it
Set SMFS (SW-managed flow steering) as a default steering mode
instead of DMFS (device-managed flow steering)
In SMFS, the driver writes the STEs (Steering Table Entries) directly
to the device's ICM, which allows for a higher rule insertion rate
than through using FW command interface, as it is done in DMFS.
SMFS/DMFS steering modes can be configured through devlink param
'flow_steering_mode'. The possible values are 'smfs' or 'dmfs'.
The desired 'flow_steering_mode' param value should be set before
enabling switchdev mode.
Example:
# devlink dev param set pci/0000:05:00.0 name flow_steering_mode smfs
# devlink dev eswitch set pci/0000:05:00.0 mode switchdev
Signed-off-by: Yevgeny Kliteynik <email address hidden>
(cherry picked from commit aa36c94853b2bcc4953e065c462deb1ade7f55be)
Signed-off-by: dann frazier <email address hidden>