forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5: Lag, set LAG traffic type mapping
Generate a traffic type bitmap that will define which steering objects we need to create for the steering based LAG. Bits in this bitmap are set according to the LAG hash type. In addition, have a field that indicate if the lag is in encap mode or not. Signed-off-by: Maor Gottlieb <maorg@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
- Loading branch information
1 parent
3d67773
commit 1065e00
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB | ||
/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. */ | ||
|
||
#include <linux/netdevice.h> | ||
#include "lag.h" | ||
|
||
static void set_tt_map(struct mlx5_lag_port_sel *port_sel, | ||
enum netdev_lag_hash hash) | ||
{ | ||
port_sel->tunnel = false; | ||
|
||
switch (hash) { | ||
case NETDEV_LAG_HASH_E34: | ||
port_sel->tunnel = true; | ||
fallthrough; | ||
case NETDEV_LAG_HASH_L34: | ||
set_bit(MLX5_TT_IPV4_TCP, port_sel->tt_map); | ||
set_bit(MLX5_TT_IPV4_UDP, port_sel->tt_map); | ||
set_bit(MLX5_TT_IPV6_TCP, port_sel->tt_map); | ||
set_bit(MLX5_TT_IPV6_UDP, port_sel->tt_map); | ||
set_bit(MLX5_TT_IPV4, port_sel->tt_map); | ||
set_bit(MLX5_TT_IPV6, port_sel->tt_map); | ||
set_bit(MLX5_TT_ANY, port_sel->tt_map); | ||
break; | ||
case NETDEV_LAG_HASH_E23: | ||
port_sel->tunnel = true; | ||
fallthrough; | ||
case NETDEV_LAG_HASH_L23: | ||
set_bit(MLX5_TT_IPV4, port_sel->tt_map); | ||
set_bit(MLX5_TT_IPV6, port_sel->tt_map); | ||
set_bit(MLX5_TT_ANY, port_sel->tt_map); | ||
break; | ||
default: | ||
set_bit(MLX5_TT_ANY, port_sel->tt_map); | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ | ||
/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. */ | ||
|
||
#ifndef __MLX5_LAG_FS_H__ | ||
#define __MLX5_LAG_FS_H__ | ||
|
||
#include "lib/fs_ttc.h" | ||
|
||
struct mlx5_lag_port_sel { | ||
DECLARE_BITMAP(tt_map, MLX5_NUM_TT); | ||
bool tunnel; | ||
}; | ||
|
||
#endif /* __MLX5_LAG_FS_H__ */ |