Skip to content

Commit 7601a0a

Browse files
lkayal-01kuba-moo
authored andcommitted
net/mlx5e: Add a miss level for ipsec crypto offload
The cited commit adds a miss table for switchdev mode. But it uses the same level as policy table. Will hit the following error when running command: # ip xfrm state add src 192.168.1.22 dst 192.168.1.21 proto \ esp spi 1001 reqid 10001 aead 'rfc4106(gcm(aes))' \ 0x3a189a7f9374955d3817886c8587f1da3df387ff 128 \ mode tunnel offload dev enp8s0f0 dir in Error: mlx5_core: Device failed to offload this state. The dmesg error is: mlx5_core 0000:03:00.0: ipsec_miss_create:578:(pid 311797): fail to create IPsec miss_rule err=-22 Fix it by adding a new miss level to avoid the error. Fixes: 7d9e292 ("net/mlx5e: Move IPSec policy check after decryption") Signed-off-by: Jianbo Liu <jianbol@nvidia.com> Signed-off-by: Chris Mi <cmi@nvidia.com> Signed-off-by: Lama Kayal <lkayal@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/1757939074-617281-4-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6b4be64 commit 7601a0a

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/en/fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ enum {
9292
MLX5E_ACCEL_FS_ESP_FT_LEVEL = MLX5E_INNER_TTC_FT_LEVEL + 1,
9393
MLX5E_ACCEL_FS_ESP_FT_ERR_LEVEL,
9494
MLX5E_ACCEL_FS_POL_FT_LEVEL,
95+
MLX5E_ACCEL_FS_POL_MISS_FT_LEVEL,
9596
MLX5E_ACCEL_FS_ESP_FT_ROCE_LEVEL,
9697
#endif
9798
};

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ struct mlx5e_ipsec_rx_create_attr {
185185
u32 family;
186186
int prio;
187187
int pol_level;
188+
int pol_miss_level;
188189
int sa_level;
189190
int status_level;
190191
enum mlx5_flow_namespace_type chains_ns;

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ static void ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
747747
attr->family = family;
748748
attr->prio = MLX5E_NIC_PRIO;
749749
attr->pol_level = MLX5E_ACCEL_FS_POL_FT_LEVEL;
750+
attr->pol_miss_level = MLX5E_ACCEL_FS_POL_MISS_FT_LEVEL;
750751
attr->sa_level = MLX5E_ACCEL_FS_ESP_FT_LEVEL;
751752
attr->status_level = MLX5E_ACCEL_FS_ESP_FT_ERR_LEVEL;
752753
attr->chains_ns = MLX5_FLOW_NAMESPACE_KERNEL;
@@ -833,7 +834,7 @@ static int ipsec_rx_chains_create_miss(struct mlx5e_ipsec *ipsec,
833834

834835
ft_attr.max_fte = 1;
835836
ft_attr.autogroup.max_num_groups = 1;
836-
ft_attr.level = attr->pol_level;
837+
ft_attr.level = attr->pol_miss_level;
837838
ft_attr.prio = attr->prio;
838839

839840
ft = mlx5_create_auto_grouped_flow_table(attr->ns, &ft_attr);

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@
114114
#define ETHTOOL_NUM_PRIOS 11
115115
#define ETHTOOL_MIN_LEVEL (KERNEL_MIN_LEVEL + ETHTOOL_NUM_PRIOS)
116116
/* Vlan, mac, ttc, inner ttc, {UDP/ANY/aRFS/accel/{esp, esp_err}}, IPsec policy,
117-
* {IPsec RoCE MPV,Alias table},IPsec RoCE policy
117+
* IPsec policy miss, {IPsec RoCE MPV,Alias table},IPsec RoCE policy
118118
*/
119-
#define KERNEL_NIC_PRIO_NUM_LEVELS 10
119+
#define KERNEL_NIC_PRIO_NUM_LEVELS 11
120120
#define KERNEL_NIC_NUM_PRIOS 1
121121
/* One more level for tc, and one more for promisc */
122122
#define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 2)

0 commit comments

Comments
 (0)