]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
{IB,net}/mlx5: Constify rep ops functions pointers
authorParav Pandit <parav@mellanox.com>
Wed, 29 May 2019 22:50:41 +0000 (22:50 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 31 May 2019 19:28:14 +0000 (12:28 -0700)
commit8693115af4c24d92b971ad895c5f329761ed5d38
tree1798bbac2ed974f1b29257a6de2fed1f7cad322d
parentc94ff7487754dd23159a8dc47466c0cc82121ebd
{IB,net}/mlx5: Constify rep ops functions pointers

Currently for every representor type and for every single vport,
representer function pointers copy is stored even though they don't
change from one to other vport.

Additionally priv data entry for the rep is not passed during
registration, but its copied. It is used (set and cleared) by the user
of the reps.

As we want to scale vports, to simplify and also to split constants
from data,

1. Rename mlx5_eswitch_rep_if to mlx5_eswitch_rep_ops as to match _ops
prefix with other standard netdev, ibdev ops.
2. Constify the IB and Ethernet rep ops structure.
3. Instead of storing copy of all rep function pointers, store copy
per eswitch rep type.
4. Split data and function pointers to mlx5_eswitch_rep_ops and
mlx5_eswitch_rep_data.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/infiniband/hw/mlx5/ib_rep.c
drivers/infiniband/hw/mlx5/ib_rep.h
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
include/linux/mlx5/eswitch.h