Skip to content

Commit 0dcaafc

Browse files
Eli BritsteinSaeed Mahameed
authored andcommitted
net/mlx5: Introduce tunnel entropy control in PCMR register
When using the device packet encapsulation offload, the device calculates an entropy value, representing the inner packet headers. The entropy field is placed inside the outer packet headers. For UDP-type encapsulations, the entropy is placed in the source port field of the UDP header. For GRE-type encapsulations, the entropy is placed in the 8 LSB of the key field in the GRE header. If the device does not recognize the encapsulation type, the entropy is not placed in the packet. Entropy setting can be controlled using PCMR register. if encapsulation offload is not used force_entropy_cap should be set to 0x0. Entropy setting is enabled/disabled using entropy_calc, and could be additionally enabled/disabled for GRE encapsulation by entropy_gre_calc. As a pre-step to automatically control the tunnel entropy, introduce the entropy fields in the PCMR register with no functional change. Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Oz Shlomo <ozsh@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent bfedc64 commit 0dcaafc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

include/linux/mlx5/mlx5_ifc.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8473,9 +8473,17 @@ struct mlx5_ifc_pamp_reg_bits {
84738473
struct mlx5_ifc_pcmr_reg_bits {
84748474
u8 reserved_at_0[0x8];
84758475
u8 local_port[0x8];
8476-
u8 reserved_at_10[0x2e];
8476+
u8 reserved_at_10[0x10];
8477+
u8 entropy_force_cap[0x1];
8478+
u8 entropy_calc_cap[0x1];
8479+
u8 entropy_gre_calc_cap[0x1];
8480+
u8 reserved_at_23[0x1b];
84778481
u8 fcs_cap[0x1];
8478-
u8 reserved_at_3f[0x1f];
8482+
u8 reserved_at_3f[0x1];
8483+
u8 entropy_force[0x1];
8484+
u8 entropy_calc[0x1];
8485+
u8 entropy_gre_calc[0x1];
8486+
u8 reserved_at_43[0x1b];
84798487
u8 fcs_chk[0x1];
84808488
u8 reserved_at_5f[0x1];
84818489
};

0 commit comments

Comments
 (0)