mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
{net,IB}/mlx5: Modify QP commands via mlx5 ifc
Prior to this patch we assumed that modify QP commands have the same layout. In ConnectX-4 for each QP transition there is a specific command and their layout can vary. e.g: 2err/2rst commands don't have QP context in their layout and before this patch we posted the QP context in those commands. Fortunately the FW only checks the suffix of the commands and executes them, while ignoring all invalid data sent after the valid command layout. This patch removes mlx5_modify_qp_mbox_in and changes mlx5_core_qp_modify to receive the required transition and QP context with opt_param_mask if needed. This way the caller is not required to provide the command inbox layout and it will be generated automatically. mlx5_core_qp_modify will generate the command inbox/outbox layouts according to the requested transition and will fill the requested parameters. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
09a7d9eca1
commit
1a412fb1ca
3 changed files with 124 additions and 42 deletions
|
@ -479,6 +479,7 @@ struct mlx5_qp_path {
|
|||
u8 rmac[6];
|
||||
};
|
||||
|
||||
/* FIXME: use mlx5_ifc.h qpc */
|
||||
struct mlx5_qp_context {
|
||||
__be32 flags;
|
||||
__be32 flags_pd;
|
||||
|
@ -520,21 +521,6 @@ struct mlx5_qp_context {
|
|||
u8 rsvd1[24];
|
||||
};
|
||||
|
||||
struct mlx5_modify_qp_mbox_in {
|
||||
struct mlx5_inbox_hdr hdr;
|
||||
__be32 qpn;
|
||||
u8 rsvd0[4];
|
||||
__be32 optparam;
|
||||
u8 rsvd1[4];
|
||||
struct mlx5_qp_context ctx;
|
||||
u8 rsvd2[16];
|
||||
};
|
||||
|
||||
struct mlx5_modify_qp_mbox_out {
|
||||
struct mlx5_outbox_hdr hdr;
|
||||
u8 rsvd0[8];
|
||||
};
|
||||
|
||||
static inline struct mlx5_core_qp *__mlx5_qp_lookup(struct mlx5_core_dev *dev, u32 qpn)
|
||||
{
|
||||
return radix_tree_lookup(&dev->priv.qp_table.tree, qpn);
|
||||
|
@ -549,8 +535,8 @@ int mlx5_core_create_qp(struct mlx5_core_dev *dev,
|
|||
struct mlx5_core_qp *qp,
|
||||
u32 *in,
|
||||
int inlen);
|
||||
int mlx5_core_qp_modify(struct mlx5_core_dev *dev, u16 operation,
|
||||
struct mlx5_modify_qp_mbox_in *in, int sqd_event,
|
||||
int mlx5_core_qp_modify(struct mlx5_core_dev *dev, u16 opcode,
|
||||
u32 opt_param_mask, void *qpc,
|
||||
struct mlx5_core_qp *qp);
|
||||
int mlx5_core_destroy_qp(struct mlx5_core_dev *dev,
|
||||
struct mlx5_core_qp *qp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue