]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net/mlx5: DR, Use variably sized data structures for different actions
authorJianbo Liu <jianbol@nvidia.com>
Thu, 12 Nov 2020 01:32:52 +0000 (01:32 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 14 Apr 2021 18:02:52 +0000 (11:02 -0700)
commit9dac2966c531365d9cd1fb33d8d3a70cec349e35
tree0978f82b7f695e7f8a6d935c9a4f5238ec33027f
parenta74ed24c437eddda3299904d870f0df5ef23e475
net/mlx5: DR, Use variably sized data structures for different actions

mlx5dr_action is a generally used data structure, and there is an
union for different types of actions in it. The size of mlx5dr_action
is about 72 bytes, but for those actions with fewer fields, most of
the allocated memory is wasted.
Remove this union, and mlx5dr_action becomes a generic action header.
Then actions are dynamically allocated with needed memory, the data
for each action is stored right after the header.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h