From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
Leon Romanovsky <leonro@mellanox.com>,
linux-rdma@vger.kernel.org, Maor Gottlieb <maorg@mellanox.com>
Subject: Re: [PATCH rdma-next 14/18] RDMA/mlx5: Process create QP flags in one place
Date: Fri, 24 Apr 2020 16:51:27 -0300 [thread overview]
Message-ID: <20200424195127.GA28751@ziepe.ca> (raw)
In-Reply-To: <20200420151105.282848-15-leon@kernel.org>
On Mon, Apr 20, 2020 at 06:11:01PM +0300, Leon Romanovsky wrote:
> + process_create_flag(dev, &create_flags,
> + IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK,
> + MLX5_CAP_GEN(mdev, block_lb_mc), qp);
This only applies to datagram QP types
> + process_create_flag(dev, &create_flags, IB_QP_CREATE_CROSS_CHANNEL,
> + MLX5_CAP_GEN(mdev, cd), qp);
> + process_create_flag(dev, &create_flags, IB_QP_CREATE_MANAGED_SEND,
> + MLX5_CAP_GEN(mdev, cd), qp);
> + process_create_flag(dev, &create_flags, IB_QP_CREATE_MANAGED_RECV,
> + MLX5_CAP_GEN(mdev, cd), qp);
> +
> + if (qp_type == IB_QPT_UD) {
> + process_create_flag(dev, &create_flags,
> + IB_QP_CREATE_IPOIB_UD_LSO,
> + MLX5_CAP_GEN(mdev, ipoib_basic_offloads),
> + qp);
> + cond = MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_IB;
> + process_create_flag(dev, &create_flags, IB_QP_CREATE_SOURCE_QPN,
> + cond, qp);
> + }
> +
> + if (qp_type == IB_QPT_RAW_PACKET) {
> + cond = MLX5_CAP_GEN(mdev, eth_net_offloads) &&
> + MLX5_CAP_ETH(mdev, scatter_fcs);
> + process_create_flag(dev, &create_flags,
> + IB_QP_CREATE_SCATTER_FCS, cond, qp);
> +
> + cond = MLX5_CAP_GEN(mdev, eth_net_offloads) &&
> + MLX5_CAP_ETH(mdev, vlan_cap);
> + process_create_flag(dev, &create_flags,
> + IB_QP_CREATE_CVLAN_STRIPPING, cond, qp);
> + }
> +
> + process_create_flag(dev, &create_flags,
> + IB_QP_CREATE_PCI_WRITE_END_PADDING,
> + MLX5_CAP_GEN(mdev, end_pad), qp);
This one is datagram only too
> +
> + process_create_flag(dev, &create_flags, MLX5_IB_QP_CREATE_WC_TEST,
> + qp_type != MLX5_IB_QPT_REG_UMR, qp);
> + process_create_flag(dev, &create_flags, MLX5_IB_QP_CREATE_SQPN_QP1,
> + true, qp);
I wonder if these are excluded from userspace someplace, seems like it
is worth a udata test here just to be clear
> +
> + if (create_flags)
> + mlx5_ib_dbg(dev, "Create QP has unsupported flags 0x%X\n",
> + create_flags);
> +
> + return (create_flags) ? -EINVAL : 0;
Since there is already an if, avoid ternary expression
Jason
next prev parent reply other threads:[~2020-04-24 19:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 15:10 [PATCH rdma-next 00/18] Refactor mlx5_ib_create_qp (Part I) Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 01/18] RDMA/mlx5: Organize QP types checks in one place Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 02/18] RDMA/mlx5: Delete impossible GSI port check Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 03/18] RDMA/mlx5: Perform check if QP creation flow is valid Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 04/18] RDMA/mlx5: Prepare QP allocation for future removal Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 05/18] RDMA/mlx5: Avoid setting redundant NULL for XRC QPs Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 06/18] RDMA/mlx5: Set QP subtype immediately when it is known Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 07/18] RDMA/mlx5: Separate create QP flows to be based on type Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 08/18] RDMA/mlx5: Split scatter CQE configuration for DCT QP Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 09/18] RDMA/mlx5: Update all DRIVER QP places to use QP subtype Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 10/18] RDMA/mlx5: Move DRIVER QP flags check into separate function Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 11/18] RDMA/mlx5: Remove second copy from user for non RSS RAW QPs Leon Romanovsky
2020-04-20 15:10 ` [PATCH rdma-next 12/18] RDMA/mlx5: Initial separation of RAW_PACKET QP from common flow Leon Romanovsky
2020-04-20 15:11 ` [PATCH rdma-next 13/18] RDMA/mlx5: Delete create QP flags obfuscation Leon Romanovsky
2020-04-20 15:11 ` [PATCH rdma-next 14/18] RDMA/mlx5: Process create QP flags in one place Leon Romanovsky
2020-04-23 18:53 ` Leon Romanovsky
2020-04-24 19:51 ` Jason Gunthorpe [this message]
2020-04-24 20:23 ` Leon Romanovsky
2020-04-20 15:11 ` [PATCH rdma-next 15/18] RDMA/mlx5: Use flags_en mechanism to mark QP created with WQE signature Leon Romanovsky
2020-04-20 15:11 ` [PATCH rdma-next 16/18] RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags Leon Romanovsky
2020-04-20 15:11 ` [PATCH rdma-next 17/18] RDMA/mlx5: Return all configured create flags through query QP Leon Romanovsky
2020-04-20 15:11 ` [PATCH rdma-next 18/18] RDMA/mlx5: Process all vendor flags in one place Leon Romanovsky
2020-04-24 19:54 ` [PATCH rdma-next 00/18] Refactor mlx5_ib_create_qp (Part I) Jason Gunthorpe
2020-04-24 20:26 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200424195127.GA28751@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).