Skip to content

Commit 298ef95

Browse files
michaelbaum1raslandarawsheh
authored andcommitted
net/mlx5: support modify IPv6 flow label field
Add HW steering support for IPv6 flow label field modification. Copy from inner IPv6 flow label field is also supported using "level=2". Signed-off-by: Michael Baum <[email protected]> Acked-by: Dariusz Sosnowski <[email protected]>
1 parent c4734bb commit 298ef95

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

doc/guides/rel_notes/release_24_03.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ New Features
128128
* Added support for modifying IPv4 proto field in HWS flow engine.
129129
* Added support for modifying IPsec ESP fields in HWS flow engine.
130130
* Added support for modifying IPv6 traffic class field in HWS flow engine.
131+
* Added support for modifying IPv6 flow label field in HWS flow engine.
131132
* Added support for matching a random value.
132133
* Added support for comparing result between packet fields or value.
133134
* Added support for accumulating value of field into another one.

drivers/net/mlx5/mlx5_flow_dv.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
13941394
return 32;
13951395
case RTE_FLOW_FIELD_IPV6_DSCP:
13961396
return 6;
1397+
case RTE_FLOW_FIELD_IPV6_FLOW_LABEL:
1398+
return 20;
13971399
case RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS:
13981400
case RTE_FLOW_FIELD_IPV6_HOPLIMIT:
13991401
case RTE_FLOW_FIELD_IPV6_PROTO:
@@ -1806,6 +1808,16 @@ mlx5_flow_field_id_to_modify_info
18061808
else
18071809
info[idx].offset = off_be;
18081810
break;
1811+
case RTE_FLOW_FIELD_IPV6_FLOW_LABEL:
1812+
MLX5_ASSERT(data->offset + width <= 20);
1813+
off_be = 20 - (data->offset + width);
1814+
modi_id = CALC_MODI_ID(IPV6_FLOW_LABEL, data->level);
1815+
info[idx] = (struct field_modify_info){4, 0, modi_id};
1816+
if (mask)
1817+
mask[idx] = flow_modify_info_mask_32(width, off_be);
1818+
else
1819+
info[idx].offset = off_be;
1820+
break;
18091821
case RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN:
18101822
MLX5_ASSERT(data->offset + width <= 16);
18111823
off_be = 16 - (data->offset + width);

drivers/net/mlx5/mlx5_flow_hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5068,6 +5068,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
50685068
case RTE_FLOW_FIELD_IPV4_SRC:
50695069
case RTE_FLOW_FIELD_IPV4_DST:
50705070
case RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS:
5071+
case RTE_FLOW_FIELD_IPV6_FLOW_LABEL:
50715072
case RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN:
50725073
case RTE_FLOW_FIELD_IPV6_HOPLIMIT:
50735074
case RTE_FLOW_FIELD_IPV6_SRC:

0 commit comments

Comments
 (0)