Skip to contentSkip to conversation

mlx5 updates 2024-09-11

GIT PULL Applied Saeed Mahameed 5 participants 36 messages Sep 11, 2024 – Sep 13, 2024

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

From: Saeed Mahameed <[email protected]>

This series adds misc updates to mlx5 driver, including two fixes requested by Jakub from previous pull.
For more information please see tag log below.

Please pull and let me know if there is any problem.

Thanks,
Saeed.

The following changes since commit bf73478b539b4a13e0b4e104c82fe3c2833db562:

Merge branch 'lan743x-phylink' (2024-09-11 11:06:12 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2024-09-11

for you to fetch changes up to b499dee2426b12c7acccad546d880d601600c915:

net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq (2024-09-11 13:16:03 -0700)

----------------------------------------------------------------
mlx5-updates-2024-09-11

Misc updates to mlx5 driver:

1) Fix HW steering ret value and align with kdoc
2) Flow steering cleanups and add support for no append at software level
3) Support for sync reset using hot reset
4) RX SW counter to cover no-split events in header/data split mode
5) Make affinity of SFs configurable

----------------------------------------------------------------
Dragos Tatulea (1):
net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split

Mark Bloch (4):
net/mlx5: fs, move hardware fte deletion function reset net/mlx5: fs, remove unused member
net/mlx5: fs, separate action and destination into distinct struct net/mlx5: fs, add support for no append at software level

Moshe Shemesh (5):
net/mlx5: fs, move steering common function to fs_cmd.h net/mlx5: fs, make get_root_namespace API function net/mlx5: Add device cap for supporting hot reset in sync reset flow net/mlx5: Add support for sync reset using hot reset net/mlx5: Skip HotPlug check on sync reset using hot reset

Rahul Rameshbabu (1):
net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq

Shay Drory (2):
net/mlx5: Allow users to configure affinity for SFs net/mlx5: Add NOT_READY command return status

Yevgeny Kliteynik (2):
net/mlx5: HWS, updated API functions comments to kernel doc net/mlx5: HWS, fixed error flow return values of some functions

 .../ethernet/mellanox/mlx5/counters.rst            |  16 +
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |   7 +-
 .../mellanox/mlx5/core/diag/fs_tracepoint.h        |   8 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  25 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |   3 +
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.c |   6 +
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.h |   4 +
 drivers/net/ethernet/mellanox/mlx5/core/eq.c       |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c   |  62 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h   |   8 +
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c  | 315 +++++++--
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.h  |  22 +-
 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c |  95 ++-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |   3 +
 .../ethernet/mellanox/mlx5/core/steering/fs_dr.c   |  92 ++-
 .../mellanox/mlx5/core/steering/hws/mlx5hws.h      | 756 ++++++++++-----------
 .../mlx5/core/steering/hws/mlx5hws_matcher.c       |   2 +-
 .../mellanox/mlx5/core/steering/hws/mlx5hws_rule.c |   8 +-
 .../mlx5/core/steering/hws/mlx5hws_table.c         |   2 +-
 include/linux/mlx5/device.h                        |   1 +
 include/linux/mlx5/fs.h                            |   3 +
 include/linux/mlx5/mlx5_ifc.h                      |  11 +-
 22 files changed, 878 insertions(+), 573 deletions(-)
#1 lore raw

PATCH 1/15 net/mlx5: HWS, updated API functions comments to kernel doc

From: Yevgeny Kliteynik <[email protected]>

Changed all the functions comments to adhere with kernel-doc formatting.

---
 .../mellanox/mlx5/core/steering/hws/mlx5hws.h | 756 +++++++++---------
 1 file changed, 364 insertions(+), 392 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h +364 -392
index 9a85d4e12f77..f39d636ff39a 100644
@@ -214,11 +214,12 @@ struct mlx5hws_action_dest_attr {
 	struct mlx5hws_action *reformat;
 };
 
-/* Check whether HWS is supported
+/**
+ * mlx5hws_is_supported - Check whether HWS is supported
  *
- * @param[in] mdev
- *	The device to check.
- * @return true if supported, false otherwise.
+ * @mdev: The device to check.
+ *
+ * Return: true if supported, false otherwise.
  */
 static inline bool mlx5hws_is_supported(struct mlx5_core_dev *mdev)
 {
@@ -234,92 +235,94 @@ static inline bool mlx5hws_is_supported(struct mlx5_core_dev *mdev)
 	return wqe_based_flow_table_update && ignore_flow_level_rtc_valid;
 }
 
-/* Open a context used for direct rule insertion using hardware steering.
- * Each context can contain multiple tables of different types.
+/**
+ * mlx5hws_context_open - Open a context used for direct rule insertion
+ * using hardware steering.
+ *
+ * @mdev: The device to be used for HWS.
+ * @attr: Attributes used for context open.
  *
- * @param[in] mdev
- *	The device to be used for HWS.
- * @param[in] attr
- *	Attributes used for context open.
- * @return pointer to mlx5hws_context on success NULL otherwise.
+ * Return: pointer to mlx5hws_context on success NULL otherwise.
  */
 struct mlx5hws_context *
 mlx5hws_context_open(struct mlx5_core_dev *mdev,
 		     struct mlx5hws_context_attr *attr);
 
-/* Close a context used for direct hardware steering.
+/**
+ * mlx5hws_context_close - Close a context used for direct hardware steering.
  *
- * @param[in] ctx
- *	mlx5hws context to close.
- * @return zero on success non zero otherwise.
+ * @ctx: mlx5hws context to close.
+ *
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_context_close(struct mlx5hws_context *ctx);
 
-/* Set a peer context, each context can have multiple contexts as peers.
+/**
+ * mlx5hws_context_set_peer - Set a peer context.
+ * Each context can have multiple contexts as peers.
  *
- * @param[in] ctx
- *	The context in which the peer_ctx will be peered to it.
- * @param[in] peer_ctx
- *	The peer context.
- * @param[in] peer_vhca_id
- *	The peer context vhca id.
+ * @ctx: The context in which the peer_ctx will be peered to it.
+ * @peer_ctx: The peer context.
+ * @peer_vhca_id: The peer context vhca id.
  */
 void mlx5hws_context_set_peer(struct mlx5hws_context *ctx,
 			      struct mlx5hws_context *peer_ctx,
 			      u16 peer_vhca_id);
 
-/* Create a new direct rule table. Each table can contain multiple matchers.
+/**
+ * mlx5hws_table_create - Create a new direct rule table.
+ * Each table can contain multiple matchers.
+ *
+ * @ctx: The context in which the new table will be opened.
+ * @attr: Attributes used for table creation.
  *
- * @param[in] ctx
- *	The context in which the new table will be opened.
- * @param[in] attr
- *	Attributes used for table creation.
- * @return pointer to mlx5hws_table on success NULL otherwise.
+ * Return: pointer to mlx5hws_table on success NULL otherwise.
  */
 struct mlx5hws_table *
 mlx5hws_table_create(struct mlx5hws_context *ctx,
 		     struct mlx5hws_table_attr *attr);
 
-/* Destroy direct rule table.
+/**
+ * mlx5hws_table_destroy - Destroy direct rule table.
  *
- * @param[in] tbl
- *	Table to destroy.
- * @return zero on success non zero otherwise.
+ * @tbl: Table to destroy.
+ *
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_table_destroy(struct mlx5hws_table *tbl);
 
-/* Get ID of the flow table.
+/**
+ * mlx5hws_table_get_id() - Get ID of the flow table.
+ *
+ * @tbl:Table to get ID of.
  *
- * @param[in] tbl
- *	Table to get ID of.
- * @return ID of the table.
+ * Return: ID of the table.
  */
 u32 mlx5hws_table_get_id(struct mlx5hws_table *tbl);
 
