mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 22:22:51 -04:00
net/mlx5: HWS, Refactor rule skip logic
Reduce nesting by adding a couple of early return statements. Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com> Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Signed-off-by: Mark Bloch <mbloch@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250703185431.445571-5-mbloch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
d8e7ab591b
commit
3dcac700d2
@@ -12,20 +12,21 @@ void mlx5hws_rule_skip(struct mlx5hws_matcher *matcher, u32 flow_source,
|
||||
|
||||
if (flow_source == MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT) {
|
||||
*skip_rx = true;
|
||||
} else if (flow_source == MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK) {
|
||||
*skip_tx = true;
|
||||
} else {
|
||||
/* If no flow source was set for current rule,
|
||||
* check for flow source in matcher attributes.
|
||||
*/
|
||||
if (matcher->attr.optimize_flow_src) {
|
||||
*skip_tx =
|
||||
matcher->attr.optimize_flow_src == MLX5HWS_MATCHER_FLOW_SRC_WIRE;
|
||||
*skip_rx =
|
||||
matcher->attr.optimize_flow_src == MLX5HWS_MATCHER_FLOW_SRC_VPORT;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (flow_source == MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK) {
|
||||
*skip_tx = true;
|
||||
return;
|
||||
}
|
||||
|
||||
/* If no flow source was set for current rule,
|
||||
* check for flow source in matcher attributes.
|
||||
*/
|
||||
*skip_tx = matcher->attr.optimize_flow_src ==
|
||||
MLX5HWS_MATCHER_FLOW_SRC_WIRE;
|
||||
*skip_rx = matcher->attr.optimize_flow_src ==
|
||||
MLX5HWS_MATCHER_FLOW_SRC_VPORT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user