Skip to content

Commit

Permalink
net/mlx5: add random item support
Browse files Browse the repository at this point in the history
Add support for random item in HWS mode.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
  • Loading branch information
michaelbaum1 authored and raslandarawsheh committed Jan 28, 2024
1 parent 7da9e1c commit 6c2509a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/guides/nics/mlx5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Features
- Sub-Function.
- Matching on represented port.
- Matching on aggregated affinity.
- Matching on random value.


Limitations
Expand Down Expand Up @@ -571,6 +572,7 @@ Limitations
- Modification of the MPLS header is supported only in HWS and only to copy from,
the encapsulation level is always 0.
- Modification of the 802.1Q Tag, VXLAN Network or GENEVE Network ID's is not supported.
- Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported.
- Encapsulation levels are not supported, can modify outermost header fields only.
- Offsets cannot skip past the boundary of a field.
- If the field type is ``RTE_FLOW_FIELD_MAC_TYPE``
Expand Down Expand Up @@ -777,6 +779,13 @@ Limitations
- In HW steering (``dv_flow_en`` = 2):
- not supported on guest port.

- Match on random value:

- Supported only with HW Steering enabled (``dv_flow_en`` = 2).
- Supported only in table with ``nb_flows=1``.
- NIC ingress/egress flow in group 0 is not supported.
- Supports matching only 16 bits (LSB).

- During live migration to a new process set its flow engine as standby mode,
the user should only program flow rules in group 0 (``fdb_def_rule_en=0``).
Live migration is only supported under SWS (``dv_flow_en=1``).
Expand Down
1 change: 1 addition & 0 deletions doc/guides/rel_notes/release_24_03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ New Features
* Added support for VXLAN-GPE matching in HW Steering flow engine
(``dv_flow_en`` = 2).

* Added support for ``RTE_FLOW_ITEM_TYPE_RANDOM`` flow item.

Removed Items
-------------
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -5496,6 +5496,11 @@ flow_dv_validate_action_modify_field(struct rte_eth_dev *dev,
RTE_FLOW_ERROR_TYPE_ACTION, action,
"modifications of the MPLS header "
"is not supported");
if (dst_data->field == RTE_FLOW_FIELD_RANDOM ||
src_data->field == RTE_FLOW_FIELD_RANDOM)
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION, action,
"modifications of random value is not supported");
if (dst_data->field == RTE_FLOW_FIELD_MARK ||
src_data->field == RTE_FLOW_FIELD_MARK)
if (config->dv_xmeta_en == MLX5_XMETA_MODE_LEGACY ||
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/mlx5/mlx5_flow_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -5085,6 +5085,10 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, action,
"modifying vlan_type is not supported");
if (flow_hw_modify_field_is_used(action_conf, RTE_FLOW_FIELD_RANDOM))
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, action,
"modifying random value is not supported");
if (flow_hw_modify_field_is_used(action_conf, RTE_FLOW_FIELD_GENEVE_VNI))
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, action,
Expand Down Expand Up @@ -6851,6 +6855,7 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
case RTE_FLOW_ITEM_TYPE_FLEX:
case RTE_FLOW_ITEM_TYPE_IB_BTH:
case RTE_FLOW_ITEM_TYPE_PTYPE:
case RTE_FLOW_ITEM_TYPE_RANDOM:
break;
case RTE_FLOW_ITEM_TYPE_INTEGRITY:
/*
Expand Down

0 comments on commit 6c2509a

Please sign in to comment.