-/* Set default miss table for mlx5hws_table by using another mlx5hws_table
+/**
+ * mlx5hws_table_set_default_miss - Set default miss table for mlx5hws_table
+ * by using another mlx5hws_table.
  * Traffic which all table matchers miss will be forwarded to miss table.
  *
- * @param[in] tbl
- *	Source table
- * @param[in] miss_tbl
- *	Target (miss) table, or NULL to remove current miss table
- * @return zero on success non zero otherwise.
+ * @tbl: Source table
+ * @miss_tbl: Target (miss) table, or NULL to remove current miss table
+ *
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_table_set_default_miss(struct mlx5hws_table *tbl,
 				   struct mlx5hws_table *miss_tbl);
 
-/* Create new match template based on items mask, the match template
- * will be used for matcher creation.
+/**
+ * mlx5hws_match_template_create - Create a new match template based on items mask.
+ * The match template will be used for matcher creation.
+ *
+ * @ctx: The context in which the new template will be created.
+ * @match_param: Describe the mask based on PRM match parameters.
+ * @match_param_sz: Size of match param buffer.
+ * @match_criteria_enable: Bitmap for each sub-set in match_criteria buffer.
  *
- * @param[in] ctx
- *	The context in which the new template will be created.
- * @param[in] match_param
- *	Describe the mask based on PRM match parameters
- * @param[in] match_param_sz
- *	Size of match param buffer
- * @param[in] match_criteria_enable
- *	Bitmap for each sub-set in match_criteria buffer
- * @return pointer to mlx5hws_match_template on success NULL otherwise
+ * Return: Pointer to mlx5hws_match_template on success, NULL otherwise.
  */
 struct mlx5hws_match_template *
 mlx5hws_match_template_create(struct mlx5hws_context *ctx,
@@ -327,52 +330,53 @@ mlx5hws_match_template_create(struct mlx5hws_context *ctx,
 			      u32 match_param_sz,
 			      u8 match_criteria_enable);
 
-/* Destroy match template.
+/**
+ * mlx5hws_match_template_destroy - Destroy a match template.
  *
- * @param[in] mt
- *	Match template to destroy.
- * @return zero on success non zero otherwise.
+ * @mt: Match template to destroy.
+ *
+ * Return: Zero on success, non-zero otherwise.
  */
 int mlx5hws_match_template_destroy(struct mlx5hws_match_template *mt);
 
-/* Create new action template based on action_type array, the action template
- * will be used for matcher creation.
+/**
+ * mlx5hws_action_template_create - Create a new action template based on an action_type array.
+ *
+ * @action_type: An array of actions based on the order of actions which will be provided
+ *               with rule_actions to mlx5hws_rule_create. The last action is marked
+ *               using MLX5HWS_ACTION_TYP_LAST.
  *
- * @param[in] action_type
- *	An array of actions based on the order of actions which will be provided
- *	with rule_actions to mlx5hws_rule_create. The last action is marked
- *	using MLX5HWS_ACTION_TYP_LAST.
- * @return pointer to mlx5hws_action_template on success NULL otherwise
+ * Return: Pointer to mlx5hws_action_template on success, NULL otherwise.
  */
 struct mlx5hws_action_template *
 mlx5hws_action_template_create(enum mlx5hws_action_type action_type[]);
 
-/* Destroy action template.
+/**
+ * mlx5hws_action_template_destroy - Destroy action template.
  *
- * @param[in] at
- *	Action template to destroy.
- * @return zero on success non zero otherwise.
+ * @at: Action template to destroy.
+ *
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_action_template_destroy(struct mlx5hws_action_template *at);
 
-/* Create a new direct rule matcher. Each matcher can contain multiple rules.
- * Matchers on the table will be processed by priority. Matching fields and
- * mask are described by the match template. In some cases multiple match
- * templates can be used on the same matcher.
- *
- * @param[in] table
- *	The table in which the new matcher will be opened.
- * @param[in] mt
- *	Array of match templates to be used on matcher.
- * @param[in] num_of_mt
- *	Number of match templates in mt array.
- * @param[in] at
- *	Array of action templates to be used on matcher.
- * @param[in] num_of_at
- *	Number of action templates in mt array.
- * @param[in] attr
- *	Attributes used for matcher creation.
- * @return pointer to mlx5hws_matcher on success NULL otherwise.
+/**
+ * mlx5hws_matcher_create - Create a new direct rule matcher.
+ *
+ * Each matcher can contain multiple rules. Matchers on the table will be
+ * processed by priority. Matching fields and mask are described by the
+ * match template. In some cases, multiple match templates can be used on
+ * the same matcher.
+ *
+ * @table: The table in which the new matcher will be opened.
+ * @mt: Array of match templates to be used on matcher.
+ * @num_of_mt: Number of match templates in mt array.
+ * @at: Array of action templates to be used on matcher.
+ * @num_of_at: Number of action templates in at array.
+ * @attr: Attributes used for matcher creation.
+ *
+ * Return: Pointer to mlx5hws_matcher on success, NULL otherwise.
+ *
  */
 struct mlx5hws_matcher *
 mlx5hws_matcher_create(struct mlx5hws_table *table,
@@ -382,81 +386,77 @@ mlx5hws_matcher_create(struct mlx5hws_table *table,
 		       u8 num_of_at,
 		       struct mlx5hws_matcher_attr *attr);
 
-/* Destroy direct rule matcher.
+/**
+ * mlx5hws_matcher_destroy - Destroy a direct rule matcher.
  *
- * @param[in] matcher
- *	Matcher to destroy.
- * @return zero on success non zero otherwise.
+ * @matcher: Matcher to destroy.
+ *
+ * Return: Zero on success, non-zero otherwise.
  */
 int mlx5hws_matcher_destroy(struct mlx5hws_matcher *matcher);
 
-/* Attach new action template to direct rule matcher.
+/**
+ * mlx5hws_matcher_attach_at - Attach a new action template to a direct rule matcher.
+ *
+ * @matcher: Matcher to attach the action template to.
+ * @at: Action template to be attached to the matcher.
  *
- * @param[in] matcher
- *	Matcher to attach at to.
- * @param[in] at
- *	Action template to be attached to the matcher.
- * @return zero on success non zero otherwise.
+ * Return: Zero on success, non-zero otherwise.
  */
 int mlx5hws_matcher_attach_at(struct mlx5hws_matcher *matcher,
 			      struct mlx5hws_action_template *at);
 
-/* Link two matchers and enable moving rules from src matcher to dst matcher.
- * Both matchers must be in the same table type, must be created with 'resizable'
- * property, and should have the same characteristics (e.g. same mt, same at).
+/**
+ * mlx5hws_matcher_resize_set_target - Link two matchers and enable moving rules.
  *
- * It is the user's responsibility to make sure that the dst matcher
- * was allocated with the appropriate size.
+ * Both matchers must be in the same table type, must be created with the
+ * 'resizable' property, and should have the same characteristics (e.g., same
+ * match templates and action templates). It is the user's responsibility to
+ * ensure that the destination matcher is allocated with the appropriate size.
  *
  * Once the function is completed, the user is:
- *  - allowed to move rules from src into dst matcher
- *  - no longer allowed to insert rules to the src matcher
+ * - Allowed to move rules from the source into the destination matcher.
+ * - No longer allowed to insert rules into the source matcher.
  *
- * The user is always allowed to insert rules to the dst matcher and
+ * The user is always allowed to insert rules into the destination matcher and
  * to delete rules from any matcher.
  *
- * @param[in] src_matcher
- *	source matcher for moving rules from
- * @param[in] dst_matcher
- *	destination matcher for moving rules to
- * @return zero on successful move, non zero otherwise.
+ * @src_matcher: Source matcher for moving rules from.
+ * @dst_matcher: Destination matcher for moving rules to.
+ *
+ * Return: Zero on successful move, non-zero otherwise.
  */
 int mlx5hws_matcher_resize_set_target(struct mlx5hws_matcher *src_matcher,
 				      struct mlx5hws_matcher *dst_matcher);
 
-/* Enqueue moving rule operation: moving rule from src matcher to a dst matcher
+/**
+ * mlx5hws_matcher_resize_rule_move - Enqueue moving rule operation.
+ *
+ * This function enqueues the operation of moving a rule from the source
+ * matcher to the destination matcher.
  *
- * @param[in] src_matcher
- *	matcher that the rule belongs to
- * @param[in] rule
- *	the rule to move
- * @param[in] attr
- *	rule attributes
- * @return zero on success, non zero otherwise.
+ * @src_matcher: Matcher that the rule belongs to.
+ * @rule: The rule to move.
+ * @attr: Rule attributes.
+ *
+ * Return: Zero on success, non-zero otherwise.
  */
 int mlx5hws_matcher_resize_rule_move(struct mlx5hws_matcher *src_matcher,
 				     struct mlx5hws_rule *rule,
 				     struct mlx5hws_rule_attr *attr);
 
-/* Enqueue create rule operation.
- *
- * @param[in] matcher
- *	The matcher in which the new rule will be created.
- * @param[in] mt_idx
- *	Match template index to create the match with.
- * @param[in] match_param
- *	The match parameter PRM buffer used for the value matching.
- * @param[in] rule_actions
- *	Rule action to be executed on match.
- * @param[in] at_idx
- *	Action template index to apply the actions with.
- * @param[in] num_of_actions
- *	Number of rule actions.
- * @param[in] attr
- *	Rule creation attributes.
- * @param[in, out] rule_handle
- *	A valid rule handle. The handle doesn't require any initialization.
- * @return zero on successful enqueue non zero otherwise.
+/**
+ * mlx5hws_rule_create - Enqueue create rule operation.
+ *
+ * @matcher: The matcher in which the new rule will be created.
+ * @mt_idx: Match template index to create the match with.
+ * @match_param: The match parameter PRM buffer used for value matching.
+ * @at_idx: Action template index to apply the actions with.
+ * @rule_actions: Rule actions to be executed on match.
+ * @attr: Rule creation attributes.
+ * @rule_handle: A valid rule handle. The handle doesn't require any initialization.
+ *
+ * Return: Zero on successful enqueue, non-zero otherwise.
  */
 int mlx5hws_rule_create(struct mlx5hws_matcher *matcher,
 			u8 mt_idx,
@@ -466,114 +466,106 @@ int mlx5hws_rule_create(struct mlx5hws_matcher *matcher,
 			struct mlx5hws_rule_attr *attr,
 			struct mlx5hws_rule *rule_handle);
 
-/* Enqueue destroy rule operation.
+/**
+ * mlx5hws_rule_destroy - Enqueue destroy rule operation.
+ *
+ * @rule: The rule destruction to enqueue.
+ * @attr: Rule destruction attributes.
  *
- * @param[in] rule
- *	The rule destruction to enqueue.
- * @param[in] attr
- *	Rule destruction attributes.
- * @return zero on successful enqueue non zero otherwise.
+ * Return: Zero on successful enqueue, non-zero otherwise.
  */
 int mlx5hws_rule_destroy(struct mlx5hws_rule *rule,
 			 struct mlx5hws_rule_attr *attr);
 
-/* Enqueue update actions on an existing rule.
+/**
+ * mlx5hws_rule_action_update - Enqueue update actions on an existing rule.
  *
- * @param[in, out] rule_handle
- *	A valid rule handle to update.
- * @param[in] at_idx
- *	Action template index to update the actions with.
- *  @param[in] rule_actions
- *	Rule action to be executed on match.
- * @param[in] attr
- *	Rule update attributes.
- * @return zero on successful enqueue non zero otherwise.
+ * @rule: A valid rule handle to update.
+ * @at_idx: Action template index to update the actions with.
+ * @rule_actions: Rule actions to be executed on match.
+ * @attr: Rule update attributes.
+ *
+ * Return: Zero on successful enqueue, non-zero otherwise.
  */
 int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
 			       u8 at_idx,
 			       struct mlx5hws_rule_action rule_actions[],
 			       struct mlx5hws_rule_attr *attr);
 
-/* Get action type.
+/**
+ * mlx5hws_action_get_type - Get action type.
+ *
+ * @action: The action to get the type of.
  *
- * @param[in] action
- *	The action to get the type of.
- * @return action type.
+ * Return: action type.
  */
 enum mlx5hws_action_type
 mlx5hws_action_get_type(struct mlx5hws_action *action);
 
-/* Create direct rule drop action.
+/**
+ * mlx5hws_action_create_dest_drop - Create a direct rule drop action.
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * @ctx: The context in which the new action will be created.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: Pointer to mlx5hws_action on success, NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_dest_drop(struct mlx5hws_context *ctx,
 				u32 flags);
 
-/* Create direct rule default miss action.
- * Defaults are RX: Drop TX: Wire.
+/**
+ * mlx5hws_action_create_default_miss - Create a direct rule default miss action.
+ * Defaults are RX: Drop, TX: Wire.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: Pointer to mlx5hws_action on success, NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_default_miss(struct mlx5hws_context *ctx,
 				   u32 flags);
 
-/* Create direct rule goto table action.
+/**
+ * mlx5hws_action_create_dest_table - Create direct rule goto table action.
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] tbl
- *	Destination table.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * @ctx: The context in which the new action will be created.
+ * @tbl: Destination table.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_dest_table(struct mlx5hws_context *ctx,
 				 struct mlx5hws_table *tbl,
 				 u32 flags);
 
-/* Create direct rule goto table number action.
+/**
+ * mlx5hws_action_create_dest_table_num - Create direct rule goto table number action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @tbl_num: Destination table number.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] tbl_num
- *	Destination table number.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_dest_table_num(struct mlx5hws_context *ctx,
-				     u32 table_num, u32 flags);
-
-/* Create direct rule range match action.
- *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] field
- *	Field to comapare the value.
- * @param[in] hit_ft
- *	Flow table to go to on hit.
- * @param[in] miss_ft
- *	Flow table to go to on miss.
- * @param[in] min
- *	Minimal value of the field to be considered as hit.
- * @param[in] max
- *	Maximal value of the field to be considered as hit.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+				     u32 tbl_num, u32 flags);
+
+/**
+ * mlx5hws_action_create_dest_match_range - Create direct rule range match action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @field: Field to comapare the value.
+ * @hit_ft: Flow table to go to on hit.
+ * @miss_ft: Flow table to go to on miss.
+ * @min: Minimal value of the field to be considered as hit.
+ * @max: Maximal value of the field to be considered as hit.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_dest_match_range(struct mlx5hws_context *ctx,
@@ -582,33 +574,29 @@ mlx5hws_action_create_dest_match_range(struct mlx5hws_context *ctx,
 				       struct mlx5_flow_table *miss_ft,
 				       u32 min, u32 max, u32 flags);
 
-/* Create direct rule flow sampler action.
+/**
+ * mlx5hws_action_create_flow_sampler - Create direct rule flow sampler action.
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] sampler_id
- *	Flow sampler object ID.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * @ctx: The context in which the new action will be created.
+ * @sampler_id: Flow sampler object ID.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_flow_sampler(struct mlx5hws_context *ctx,
 				   u32 sampler_id, u32 flags);
 
-/* Create direct rule goto vport action.
+/**
+ * mlx5hws_action_create_dest_vport - Create direct rule goto vport action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @vport_num: Destination vport number.
+ * @vhca_id_valid: Tells if the vhca_id parameter is valid.
+ * @vhca_id: VHCA ID of the destination vport.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] vport_num
- *	Destination vport number.
- * @param[in] vhca_id_valid
- *	Tells if the vhca_id parameter is valid.
- * @param[in] vhca_id
- *	VHCA ID of the destination vport.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_dest_vport(struct mlx5hws_context *ctx,
@@ -617,48 +605,42 @@ mlx5hws_action_create_dest_vport(struct mlx5hws_context *ctx,
 				 u16 vhca_id,
 				 u32 flags);
 
-/* Create direct rule TAG action.
+/**
+ * mlx5hws_action_create_tag - Create direct rule TAG action.
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * @ctx: The context in which the new action will be created.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
-mlx5hws_action_create_tag(struct mlx5hws_context *ctx,
-			  u32 flags);
+mlx5hws_action_create_tag(struct mlx5hws_context *ctx, u32 flags);
 
-/* Create direct rule counter action.
+/**
+ * mlx5hws_action_create_counter - Create direct rule counter action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @obj_id: Direct rule counter object ID.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] obj_id
- *	Direct rule counter object ID.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_counter(struct mlx5hws_context *ctx,
 			      u32 obj_id,
 			      u32 flags);
 
-/* Create direct rule reformat action.
- *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] reformat_type
- *	Type of reformat prefixed with MLX5HWS_ACTION_TYP_REFORMAT.
- * @param[in] num_of_hdrs
- *	Number of provided headers in "hdrs" array.
- * @param[in] hdrs
- *	Headers array containing header information.
- * @param[in] log_bulk_size
- *	Number of unique values used with this reformat.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+/**
+ * mlx5hws_action_create_reformat - Create direct rule reformat action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @reformat_type: Type of reformat prefixed with MLX5HWS_ACTION_TYP_REFORMAT.
+ * @num_of_hdrs: Number of provided headers in "hdrs" array.
+ * @hdrs: Headers array containing header information.
+ * @log_bulk_size: Number of unique values used with this reformat.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_reformat(struct mlx5hws_context *ctx,
@@ -668,19 +650,16 @@ mlx5hws_action_create_reformat(struct mlx5hws_context *ctx,
 			       u32 log_bulk_size,
 			       u32 flags);
 
-/* Create direct rule modify header action.
+/**
+ * mlx5hws_action_create_modify_header - Create direct rule modify header action.
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] num_of_patterns
- *	Number of provided patterns in "patterns" array.
- * @param[in] patterns
- *	Patterns array containing pattern information.
- * @param[in] log_bulk_size
- *	Number of unique values used with this pattern.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * @ctx: The context in which the new action will be created.
+ * @num_of_patterns: Number of provided patterns in "patterns" array.
+ * @patterns: Patterns array containing pattern information.
+ * @log_bulk_size: Number of unique values used with this pattern.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_modify_header(struct mlx5hws_context *ctx,
@@ -689,17 +668,16 @@ mlx5hws_action_create_modify_header(struct mlx5hws_context *ctx,
 				    u32 log_bulk_size,
 				    u32 flags);
 
-/* Create direct rule ASO flow meter action.
+/**
+ * mlx5hws_action_create_aso_meter - Create direct rule ASO flow meter action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @obj_id: ASO object ID.
+ * @return_reg_c: Copy the ASO object value into this reg_c,
+ *		  after a packet hits a rule with this ASO object.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] obj_id
- *	ASO object ID.
- * @param[in] return_reg_c
- *	Copy the ASO object value into this reg_c, after a packet hits a rule with this ASO object.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_aso_meter(struct mlx5hws_context *ctx,
@@ -707,42 +685,41 @@ mlx5hws_action_create_aso_meter(struct mlx5hws_context *ctx,
 				u8 return_reg_c,
 				u32 flags);
 
-/* Create direct rule pop vlan action.
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+/**
+ * mlx5hws_action_create_pop_vlan - Create direct rule pop vlan action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_pop_vlan(struct mlx5hws_context *ctx, u32 flags);
 
-/* Create direct rule push vlan action.
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+/**
+ * mlx5hws_action_create_push_vlan - Create direct rule push vlan action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_push_vlan(struct mlx5hws_context *ctx, u32 flags);
 
-/* Create a dest array action, this action can duplicate packets and forward to
- * multiple destinations in the destination list.
- * @param[in] ctx
- *     The context in which the new action will be created.
- * @param[in] num_dest
- *     The number of dests attributes.
- * @param[in] dests
- *     The destination array. Each contains a destination action and can have
- *     additional actions.
- * @param[in] ignore_flow_level
- *     Boolean that says whether to turn on 'ignore_flow_level' for this dest.
- * @param[in] flow_source
- *     Source port of the traffic for this actions.
- * @param[in] flags
- *     Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+/**
+ * mlx5hws_action_create_dest_array - Create a dest array action, this action can
+ * duplicate packets and forward to multiple destinations in the destination list.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @num_dest: The number of dests attributes.
+ * @dests: The destination array. Each contains a destination action and can
+ *	   have additional actions.
+ * @ignore_flow_level: Whether to turn on 'ignore_flow_level' for this dest.
+ * @flow_source: Source port of the traffic for this actions.
+ * @flags: Action creation flags (enum mlx5hws_action_flags).
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
@@ -752,19 +729,16 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
 				 u32 flow_source,
 				 u32 flags);
 
-/* Create insert header action.
+/**
+ * mlx5hws_action_create_insert_header - Create insert header action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @num_of_hdrs: Number of provided headers in "hdrs" array.
+ * @hdrs: Headers array containing header information.
+ * @log_bulk_size: Number of unique values used with this insert header.
+ * @flags: Action creation flags. (enum mlx5hws_action_flags)
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] num_of_hdrs
- *	Number of provided headers in "hdrs" array.
- * @param[in] hdrs
- *	Headers array containing header information.
- * @param[in] log_bulk_size
- *	Number of unique values used with this insert header.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_insert_header(struct mlx5hws_context *ctx,
@@ -773,38 +747,38 @@ mlx5hws_action_create_insert_header(struct mlx5hws_context *ctx,
 				    u32 log_bulk_size,
 				    u32 flags);
 
-/* Create remove header action.
+/**
+ * mlx5hws_action_create_remove_header - Create remove header action.
  *
- * @param[in] ctx
- *	The context in which the new action will be created.
- * @param[in] attr
- *	attributes: specifies the remove header type, PRM start anchor and
- *	the PRM end anchor or the PRM start anchor and remove size in bytes.
- * @param[in] flags
- *	Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * @ctx: The context in which the new action will be created.
+ * @attr: attributes that specifie the remove header type, PRM start anchor and
+ *	  the PRM end anchor or the PRM start anchor and remove size in bytes.
+ * @flags: Action creation flags. (enum mlx5hws_action_flags)
+ *
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_remove_header(struct mlx5hws_context *ctx,
 				    struct mlx5hws_action_remove_header_attr *attr,
 				    u32 flags);
 
-/* Create direct rule LAST action.
+/**
+ * mlx5hws_action_create_last - Create direct rule LAST action.
+ *
+ * @ctx: The context in which the new action will be created.
+ * @flags: Action creation flags. (enum mlx5hws_action_flags)
  *
- * @param[in] ctx
- *     The context in which the new action will be created.
- * @param[in] flags
- *     Action creation flags. (enum mlx5hws_action_flags)
- * @return pointer to mlx5hws_action on success NULL otherwise.
+ * Return: pointer to mlx5hws_action on success NULL otherwise.
  */
 struct mlx5hws_action *
 mlx5hws_action_create_last(struct mlx5hws_context *ctx, u32 flags);
 
-/* Destroy direct rule action.
+/**
+ * mlx5hws_action_destroy - Destroy direct rule action.
  *
- * @param[in] action
- *	The action to destroy.
- * @return zero on success non zero otherwise.
+ * @action: The action to destroy.
+ *
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_action_destroy(struct mlx5hws_action *action);
 
@@ -818,42 +792,40 @@ struct mlx5hws_flow_op_result {
 	void *user_data;
 };
 
-/* Poll queue for rule creation and deletions completions.
+/**
+ * mlx5hws_send_queue_poll - Poll queue for rule creation and deletions completions.
+ *
+ * @ctx: The context to which the queue belong to.
+ * @queue_id: The id of the queue to poll.
+ * @res: Completion array.
+ * @res_nb: Maximum number of results to return.
  *
- * @param[in] ctx
- *	The context to which the queue belong to.
- * @param[in] queue_id
- *	The id of the queue to poll.
- * @param[in, out] res
- *	Completion array.
- * @param[in] res_nb
- *	Maximum number of results to return.
- * @return negative number on failure, the number of completions otherwise.
+ * Return: negative number on failure, the number of completions otherwise.
  */
 int mlx5hws_send_queue_poll(struct mlx5hws_context *ctx,
 			    u16 queue_id,
 			    struct mlx5hws_flow_op_result res[],
 			    u32 res_nb);
 
-/* Perform an action on the queue
+/**
+ * mlx5hws_send_queue_action - Perform an action on the queue
  *
- * @param[in] ctx
- *	The context to which the queue belong to.
- * @param[in] queue_id
- *	The id of the queue to perform the action on.
- * @param[in] actions
- *	Actions to perform on the queue. (enum mlx5hws_send_queue_actions)
- * @return zero on success non zero otherwise.
+ * @ctx: The context to which the queue belong to.
+ * @queue_id: The id of the queue to perform the action on.
+ * @actions: Actions to perform on the queue (enum mlx5hws_send_queue_actions)
+ *
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_send_queue_action(struct mlx5hws_context *ctx,
 			      u16 queue_id,
 			      u32 actions);
 
-/* Dump HWS info
+/**
+ * mlx5hws_debug_dump - Dump HWS info
+ *
+ * @ctx: The context which to dump the info from.
  *
- * @param[in] ctx
- *	The context which to dump the info from.
- * @return zero on success non zero otherwise.
+ * Return: zero on success non zero otherwise.
  */
 int mlx5hws_debug_dump(struct mlx5hws_context *ctx);
 
@@ -865,7 +837,9 @@ struct mlx5hws_match_parameters {
 	u32 *match_buf; /* Device spec format */
 };
 
-/* Create a new BWC direct rule matcher.
+/**
+ * mlx5hws_bwc_matcher_create - Create a new BWC direct rule matcher.
+ *
  * This function does the following:
  *   - creates match template based on flow items
  *   - creates an empty action template
@@ -875,15 +849,12 @@ struct mlx5hws_match_parameters {
  *   - table->ctx must have BWC support
  *   - complex rules are not supported
  *
- * @param[in] table
- *	The table in which the new matcher will be opened
- * @param[in] priority
- *	Priority for this BWC matcher
- * @param[in] match_criteria_enable
- *	Bitmask that defines matching criteria
- * @param[in] mask
- *	Match parameters
- * @return pointer to mlx5hws_bwc_matcher on success or NULL otherwise.
+ * @table: The table in which the new matcher will be opened
+ * @priority: Priority for this BWC matcher
+ * @match_criteria_enable: Bitmask that defines matching criteria
+ * @mask: Match parameters
+ *
+ * Return: pointer to mlx5hws_bwc_matcher on success or NULL otherwise.
  */
 struct mlx5hws_bwc_matcher *
 mlx5hws_bwc_matcher_create(struct mlx5hws_table *table,
@@ -891,15 +862,18 @@ mlx5hws_bwc_matcher_create(struct mlx5hws_table *table,
 			   u8 match_criteria_enable,
 			   struct mlx5hws_match_parameters *mask);
 
-/* Destroy BWC direct rule matcher.
+/**
+ * mlx5hws_bwc_matcher_destroy - Destroy BWC direct rule matcher.
  *
- * @param[in] bwc_matcher
- *	Matcher to destroy
- * @return zero on success, non zero otherwise
+ * @bwc_matcher: Matcher to destroy
+ *
+ * Return: zero on success, non zero otherwise
  */
 int mlx5hws_bwc_matcher_destroy(struct mlx5hws_bwc_matcher *bwc_matcher);
 
-/* Create a new BWC rule.
+/**
+ * mlx5hws_bwc_rule_create - Create a new BWC rule.
+ *
  * Unlike the usual rule creation function, this one is blocking: when the
  * function returns, the rule is written to its place (no need to poll).
  * This function does the following:
@@ -916,15 +890,12 @@ int mlx5hws_bwc_matcher_destroy(struct mlx5hws_bwc_matcher *bwc_matcher);
  *   - matcher->tbl->ctx must have BWC support
  *   - separate BWC ctx queues are used
  *
- * @param[in] bwc_matcher
- *	The BWC matcher in which the new rule will be created.
- * @param[in] params
- *	Match perameters
- * @param[in] flow_source
- *	Flow source for this rule
- * @param[in] rule_actions
- *	Rule action to be executed on match
- * @return valid BWC rule handle on success, NULL otherwise
+ * @bwc_matcher: The BWC matcher in which the new rule will be created.
+ * @params: Match perameters
+ * @flow_source: Flow source for this rule
+ * @rule_actions: Rule action to be executed on match
+ *
+ * Return: valid BWC rule handle on success, NULL otherwise
  */
 struct mlx5hws_bwc_rule *
 mlx5hws_bwc_rule_create(struct mlx5hws_bwc_matcher *bwc_matcher,
@@ -932,21 +903,22 @@ mlx5hws_bwc_rule_create(struct mlx5hws_bwc_matcher *bwc_matcher,
 			u32 flow_source,
 			struct mlx5hws_rule_action rule_actions[]);
 
-/* Destroy BWC direct rule.
+/**
+ * mlx5hws_bwc_rule_destroy - Destroy BWC direct rule.
+ *
+ * @bwc_rule: Rule to destroy.
  *
- * @param[in] bwc_rule
- *	Rule to destroy
- * @return zero on success, non zero otherwise
+ * Return: zero on success, non zero otherwise.
  */
 int mlx5hws_bwc_rule_destroy(struct mlx5hws_bwc_rule *bwc_rule);
 
-/* Update actions on an existing BWC rule.
+/**
+ * mlx5hws_bwc_rule_action_update - Update actions on an existing BWC rule.
+ *
+ * @bwc_rule: Rule to update
+ * @rule_actions: Rule action to update with
  *
- * @param[in] bwc_rule
- *	Rule to update
- * @param[in] rule_actions
- *	Rule action to update with
- * @return zero on successful update, non zero otherwise.
+ * Return: zero on successful update, non zero otherwise.
  */
 int mlx5hws_bwc_rule_action_update(struct mlx5hws_bwc_rule *bwc_rule,
 				   struct mlx5hws_rule_action rule_actions[]);
Signature · 1 line
2.46.0
Reviewed-by on v1 1/15
#2 lore raw

Re: [net-next 01/15] net/mlx5: HWS, updated API functions comments to kernel doc

Quoted 7 lines · Saeed Mahameed

From: Yevgeny Kliteynik <[email protected]>

Changed all the functions comments to adhere with kernel-doc formatting.

---

I also ran the header through kernel-doc with -Wall and didn't see any issues.

#3 lore raw

Re: [net-next 01/15] net/mlx5: HWS, updated API functions comments to kernel doc

In reply to Saeed Mahameed
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 11 Sep 2024 13:17:43 -0700 you wrote:

From: Yevgeny Kliteynik <[email protected]>

Changed all the functions comments to adhere with kernel-doc formatting.

[...]

Here is the summary with links:
- [net-next,01/15] net/mlx5: HWS, updated API functions comments to kernel doc

    https://git.kernel.org/netdev/net-next/c/e2e9ddf8775b
  - [net-next,02/15] net/mlx5: HWS, fixed error flow return values of some functions
    https://git.kernel.org/netdev/net-next/c/3f4c38df5b0f
  - [net-next,03/15] net/mlx5: fs, move steering common function to fs_cmd.h
    https://git.kernel.org/netdev/net-next/c/48eb74e878e0
  - [net-next,04/15] net/mlx5: fs, make get_root_namespace API function
    https://git.kernel.org/netdev/net-next/c/da2f660b3ba1
  - [net-next,05/15] net/mlx5: fs, move hardware fte deletion function reset
    https://git.kernel.org/netdev/net-next/c/940390d97690
  - [net-next,06/15] net/mlx5: fs, remove unused member
    https://git.kernel.org/netdev/net-next/c/8ad0e9608c2c
  - [net-next,07/15] net/mlx5: fs, separate action and destination into distinct struct
    https://git.kernel.org/netdev/net-next/c/ef7b79b924e5
  - [net-next,08/15] net/mlx5: fs, add support for no append at software level
    https://git.kernel.org/netdev/net-next/c/1217e6989c99
  - [net-next,09/15] net/mlx5: Add device cap for supporting hot reset in sync reset flow
    https://git.kernel.org/netdev/net-next/c/9947204cdad9
  - [net-next,10/15] net/mlx5: Add support for sync reset using hot reset
    https://git.kernel.org/netdev/net-next/c/57502f62678c
  - [net-next,11/15] net/mlx5: Skip HotPlug check on sync reset using hot reset
    https://git.kernel.org/netdev/net-next/c/48bb52b0bc66
  - [net-next,12/15] net/mlx5: Allow users to configure affinity for SFs
    https://git.kernel.org/netdev/net-next/c/9c754d097073
  - [net-next,13/15] net/mlx5: Add NOT_READY command return status
    https://git.kernel.org/netdev/net-next/c/5bd877093fd0
  - [net-next,14/15] net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split
    https://git.kernel.org/netdev/net-next/c/909fc8d107b7
  - [net-next,15/15] net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq
    https://git.kernel.org/netdev/net-next/c/cc1812918930

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#4 lore raw

PATCH 2/15 net/mlx5: HWS, fixed error flow return values of some functions

In reply to Saeed Mahameed

From: Yevgeny Kliteynik <[email protected]>

Fixed all the '-ret' returns in error flow of functions to 'ret', as the internal functions are already returning negative error values (e.g. -EINVAL)

---
 .../mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c     | 2 +-
 .../mellanox/mlx5/core/steering/hws/mlx5hws_rule.c        | 8 ++++----
 .../mellanox/mlx5/core/steering/hws/mlx5hws_table.c       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c +1 -1
index 1964261415aa..33d2b31e4b46 100644
@@ -967,7 +967,7 @@ int mlx5hws_matcher_attach_at(struct mlx5hws_matcher *matcher,
 
 	ret = hws_matcher_check_and_process_at(matcher, at);
 	if (ret)
-		return -ret;
+		return ret;
 
 	required_stes = at->num_of_action_stes - (!is_jumbo || at->only_term);
 	if (matcher->action_ste[MLX5HWS_ACTION_STE_IDX_ANY].max_stes < required_stes) {
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c +4 -4
index c79ee70edf03..8a011b958b43 100644
@@ -751,11 +751,11 @@ int mlx5hws_rule_destroy(struct mlx5hws_rule *rule,
 
 	ret = hws_rule_enqueue_precheck(rule, attr);
 	if (unlikely(ret))
-		return -ret;
+		return ret;
 
 	ret = hws_rule_destroy_hws(rule, attr);
 
-	return -ret;
+	return ret;
 }
 
 int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
@@ -767,7 +767,7 @@ int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
 
 	ret = hws_rule_enqueue_precheck_update(rule, attr);
 	if (unlikely(ret))
-		return -ret;
+		return ret;
 
 	ret = hws_rule_create_hws(rule,
 				  attr,
@@ -776,5 +776,5 @@ int mlx5hws_rule_action_update(struct mlx5hws_rule *rule,
 				  at_idx,
 				  rule_actions);
 
-	return -ret;
+	return ret;
 }
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c +1 -1
index 9dbc3e9da5ea..8c063a8d87d7 100644
@@ -489,5 +489,5 @@ int mlx5hws_table_set_default_miss(struct mlx5hws_table *tbl,
 	return 0;
 out:
 	mutex_unlock(&ctx->ctrl_lock);
-	return -ret;
+	return ret;
 }
Signature · 1 line
2.46.0
Reviewed-by on v1 2/15
#5 lore raw

Re: [net-next 02/15] net/mlx5: HWS, fixed error flow return values of some functions

Quoted 9 lines · Saeed Mahameed

From: Yevgeny Kliteynik <[email protected]>

Fixed all the '-ret' returns in error flow of functions to 'ret', as the internal functions are already returning negative error values (e.g. -EINVAL)

---

#6 lore raw

PATCH 3/15 net/mlx5: fs, move steering common function to fs_cmd.h

In reply to Saeed Mahameed

From: Moshe Shemesh <[email protected]>

As preparation for HW steering support in fs core level, move SW steering helper function that can be reused by HW steering to fs_cmd.h. The function mlx5_fs_cmd_is_fw_term_table() checks if a flow table is a flow steering termination table and so should be handled by FW steering.

---
 .../net/ethernet/mellanox/mlx5/core/fs_cmd.h  |  8 +++++++
 .../mellanox/mlx5/core/steering/fs_dr.c       | 24 +++++++------------
 2 files changed, 16 insertions(+), 16 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h +8 -0
index 53e0e5137d3f..7eb7b3ffe3d8 100644
@@ -124,4 +124,12 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_fw_cmds(void);
 
 int mlx5_fs_cmd_set_l2table_entry_silent(struct mlx5_core_dev *dev, u8 silent_mode);
 int mlx5_fs_cmd_set_tx_flow_table_root(struct mlx5_core_dev *dev, u32 ft_id, bool disconnect);
+
+static inline bool mlx5_fs_cmd_is_fw_term_table(struct mlx5_flow_table *ft)
+{
+	if (ft->flags & MLX5_FLOW_TABLE_TERMINATION)
+		return true;
+
+	return false;
+}
 #endif
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +8 -16
index 50c2554c9ccf..40d06051cdc6 100644
@@ -9,14 +9,6 @@
 #include "fs_dr.h"
 #include "dr_types.h"
 
-static bool dr_is_fw_term_table(struct mlx5_flow_table *ft)
-{
-	if (ft->flags & MLX5_FLOW_TABLE_TERMINATION)
-		return true;
-
-	return false;
-}
-
 static int mlx5_cmd_dr_update_root_ft(struct mlx5_flow_root_namespace *ns,
 				      struct mlx5_flow_table *ft,
 				      u32 underlay_qpn,
@@ -70,7 +62,7 @@ static int mlx5_cmd_dr_create_flow_table(struct mlx5_flow_root_namespace *ns,
 	u32 flags;
 	int err;
 
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->create_flow_table(ns, ft,
 								    ft_attr,
 								    next_ft);
@@ -110,7 +102,7 @@ static int mlx5_cmd_dr_destroy_flow_table(struct mlx5_flow_root_namespace *ns,
 	struct mlx5dr_action *action = ft->fs_dr_table.miss_action;
 	int err;
 
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->destroy_flow_table(ns, ft);
 
 	err = mlx5dr_table_destroy(ft->fs_dr_table.dr_table);
@@ -135,7 +127,7 @@ static int mlx5_cmd_dr_modify_flow_table(struct mlx5_flow_root_namespace *ns,
 					 struct mlx5_flow_table *ft,
 					 struct mlx5_flow_table *next_ft)
 {
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->modify_flow_table(ns, ft, next_ft);
 
 	return set_miss_action(ns, ft, next_ft);
@@ -154,7 +146,7 @@ static int mlx5_cmd_dr_create_flow_group(struct mlx5_flow_root_namespace *ns,
 					    match_criteria_enable);
 	struct mlx5dr_match_parameters mask;
 
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->create_flow_group(ns, ft, in,
 								    fg);
 
@@ -179,7 +171,7 @@ static int mlx5_cmd_dr_destroy_flow_group(struct mlx5_flow_root_namespace *ns,
 					  struct mlx5_flow_table *ft,
 					  struct mlx5_flow_group *fg)
 {
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->destroy_flow_group(ns, ft, fg);
 
 	return mlx5dr_matcher_destroy(fg->fs_dr_matcher.dr_matcher);
@@ -279,7 +271,7 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
 	int err = 0;
 	int i;
 
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->create_fte(ns, ft, group, fte);
 
 	actions = kcalloc(MLX5_FLOW_CONTEXT_ACTION_MAX, sizeof(*actions),
@@ -740,7 +732,7 @@ static int mlx5_cmd_dr_delete_fte(struct mlx5_flow_root_namespace *ns,
 	int err;
 	int i;
 
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->delete_fte(ns, ft, fte);
 
 	err = mlx5dr_rule_destroy(rule->dr_rule);
@@ -765,7 +757,7 @@ static int mlx5_cmd_dr_update_fte(struct mlx5_flow_root_namespace *ns,
 	struct fs_fte fte_tmp = {};
 	int ret;
 
-	if (dr_is_fw_term_table(ft))
+	if (mlx5_fs_cmd_is_fw_term_table(ft))
 		return mlx5_fs_cmd_get_fw_cmds()->update_fte(ns, ft, group, modify_mask, fte);
 
 	/* Backup current dr rule details */
Signature · 1 line
2.46.0
Reviewed-by on v1 3/15
#7 lore raw

Re: [net-next 03/15] net/mlx5: fs, move steering common function to fs_cmd.h

Quoted 11 lines · Saeed Mahameed

From: Moshe Shemesh <[email protected]>

As preparation for HW steering support in fs core level, move SW steering helper function that can be reused by HW steering to fs_cmd.h. The function mlx5_fs_cmd_is_fw_term_table() checks if a flow table is a flow steering termination table and so should be handled by FW steering.

---

#8 lore raw

PATCH 4/15 net/mlx5: fs, make get_root_namespace API function

In reply to Saeed Mahameed

From: Moshe Shemesh <[email protected]>

As preparation for HW Steering support, where the function get_root_namespace() is needed to get root FDB, make it an API function and rename it to mlx5_get_root_namespace().

---
 .../net/ethernet/mellanox/mlx5/core/fs_core.c    | 16 ++++++++--------
 include/linux/mlx5/fs.h                          |  3 +++
 2 files changed, 11 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +8 -8
index a47d6419160d..e32725487702 100644
@@ -3590,8 +3590,8 @@ int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn)
 }
 EXPORT_SYMBOL(mlx5_fs_remove_rx_underlay_qpn);
 
-static struct mlx5_flow_root_namespace
-*get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
+struct mlx5_flow_root_namespace *
+mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
 {
 	struct mlx5_flow_namespace *ns;
 
@@ -3614,7 +3614,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
 	struct mlx5_modify_hdr *modify_hdr;
 	int err;
 
-	root = get_root_namespace(dev, ns_type);
+	root = mlx5_get_root_namespace(dev, ns_type);
 	if (!root)
 		return ERR_PTR(-EOPNOTSUPP);
 
@@ -3639,7 +3639,7 @@ void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
 {
 	struct mlx5_flow_root_namespace *root;
 
-	root = get_root_namespace(dev, modify_hdr->ns_type);
+	root = mlx5_get_root_namespace(dev, modify_hdr->ns_type);
 	if (WARN_ON(!root))
 		return;
 	root->cmds->modify_header_dealloc(root, modify_hdr);
@@ -3655,7 +3655,7 @@ struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,
 	struct mlx5_flow_root_namespace *root;
 	int err;
 
-	root = get_root_namespace(dev, ns_type);
+	root = mlx5_get_root_namespace(dev, ns_type);
 	if (!root)
 		return ERR_PTR(-EOPNOTSUPP);
 
@@ -3681,7 +3681,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
 {
 	struct mlx5_flow_root_namespace *root;
 
-	root = get_root_namespace(dev, pkt_reformat->ns_type);
+	root = mlx5_get_root_namespace(dev, pkt_reformat->ns_type);
 	if (WARN_ON(!root))
 		return;
 	root->cmds->packet_reformat_dealloc(root, pkt_reformat);
@@ -3703,7 +3703,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev,
 	struct mlx5_flow_definer *definer;
 	int id;
 
-	root = get_root_namespace(dev, ns_type);
+	root = mlx5_get_root_namespace(dev, ns_type);
 	if (!root)
 		return ERR_PTR(-EOPNOTSUPP);
 
@@ -3727,7 +3727,7 @@ void mlx5_destroy_match_definer(struct mlx5_core_dev *dev,
 {
 	struct mlx5_flow_root_namespace *root;
 
-	root = get_root_namespace(dev, definer->ns_type);
+	root = mlx5_get_root_namespace(dev, definer->ns_type);
 	if (WARN_ON(!root))
 		return;
 
include/linux/mlx5/fs.h +3 -0
index 3fb428ce7d1c..b744e554f014 100644
@@ -342,4 +342,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
 				  struct mlx5_pkt_reformat *reformat);
 
 u32 mlx5_flow_table_id(struct mlx5_flow_table *ft);
+
+struct mlx5_flow_root_namespace *
+mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type);
 #endif
Signature · 1 line
2.46.0
Reviewed-by on v1 4/15
#9 lore raw

Re: [net-next 04/15] net/mlx5: fs, make get_root_namespace API function

Quoted 10 lines · Saeed Mahameed

From: Moshe Shemesh <[email protected]>

As preparation for HW Steering support, where the function get_root_namespace() is needed to get root FDB, make it an API function and rename it to mlx5_get_root_namespace().

---

Reviewed-by on v1 4/15
#10 lore raw

Re: [net-next 04/15] net/mlx5: fs, make get_root_namespace API function

In reply to Saeed Mahameed
Quoted 11 lines · Saeed Mahameed

From: Moshe Shemesh <[email protected]>

As preparation for HW Steering support, where the function get_root_namespace() is needed to get root FDB, make it an API function and rename it to mlx5_get_root_namespace().

---

Signature · 2 lines
Regards,
Kalesh A P
#11 lore raw

PATCH 5/15 net/mlx5: fs, move hardware fte deletion function reset

In reply to Saeed Mahameed

From: Mark Bloch <[email protected]>

Downstream patches will need this as we might not want to reset it when a pending rule is connected to the FTE.

---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 -2
index e32725487702..899d91577a54 100644
@@ -683,6 +683,8 @@ static void del_hw_fte(struct fs_node *node)
 				       fte->index, fg->id);
 		node->active = false;
 	}
+	/* Avoid double call to del_hw_fte */
+	fte->node.del_hw_func = NULL;
 }
 
 static void del_sw_fte(struct fs_node *node)
@@ -2265,8 +2267,6 @@ void mlx5_del_flow_rules(struct mlx5_flow_handle *handle)
 		tree_remove_node(&handle->rule[i]->node, true);
 	if (list_empty(&fte->node.children)) {
 		fte->node.del_hw_func(&fte->node);
-		/* Avoid double call to del_hw_fte */
-		fte->node.del_hw_func = NULL;
 		up_write_ref_node(&fte->node, false);
 		tree_put_node(&fte->node, false);
 	} else if (fte->dests_size) {
Signature · 1 line
2.46.0
Reviewed-by on v1 5/15
#12 lore raw

Re: [net-next 05/15] net/mlx5: fs, move hardware fte deletion function reset

Quoted 5 lines · Saeed Mahameed

From: Mark Bloch <[email protected]>

Downstream patches will need this as we might not want to reset it when a pending rule is connected to the FTE.

At first I didn't quite understand the motivation here but...

Quoted 20 lines
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 -0
index e32725487702..899d91577a54 100644
@@ -683,6 +683,8 @@ static void del_hw_fte(struct fs_node *node)
 				       fte->index, fg->id);
 		node->active = false;
 	}
+	/* Avoid double call to del_hw_fte */
+	fte->node.del_hw_func = NULL;
 }
 
 static void del_sw_fte(struct fs_node *node)

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c void mlx5_del_flow_rules(struct mlx5_flow_handle *handle) · line 2269

Quoted 5 lines
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +0 -2
@@ -2265,8 +2267,6 @@ void mlx5_del_flow_rules(struct mlx5_flow_handle *handle)
 		tree_remove_node(&handle->rule[i]->node, true);
 	if (list_empty(&fte->node.children)) {
 		fte->node.del_hw_func(&fte->node);
-		/* Avoid double call to del_hw_fte */
-		fte->node.del_hw_func = NULL;

I see. You were previously clearing del_hw_func after calling the function. Now, it gets cleared by the del_hw_func implementation?

That does feel slightly brittle to me when thinking about this as an API. On the other hand, it also seems reasonable to ensure that the function gets cleared whenever you call it since it should only be called once?

Quoted 3 lines
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +0 -0
 		up_write_ref_node(&fte->node, false);
 		tree_put_node(&fte->node, false);
 	} else if (fte->dests_size) {
#13 lore raw

PATCH 6/15 net/mlx5: fs, remove unused member

In reply to Saeed Mahameed

From: Mark Bloch <[email protected]>

Counter is in struct fte, remove it.

---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +0 -1
index 6201647d6156..5eacf64232f7 100644
@@ -241,7 +241,6 @@ struct fs_fte {
 	struct mlx5_flow_context	flow_context;
 	struct mlx5_flow_act		action;
 	enum fs_fte_status		status;
-	struct mlx5_fc			*counter;
 	struct rhash_head		hash;
 	int				modify_mask;
 };
Signature · 1 line
2.46.0
Reviewed-by on v1 6/15
#14 lore raw

Re: [net-next 06/15] net/mlx5: fs, remove unused member

Quoted 15 lines · Saeed Mahameed

From: Mark Bloch <[email protected]>

Counter is in struct fte, remove it.

---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +0 -0
index 6201647d6156..5eacf64232f7 100644

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h struct fs_fte { · line 244

Quoted 5 lines
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +0 -1
@@ -241,7 +241,6 @@ struct fs_fte {
 	struct mlx5_flow_context	flow_context;
 	struct mlx5_flow_act		action;
 	enum fs_fte_status		status;
-	struct mlx5_fc			*counter;
 	struct rhash_head		hash;

It looks like this was added by commit bd5251dbf156 ("net/mlx5_core:
Introduce flow steering destination of type counter") and never directly used. The pointer appears to also be stored in the mlx5_flow_destination which is the only place it was directly used.

Makes sense.

Quoted 2 lines
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +0 -0
 	int				modify_mask;
 };
#15 lore raw

PATCH 7/15 net/mlx5: fs, separate action and destination into distinct struct

In reply to Saeed Mahameed

From: Mark Bloch <[email protected]>

Introduce a dedicated structure to encapsulate flow context, actions, destination count, and modification mask. This refactoring lays the groundwork for forthcoming patches that will integrate the NO APPEND software logic. Future modifications should focus solely on these specific fields.

---
 .../mellanox/mlx5/core/diag/fs_tracepoint.h   |  8 +--
 .../net/ethernet/mellanox/mlx5/core/fs_cmd.c  | 60 ++++++++---------
 .../net/ethernet/mellanox/mlx5/core/fs_core.c | 56 ++++++++--------
 .../net/ethernet/mellanox/mlx5/core/fs_core.h | 14 ++--
 .../mellanox/mlx5/core/steering/fs_dr.c       | 64 ++++++++++---------
 5 files changed, 104 insertions(+), 98 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h +4 -4
index ddf1b87f1bc0..9aed29fa4900 100644
@@ -203,10 +203,10 @@ TRACE_EVENT(mlx5_fs_set_fte,
 			   fs_get_obj(__entry->fg, fte->node.parent);
 			   __entry->group_index = __entry->fg->id;
 			   __entry->index = fte->index;
-			   __entry->action = fte->action.action;
+			   __entry->action = fte->act_dests.action.action;
 			   __entry->mask_enable = __entry->fg->mask.match_criteria_enable;
-			   __entry->flow_tag = fte->flow_context.flow_tag;
-			   __entry->flow_source = fte->flow_context.flow_source;
+			   __entry->flow_tag = fte->act_dests.flow_context.flow_tag;
+			   __entry->flow_source = fte->act_dests.flow_context.flow_source;
 			   memcpy(__entry->mask_outer,
 				  MLX5_ADDR_OF(fte_match_param,
 					       &__entry->fg->mask.match_criteria,
@@ -284,7 +284,7 @@ TRACE_EVENT(mlx5_fs_add_rule,
 	    TP_fast_assign(
 			   __entry->rule = rule;
 			   fs_get_obj(__entry->fte, rule->node.parent);
-			   __entry->index = __entry->fte->dests_size - 1;
+			   __entry->index = __entry->fte->act_dests.dests_size - 1;
 			   __entry->sw_action = rule->sw_action;
 			   memcpy(__entry->destination,
 				  &rule->dest_attr,
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +30 -30

152 lines not on this page · raw message

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +28 -28

145 lines not on this page · raw message

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +9 -5
index 5eacf64232f7..19ba63063d09 100644
@@ -230,19 +230,23 @@ struct mlx5_ft_underlay_qp {
 			   MLX5_BYTE_OFF(fte_match_param,		     \
 					 MLX5_FTE_MATCH_PARAM_RESERVED)))
 
+struct fs_fte_action {
+	int				modify_mask;
+	u32				dests_size;
+	u32				fwd_dests;
+	struct mlx5_flow_context	flow_context;
+	struct mlx5_flow_act		action;
+};
+
 /* Type of children is mlx5_flow_rule */
 struct fs_fte {
 	struct fs_node			node;
 	struct mlx5_fs_dr_rule		fs_dr_rule;
 	u32				val[MLX5_ST_SZ_DW_MATCH_PARAM];
-	u32				dests_size;
-	u32				fwd_dests;
+	struct fs_fte_action		act_dests;
 	u32				index;
-	struct mlx5_flow_context	flow_context;
-	struct mlx5_flow_act		action;
 	enum fs_fte_status		status;
 	struct rhash_head		hash;
-	int				modify_mask;
 };
 
 /* Type of children is mlx5_flow_table/namespace */
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +33 -31

173 lines not on this page · raw message

Signature · 1 line
2.46.0
Reviewed-by on v1 7/15
#16 lore raw

Re: [net-next 07/15] net/mlx5: fs, separate action and destination into distinct struct

Quoted 11 lines · Saeed Mahameed

From: Mark Bloch <[email protected]>

Introduce a dedicated structure to encapsulate flow context, actions, destination count, and modification mask. This refactoring lays the groundwork for forthcoming patches that will integrate the NO APPEND software logic. Future modifications should focus solely on these specific fields.

---

#17 lore raw

PATCH 8/15 net/mlx5: fs, add support for no append at software level

In reply to Saeed Mahameed

From: Mark Bloch <[email protected]>

Native capability for some steering engines lacks support for adding an additional match with the same value to the same flow group. To accommodate the NO APPEND flag in these scenarios, we include the new rule in the existing flow table entry (fte) without immediate hardware commitment. When a request is made to delete the corresponding hardware rule, we then commit the pending rule to hardware.

Only one pending rule is supported because NO_APPEND is primarily used during replacement operations. In this scenario, a rule is initially added. When it needs replacement, the new rule is added with NO_APPEND set. Only after the insertion of the new rule is the original rule deleted.

---
 .../net/ethernet/mellanox/mlx5/core/fs_cmd.c  |   2 +-
 .../net/ethernet/mellanox/mlx5/core/fs_core.c | 245 +++++++++++++++++-
 .../net/ethernet/mellanox/mlx5/core/fs_core.h |   7 +
 .../mellanox/mlx5/core/steering/fs_dr.c       |   4 +-
 4 files changed, 242 insertions(+), 16 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +1 -1
index 1a14f8dd878f..676005854dad 100644
@@ -1071,7 +1071,7 @@ static int mlx5_cmd_create_match_definer(struct mlx5_flow_root_namespace *ns,
 static u32 mlx5_cmd_get_capabilities(struct mlx5_flow_root_namespace *ns,
 				     enum fs_flow_table_type ft_type)
 {
-	return 0;
+	return MLX5_FLOW_STEERING_CAP_DUPLICATE_MATCH;
 }
 
 static const struct mlx5_flow_cmds mlx5_flow_cmds = {
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +232 -13

336 lines not on this page · raw message

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +7 -0
index 19ba63063d09..964937f17cf5 100644
@@ -133,6 +133,7 @@ enum mlx5_flow_steering_capabilty {
 	MLX5_FLOW_STEERING_CAP_VLAN_PUSH_ON_RX = 1UL << 0,
 	MLX5_FLOW_STEERING_CAP_VLAN_POP_ON_TX = 1UL << 1,
 	MLX5_FLOW_STEERING_CAP_MATCH_RANGES = 1UL << 2,
+	MLX5_FLOW_STEERING_CAP_DUPLICATE_MATCH = 1UL << 3,
 };
 
 struct mlx5_flow_steering {
@@ -238,12 +239,18 @@ struct fs_fte_action {
 	struct mlx5_flow_act		action;
 };
 
+struct fs_fte_dup {
+	struct list_head children;
+	struct fs_fte_action act_dests;
+};
+
 /* Type of children is mlx5_flow_rule */
 struct fs_fte {
 	struct fs_node			node;
 	struct mlx5_fs_dr_rule		fs_dr_rule;
 	u32				val[MLX5_ST_SZ_DW_MATCH_PARAM];
 	struct fs_fte_action		act_dests;
+	struct fs_fte_dup		*dup;
 	u32				index;
 	enum fs_fte_status		status;
 	struct rhash_head		hash;
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +2 -2
index 15ef118eade0..833cb68c744f 100644
@@ -813,11 +813,11 @@ static int mlx5_cmd_dr_destroy_ns(struct mlx5_flow_root_namespace *ns)
 static u32 mlx5_cmd_dr_get_capabilities(struct mlx5_flow_root_namespace *ns,
 					enum fs_flow_table_type ft_type)
 {
-	u32 steering_caps = 0;
+	u32 steering_caps = MLX5_FLOW_STEERING_CAP_DUPLICATE_MATCH;
 
 	if (ft_type != FS_FT_FDB ||
 	    MLX5_CAP_GEN(ns->dev, steering_format_version) == MLX5_STEERING_FORMAT_CONNECTX_5)
-		return 0;
+		return steering_caps;
 
 	steering_caps |= MLX5_FLOW_STEERING_CAP_VLAN_PUSH_ON_RX;
 	steering_caps |= MLX5_FLOW_STEERING_CAP_VLAN_POP_ON_TX;
Signature · 1 line
2.46.0
Reviewed-by on v1 8/15
#18 lore raw

Re: [net-next 08/15] net/mlx5: fs, add support for no append at software level

Quoted 9 lines · Saeed Mahameed

From: Mark Bloch <[email protected]>

Native capability for some steering engines lacks support for adding an additional match with the same value to the same flow group. To accommodate the NO APPEND flag in these scenarios, we include the new rule in the existing flow table entry (fte) without immediate hardware commitment. When a request is made to delete the corresponding hardware rule, we then commit the pending rule to hardware.

Quoted 8 lines

Only one pending rule is supported because NO_APPEND is primarily used during replacement operations. In this scenario, a rule is initially added. When it needs replacement, the new rule is added with NO_APPEND set. Only after the insertion of the new rule is the original rule deleted.

---

#19 lore raw

PATCH 9/15 net/mlx5: Add device cap for supporting hot reset in sync reset flow

In reply to Saeed Mahameed

From: Moshe Shemesh <[email protected]>

New devices with new FW can support sync reset for firmware activate using hot reset. Add capability for supporting it and add MFRL field to query from FW which type of PCI reset method to use while handling sync reset events.

---
 include/linux/mlx5/mlx5_ifc.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
include/linux/mlx5/mlx5_ifc.h +9 -2
index b6f8e3834bd3..542da2b066d1 100644
@@ -1855,7 +1855,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8         reserved_at_328[0x2];
 	u8	   relaxed_ordering_read[0x1];
 	u8         log_max_pd[0x5];
-	u8         reserved_at_330[0x6];
+	u8         reserved_at_330[0x5];
+	u8         pcie_reset_using_hotreset_method[0x1];
 	u8         pci_sync_for_fw_update_with_driver_unload[0x1];
 	u8         vnic_env_cnt_steering_fail[0x1];
 	u8         vport_counter_local_loopback[0x1];
@@ -11180,6 +11181,11 @@ struct mlx5_ifc_mcda_reg_bits {
 	u8         data[][0x20];
 };
 
+enum {
+	MLX5_MFRL_REG_PCI_RESET_METHOD_LINK_TOGGLE = 0,
+	MLX5_MFRL_REG_PCI_RESET_METHOD_HOT_RESET = 1,
+};
+
 enum {
 	MLX5_MFRL_REG_RESET_STATE_IDLE = 0,
 	MLX5_MFRL_REG_RESET_STATE_IN_NEGOTIATION = 1,
@@ -11207,7 +11213,8 @@ struct mlx5_ifc_mfrl_reg_bits {
 	u8         pci_sync_for_fw_update_start[0x1];
 	u8         pci_sync_for_fw_update_resp[0x2];
 	u8         rst_type_sel[0x3];
-	u8         reserved_at_28[0x4];
+	u8         pci_reset_req_method[0x3];
+	u8         reserved_at_2b[0x1];
 	u8         reset_state[0x4];
 	u8         reset_type[0x8];
 	u8         reset_level[0x8];
Signature · 1 line
2.46.0
Reviewed-by on v1 9/15
#20 lore raw

Re: [net-next 09/15] net/mlx5: Add device cap for supporting hot reset in sync reset flow

Quoted 10 lines · Saeed Mahameed

From: Moshe Shemesh <[email protected]>

New devices with new FW can support sync reset for firmware activate using hot reset. Add capability for supporting it and add MFRL field to query from FW which type of PCI reset method to use while handling sync reset events.

---

#21 lore raw

PATCH 10/15 net/mlx5: Add support for sync reset using hot reset

In reply to Saeed Mahameed

From: Moshe Shemesh <[email protected]>

On device that supports sync reset for firmware activate using hot reset, the driver queries the required reset method while handling the sync reset request. If the required reset method is hot reset, the driver will use pci_reset_bus() to reset the PCI link instead of the link toggle.

---
 .../ethernet/mellanox/mlx5/core/fw_reset.c    | 82 +++++++++++++++----
 .../net/ethernet/mellanox/mlx5/core/main.c    |  3 +
 2 files changed, 69 insertions(+), 16 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +66 -16
index b43ca0b762c3..bda74cb9c975 100644
@@ -26,6 +26,7 @@ struct mlx5_fw_reset {
 	struct work_struct reset_now_work;
 	struct work_struct reset_abort_work;
 	unsigned long reset_flags;
+	u8 reset_method;
 	struct timer_list timer;
 	struct completion done;
 	int ret;
@@ -95,7 +96,7 @@ static int mlx5_reg_mfrl_set(struct mlx5_core_dev *dev, u8 reset_level,
 }
 
 static int mlx5_reg_mfrl_query(struct mlx5_core_dev *dev, u8 *reset_level,
-			       u8 *reset_type, u8 *reset_state)
+			       u8 *reset_type, u8 *reset_state, u8 *reset_method)
 {
 	u32 out[MLX5_ST_SZ_DW(mfrl_reg)] = {};
 	u32 in[MLX5_ST_SZ_DW(mfrl_reg)] = {};
@@ -111,13 +112,26 @@ static int mlx5_reg_mfrl_query(struct mlx5_core_dev *dev, u8 *reset_level,
 		*reset_type = MLX5_GET(mfrl_reg, out, reset_type);
 	if (reset_state)
 		*reset_state = MLX5_GET(mfrl_reg, out, reset_state);
+	if (reset_method)
+		*reset_method = MLX5_GET(mfrl_reg, out, pci_reset_req_method);
 
 	return 0;
 }
 
 int mlx5_fw_reset_query(struct mlx5_core_dev *dev, u8 *reset_level, u8 *reset_type)
 {
-	return mlx5_reg_mfrl_query(dev, reset_level, reset_type, NULL);
+	return mlx5_reg_mfrl_query(dev, reset_level, reset_type, NULL, NULL);
+}
+
+static int mlx5_fw_reset_get_reset_method(struct mlx5_core_dev *dev,
+					  u8 *reset_method)
+{
+	if (!MLX5_CAP_GEN(dev, pcie_reset_using_hotreset_method)) {
+		*reset_method = MLX5_MFRL_REG_PCI_RESET_METHOD_LINK_TOGGLE;
+		return 0;
+	}
+
+	return mlx5_reg_mfrl_query(dev, NULL, NULL, NULL, reset_method);
 }
 
 static int mlx5_fw_reset_get_reset_state_err(struct mlx5_core_dev *dev,
@@ -125,7 +139,7 @@ static int mlx5_fw_reset_get_reset_state_err(struct mlx5_core_dev *dev,
 {
 	u8 reset_state;
 
-	if (mlx5_reg_mfrl_query(dev, NULL, NULL, &reset_state))
+	if (mlx5_reg_mfrl_query(dev, NULL, NULL, &reset_state, NULL))
 		goto out;
 
 	if (!reset_state)
@@ -427,7 +441,11 @@ static void mlx5_sync_reset_request_event(struct work_struct *work)
 	struct mlx5_core_dev *dev = fw_reset->dev;
 	int err;
 
-	if (test_bit(MLX5_FW_RESET_FLAGS_NACK_RESET_REQUEST, &fw_reset->reset_flags) ||
+	err = mlx5_fw_reset_get_reset_method(dev, &fw_reset->reset_method);
+	if (err)
+		mlx5_core_warn(dev, "Failed reading MFRL, err %d\n", err);
+
+	if (err || test_bit(MLX5_FW_RESET_FLAGS_NACK_RESET_REQUEST, &fw_reset->reset_flags) ||
 	    !mlx5_is_reset_now_capable(dev)) {
 		err = mlx5_fw_reset_set_reset_sync_nack(dev);
 		mlx5_core_warn(dev, "PCI Sync FW Update Reset Nack %s",
@@ -444,21 +462,15 @@ static void mlx5_sync_reset_request_event(struct work_struct *work)
 		mlx5_core_warn(dev, "PCI Sync FW Update Reset Ack. Device reset is expected.\n");
 }
 
-static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
+static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev, u16 dev_id)
 {
 	struct pci_bus *bridge_bus = dev->pdev->bus;
 	struct pci_dev *bridge = bridge_bus->self;
 	unsigned long timeout;
 	struct pci_dev *sdev;
-	u16 reg16, dev_id;
 	int cap, err;
+	u16 reg16;
 
-	err = pci_read_config_word(dev->pdev, PCI_DEVICE_ID, &dev_id);
-	if (err)
-		return pcibios_err_to_errno(err);
-	err = mlx5_check_dev_ids(dev, dev_id);
-	if (err)
-		return err;
 	cap = pci_find_capability(bridge, PCI_CAP_ID_EXP);
 	if (!cap)
 		return -EOPNOTSUPP;
@@ -528,6 +540,44 @@ static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev)
 	return err;
 }
 
+static int mlx5_pci_reset_bus(struct mlx5_core_dev *dev)
+{
+	if (!MLX5_CAP_GEN(dev, pcie_reset_using_hotreset_method))
+		return -EOPNOTSUPP;
+
+	return pci_reset_bus(dev->pdev);
+}
+
+static int mlx5_sync_pci_reset(struct mlx5_core_dev *dev, u8 reset_method)
+{
+	u16 dev_id;
+	int err;
+
+	err = pci_read_config_word(dev->pdev, PCI_DEVICE_ID, &dev_id);
+	if (err)
+		return pcibios_err_to_errno(err);
+	err = mlx5_check_dev_ids(dev, dev_id);
+	if (err)
+		return err;
+
+	switch (reset_method) {
+	case MLX5_MFRL_REG_PCI_RESET_METHOD_LINK_TOGGLE:
+		err = mlx5_pci_link_toggle(dev, dev_id);
+		if (err)
+			mlx5_core_warn(dev, "mlx5_pci_link_toggle failed\n");
+		break;
+	case MLX5_MFRL_REG_PCI_RESET_METHOD_HOT_RESET:
+		err = mlx5_pci_reset_bus(dev);
+		if (err)
+			mlx5_core_warn(dev, "mlx5_pci_reset_bus failed\n");
+		break;
+	default:
+		return -EOPNOTSUPP;
+	}
+
+	return err;
+}
+
 static void mlx5_sync_reset_now_event(struct work_struct *work)
 {
 	struct mlx5_fw_reset *fw_reset = container_of(work, struct mlx5_fw_reset,
@@ -546,9 +596,9 @@ static void mlx5_sync_reset_now_event(struct work_struct *work)
 		goto done;
 	}
 
-	err = mlx5_pci_link_toggle(dev);
+	err = mlx5_sync_pci_reset(dev, fw_reset->reset_method);
 	if (err) {
-		mlx5_core_warn(dev, "mlx5_pci_link_toggle failed, no reset done, err %d\n", err);
+		mlx5_core_warn(dev, "mlx5_sync_pci_reset failed, no reset done, err %d\n", err);
 		set_bit(MLX5_FW_RESET_FLAGS_RELOAD_REQUIRED, &fw_reset->reset_flags);
 	}
 
@@ -610,9 +660,9 @@ static void mlx5_sync_reset_unload_event(struct work_struct *work)
 
 	mlx5_core_warn(dev, "Sync Reset, got reset action. rst_state = %u\n", rst_state);
 	if (rst_state == MLX5_FW_RST_STATE_TOGGLE_REQ) {
-		err = mlx5_pci_link_toggle(dev);
+		err = mlx5_sync_pci_reset(dev, fw_reset->reset_method);
 		if (err) {
-			mlx5_core_warn(dev, "mlx5_pci_link_toggle failed, err %d\n", err);
+			mlx5_core_warn(dev, "mlx5_sync_pci_reset failed, err %d\n", err);
 			fw_reset->ret = err;
 		}
 	}
drivers/net/ethernet/mellanox/mlx5/core/main.c +3 -0
index 4b88d969a66c..285e8fa1b7b2 100644
@@ -619,6 +619,9 @@ static int handle_hca_cap(struct mlx5_core_dev *dev, void *set_ctx)
 	if (MLX5_CAP_GEN_MAX(dev, pci_sync_for_fw_update_with_driver_unload))
 		MLX5_SET(cmd_hca_cap, set_hca_cap,
 			 pci_sync_for_fw_update_with_driver_unload, 1);
+	if (MLX5_CAP_GEN_MAX(dev, pcie_reset_using_hotreset_method))
+		MLX5_SET(cmd_hca_cap, set_hca_cap,
+			 pcie_reset_using_hotreset_method, 1);
 
 	if (MLX5_CAP_GEN_MAX(dev, num_vhca_ports))
 		MLX5_SET(cmd_hca_cap,
Signature · 1 line
2.46.0
Reviewed-by on v1 10/15
#22 lore raw

Re: [net-next 10/15] net/mlx5: Add support for sync reset using hot reset

Quoted 11 lines · Saeed Mahameed

From: Moshe Shemesh <[email protected]>

On device that supports sync reset for firmware activate using hot reset, the driver queries the required reset method while handling the sync reset request. If the required reset method is hot reset, the driver will use pci_reset_bus() to reset the PCI link instead of the link toggle.

---

#23 lore raw

PATCH 11/15 net/mlx5: Skip HotPlug check on sync reset using hot reset

In reply to Saeed Mahameed

From: Moshe Shemesh <[email protected]>

Sync reset request is nacked by the driver when PCIe bridge connected to mlx5 device has HotPlug interrupt enabled. However, when using reset method of hot reset this check can be skipped as Hotplug is supported on this reset method.

---
 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +8 -5
index bda74cb9c975..4f55e55ecb55 100644
@@ -412,7 +412,8 @@ static int mlx5_check_dev_ids(struct mlx5_core_dev *dev, u16 dev_id)
 	return 0;
 }
 
-static bool mlx5_is_reset_now_capable(struct mlx5_core_dev *dev)
+static bool mlx5_is_reset_now_capable(struct mlx5_core_dev *dev,
+				      u8 reset_method)
 {
 	u16 dev_id;
 	int err;
@@ -423,9 +424,11 @@ static bool mlx5_is_reset_now_capable(struct mlx5_core_dev *dev)
 	}
 
 #if IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE)
-	err = mlx5_check_hotplug_interrupt(dev);
-	if (err)
-		return false;
+	if (reset_method != MLX5_MFRL_REG_PCI_RESET_METHOD_HOT_RESET) {
+		err = mlx5_check_hotplug_interrupt(dev);
+		if (err)
+			return false;
+	}
 #endif
 
 	err = pci_read_config_word(dev->pdev, PCI_DEVICE_ID, &dev_id);
@@ -446,7 +449,7 @@ static void mlx5_sync_reset_request_event(struct work_struct *work)
 		mlx5_core_warn(dev, "Failed reading MFRL, err %d\n", err);
 
 	if (err || test_bit(MLX5_FW_RESET_FLAGS_NACK_RESET_REQUEST, &fw_reset->reset_flags) ||
-	    !mlx5_is_reset_now_capable(dev)) {
+	    !mlx5_is_reset_now_capable(dev, fw_reset->reset_method)) {
 		err = mlx5_fw_reset_set_reset_sync_nack(dev);
 		mlx5_core_warn(dev, "PCI Sync FW Update Reset Nack %s",
 			       err ? "Failed" : "Sent");
Signature · 1 line
2.46.0
Reviewed-by on v1 11/15
#24 lore raw

Re: [net-next 11/15] net/mlx5: Skip HotPlug check on sync reset using hot reset

Quoted 10 lines · Saeed Mahameed

From: Moshe Shemesh <[email protected]>

Sync reset request is nacked by the driver when PCIe bridge connected to mlx5 device has HotPlug interrupt enabled. However, when using reset method of hot reset this check can be skipped as Hotplug is supported on this reset method.

---

#25 lore raw

PATCH 12/15 net/mlx5: Allow users to configure affinity for SFs

In reply to Saeed Mahameed

From: Shay Drory <[email protected]>

SFs didn't allow to configure IRQ affinity for its vectors. Allow users to configure the affinity of the SFs irqs.

---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/eq.c +1 -1
index f15ecaef1331..2505f90c0b39 100644
@@ -896,7 +896,7 @@ static int comp_irq_request_sf(struct mlx5_core_dev *dev, u16 vecidx)
 	if (!mlx5_irq_pool_is_sf_pool(pool))
 		return comp_irq_request_pci(dev, vecidx);
 
-	af_desc.is_managed = 1;
+	af_desc.is_managed = false;
 	cpumask_copy(&af_desc.mask, cpu_online_mask);
 	cpumask_andnot(&af_desc.mask, &af_desc.mask, &table->used_cpus);
 	irq = mlx5_irq_affinity_request(dev, pool, &af_desc);
Signature · 1 line
2.46.0
Reviewed-by on v1 12/15
#26 lore raw

Re: [net-next 12/15] net/mlx5: Allow users to configure affinity for SFs

Quoted 9 lines · Saeed Mahameed

From: Shay Drory <[email protected]>

SFs didn't allow to configure IRQ affinity for its vectors. Allow users to configure the affinity of the SFs irqs.

---

Reviewed-by on v1 12/15
#27 lore raw

Re: [net-next 12/15] net/mlx5: Allow users to configure affinity for SFs

In reply to Saeed Mahameed
Quoted 10 lines · Saeed Mahameed

From: Shay Drory <[email protected]>

SFs didn't allow to configure IRQ affinity for its vectors. Allow users to configure the affinity of the SFs irqs.

---

#28 lore raw

PATCH 13/15 net/mlx5: Add NOT_READY command return status

In reply to Saeed Mahameed

From: Shay Drory <[email protected]>

Add a new command status MLX5_CMD_STAT_NOT_READY to handle cases where the firmware is not ready.

---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 7 ++++++-
 include/linux/mlx5/device.h                   | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +6 -1
index 20768ef2e9d2..9af8ddb4a78f 100644
@@ -754,6 +754,8 @@ static const char *cmd_status_str(u8 status)
 		return "bad resource";
 	case MLX5_CMD_STAT_RES_BUSY:
 		return "resource busy";
+	case MLX5_CMD_STAT_NOT_READY:
+		return "FW not ready";
 	case MLX5_CMD_STAT_LIM_ERR:
 		return "limits exceeded";
 	case MLX5_CMD_STAT_BAD_RES_STATE_ERR:
@@ -787,6 +789,7 @@ static int cmd_status_to_err(u8 status)
 	case MLX5_CMD_STAT_BAD_SYS_STATE_ERR:		return -EIO;
 	case MLX5_CMD_STAT_BAD_RES_ERR:			return -EINVAL;
 	case MLX5_CMD_STAT_RES_BUSY:			return -EBUSY;
+	case MLX5_CMD_STAT_NOT_READY:			return -EAGAIN;
 	case MLX5_CMD_STAT_LIM_ERR:			return -ENOMEM;
 	case MLX5_CMD_STAT_BAD_RES_STATE_ERR:		return -EINVAL;
 	case MLX5_CMD_STAT_IX_ERR:			return -EINVAL;
@@ -815,14 +818,16 @@ EXPORT_SYMBOL(mlx5_cmd_out_err);
 static void cmd_status_print(struct mlx5_core_dev *dev, void *in, void *out)
 {
 	u16 opcode, op_mod;
+	u8 status;
 	u16 uid;
 
 	opcode = in_to_opcode(in);
 	op_mod = MLX5_GET(mbox_in, in, op_mod);
 	uid    = MLX5_GET(mbox_in, in, uid);
+	status = MLX5_GET(mbox_out, out, status);
 
 	if (!uid && opcode != MLX5_CMD_OP_DESTROY_MKEY &&
-	    opcode != MLX5_CMD_OP_CREATE_UCTX)
+	    opcode != MLX5_CMD_OP_CREATE_UCTX && status != MLX5_CMD_STAT_NOT_READY)
 		mlx5_cmd_out_err(dev, opcode, op_mod, out);
 }
 
include/linux/mlx5/device.h +1 -0
index a94bc9e3af96..d0f7d1f36c5e 100644
@@ -1449,6 +1449,7 @@ enum {
 	MLX5_CMD_STAT_BAD_SYS_STATE_ERR		= 0x4,
 	MLX5_CMD_STAT_BAD_RES_ERR		= 0x5,
 	MLX5_CMD_STAT_RES_BUSY			= 0x6,
+	MLX5_CMD_STAT_NOT_READY			= 0x7,
 	MLX5_CMD_STAT_LIM_ERR			= 0x8,
 	MLX5_CMD_STAT_BAD_RES_STATE_ERR		= 0x9,
 	MLX5_CMD_STAT_IX_ERR			= 0xa,
Signature · 1 line
2.46.0
Reviewed-by on v1 13/15
#30 lore raw

Re: [net-next 13/15] net/mlx5: Add NOT_READY command return status

In reply to Saeed Mahameed
Quoted 10 lines · Saeed Mahameed

From: Shay Drory <[email protected]>

Add a new command status MLX5_CMD_STAT_NOT_READY to handle cases where the firmware is not ready.

---

Signature · 2 lines
Regards,
Kalesh A P
#31 lore raw

PATCH 14/15 net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split

In reply to Saeed Mahameed

From: Dragos Tatulea <[email protected]>

When SHAMPO can't identify the protocol/header of a packet, it will yield a packet that is not split - all the packet is in the data part. Count this value in packets and bytes.

---
 .../ethernet/mellanox/mlx5/counters.rst          | 16 ++++++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c  |  3 +++
 .../net/ethernet/mellanox/mlx5/core/en_stats.c   |  6 ++++++
 .../net/ethernet/mellanox/mlx5/core/en_stats.h   |  4 ++++
 4 files changed, 29 insertions(+)
Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +16 -0
index 3bd72577af9a..99d95be4d159 100644
@@ -218,6 +218,22 @@ the software port.
        [#accel]_.
      - Informative
 
+   * - `rx[i]_hds_nosplit_packets`
+     - Number of packets that were not split in header/data split mode. A
+       packet will not get split when the hardware does not support its
+       protocol splitting. An example such a protocol is ICMPv4/v6. Currently
+       TCP and UDP with IPv4/IPv6 are supported for header/data split
+       [#accel]_.
+     - Informative
+
+   * - `rx[i]_hds_nosplit_bytes`
+     - Number of bytes for packets that were not split in header/data split
+       mode. A packet will not get split when the hardware does not support its
+       protocol splitting. An example such a protocol is ICMPv4/v6. Currently
+       TCP and UDP with IPv4/IPv6 are supported for header/data split
+       [#accel]_.
+     - Informative
+
    * - `rx[i]_lro_packets`
      - The number of LRO packets received on ring i [#accel]_.
      - Acceleration
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +3 -0
index de9d01036c28..8e24ba96c779 100644
@@ -2346,6 +2346,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
 			stats->hds_nodata_packets++;
 			stats->hds_nodata_bytes += head_size;
 		}
+	} else {
+		stats->hds_nosplit_packets++;
+		stats->hds_nosplit_bytes += data_bcnt;
 	}
 
 	mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb);
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +6 -0
index e7a3290a708a..611ec4b6f370 100644
@@ -144,6 +144,8 @@ static const struct counter_desc sw_stats_desc[] = {
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_large_hds) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_packets) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_bytes) },
+	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nosplit_packets) },
+	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nosplit_bytes) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_ecn_mark) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_removed_vlan_packets) },
 	{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary) },
@@ -347,6 +349,8 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
 	s->rx_gro_large_hds           += rq_stats->gro_large_hds;
 	s->rx_hds_nodata_packets      += rq_stats->hds_nodata_packets;
 	s->rx_hds_nodata_bytes        += rq_stats->hds_nodata_bytes;
+	s->rx_hds_nosplit_packets     += rq_stats->hds_nosplit_packets;
+	s->rx_hds_nosplit_bytes       += rq_stats->hds_nosplit_bytes;
 	s->rx_ecn_mark                += rq_stats->ecn_mark;
 	s->rx_removed_vlan_packets    += rq_stats->removed_vlan_packets;
 	s->rx_csum_none               += rq_stats->csum_none;
@@ -2062,6 +2066,8 @@ static const struct counter_desc rq_stats_desc[] = {
 	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) },
 	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_packets) },
 	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_bytes) },
+	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_packets) },
+	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_bytes) },
 	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) },
 	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) },
 	{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) },
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +4 -0
index 4c5858c1dd82..5961c569cfe0 100644
@@ -156,6 +156,8 @@ struct mlx5e_sw_stats {
 	u64 rx_gro_large_hds;
 	u64 rx_hds_nodata_packets;
 	u64 rx_hds_nodata_bytes;
+	u64 rx_hds_nosplit_packets;
+	u64 rx_hds_nosplit_bytes;
 	u64 rx_mcast_packets;
 	u64 rx_ecn_mark;
 	u64 rx_removed_vlan_packets;
@@ -356,6 +358,8 @@ struct mlx5e_rq_stats {
 	u64 gro_large_hds;
 	u64 hds_nodata_packets;
 	u64 hds_nodata_bytes;
+	u64 hds_nosplit_packets;
+	u64 hds_nosplit_bytes;
 	u64 mcast_packets;
 	u64 ecn_mark;
 	u64 removed_vlan_packets;
Signature · 1 line
2.46.0
Reviewed-by on v1 14/15
#32 lore raw

Re: [net-next 14/15] net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split

Quoted 10 lines · Saeed Mahameed

From: Dragos Tatulea <[email protected]>

When SHAMPO can't identify the protocol/header of a packet, it will yield a packet that is not split - all the packet is in the data part. Count this value in packets and bytes.

---

#33 lore raw

PATCH 15/15 net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq

In reply to Saeed Mahameed

From: Rahul Rameshbabu <[email protected]>

mlx5e_free_rq previously cleaned resources in an order that was not the reverse of the resource allocation order in mlx5e_alloc_rq.

---
 .../net/ethernet/mellanox/mlx5/core/en_main.c | 25 ++++++++++---------
 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +13 -12
index 47e7a80d221b..a5659c0c4236 100644
@@ -1016,30 +1016,31 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,
 
 static void mlx5e_free_rq(struct mlx5e_rq *rq)
 {
-	struct bpf_prog *old_prog;
-
-	if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) {
-		old_prog = rcu_dereference_protected(rq->xdp_prog,
-						     lockdep_is_held(&rq->priv->state_lock));
-		if (old_prog)
-			bpf_prog_put(old_prog);
-	}
+	kvfree(rq->dim);
+	page_pool_destroy(rq->page_pool);
 
 	switch (rq->wq_type) {
 	case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ:
+		mlx5e_rq_free_shampo(rq);
 		kvfree(rq->mpwqe.info);
 		mlx5_core_destroy_mkey(rq->mdev, be32_to_cpu(rq->mpwqe.umr_mkey_be));
 		mlx5e_free_mpwqe_rq_drop_page(rq);
-		mlx5e_rq_free_shampo(rq);
 		break;
 	default: /* MLX5_WQ_TYPE_CYCLIC */
 		mlx5e_free_wqe_alloc_info(rq);
 	}
 
-	kvfree(rq->dim);
-	xdp_rxq_info_unreg(&rq->xdp_rxq);
-	page_pool_destroy(rq->page_pool);
 	mlx5_wq_destroy(&rq->wq_ctrl);
+
+	if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) {
+		struct bpf_prog *old_prog;
+
+		old_prog = rcu_dereference_protected(rq->xdp_prog,
+						     lockdep_is_held(&rq->priv->state_lock));
+		if (old_prog)
+			bpf_prog_put(old_prog);
+	}
+	xdp_rxq_info_unreg(&rq->xdp_rxq);
 }
 
 int mlx5e_create_rq(struct mlx5e_rq *rq, struct mlx5e_rq_param *param, u16 q_counter)
Signature · 1 line
2.46.0
Reviewed-by on v1 15/15
#34 lore raw

Re: [net-next 15/15] net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq

Quoted 9 lines · Saeed Mahameed

From: Rahul Rameshbabu <[email protected]>

mlx5e_free_rq previously cleaned resources in an order that was not the reverse of the resource allocation order in mlx5e_alloc_rq.

---

maintainer
#35 lore raw
In reply to Saeed Mahameed
Quoted 1 line · On Wed, 11 Sep 2024 13:17:42 -0700 Saeed Mahameed wrote:

Please pull and let me know if there is any problem.

Commits on the branch are missing your SoBs, I applied from the list.

Jake, Kalesh: thank you for the reviews!