Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Michael Margolin <mrgolin@amazon.com>
Cc: jgg@nvidia.com, linux-rdma@vger.kernel.org,
	Firas Jahjah <firasj@amazon.com>,
	Yossi Leybovich <sleybo@amazon.com>,
	Daniel Kranzdorf <dkkranzd@amazon.com>
Subject: Re: [PATCH for-next v2] RDMA/efa: Support CQ receive entries with source GID
Date: Sun, 21 Aug 2022 12:35:23 +0300	[thread overview]
Message-ID: <YwH8WyQZZ/Bzk80h@unreal> (raw)
In-Reply-To: <20220818140449.414-1-mrgolin@amazon.com>

On Thu, Aug 18, 2022 at 05:04:49PM +0300, Michael Margolin wrote:
> Add a parameter for create CQ admin command to set source address on
> receive completion descriptors. Report capability for this feature
> through query device verb.
> 
> Reviewed-by: Firas Jahjah <firasj@amazon.com>
> Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
> Signed-off-by: Daniel Kranzdorf <dkkranzd@amazon.com>
> Signed-off-by: Michael Margolin <mrgolin@amazon.com>
> ---
> v1 -> v2:
> - Add check for CQE size request correctness in efa_create_cq() 
> 	(comment from Gal Pressman)
> - Use bitfields for bool struct members
> 	(comment from Leon Romanovsky and Jason Gunthorpe)
> 
>  drivers/infiniband/hw/efa/efa_admin_cmds_defs.h   |   6 +-
>  drivers/infiniband/hw/efa/efa_com_cmd.c           |   5 +-
>  drivers/infiniband/hw/efa/efa_com_cmd.h           |   3 +-
>  drivers/infiniband/hw/efa/efa_io_defs.h           | 289 ++++++++++++++++++
>  drivers/infiniband/hw/efa/efa_verbs.c             |  10 +-
>  include/uapi/rdma/efa-abi.h                       |   4 +-
>  6 files changed, 311 insertions(+), 6 deletions(-)
>  create mode 100644 drivers/infiniband/hw/efa/efa_io_defs.h
> 
> diff --git a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
> index 0b0b93b529f3..d4b9226088bd 100644
> --- a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
> +++ b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
> @@ -444,7 +444,10 @@ struct efa_admin_create_cq_cmd {
>  	/*
>  	 * 4:0 : cq_entry_size_words - size of CQ entry in
>  	 *    32-bit words, valid values: 4, 8.
> -	 * 7:5 : reserved7 - MBZ
> +	 * 5 : set_src_addr - If set, source address will be
> +	 *    filled on RX completions from unknown senders.
> +	 *    Requires 8 words CQ entry size.
> +	 * 7:6 : reserved7 - MBZ
>  	 */
>  	u8 cq_caps_2;
>  
> @@ -980,6 +983,7 @@ struct efa_admin_host_info {
>  #define EFA_ADMIN_CREATE_CQ_CMD_INTERRUPT_MODE_ENABLED_MASK BIT(5)
>  #define EFA_ADMIN_CREATE_CQ_CMD_VIRT_MASK                   BIT(6)
>  #define EFA_ADMIN_CREATE_CQ_CMD_CQ_ENTRY_SIZE_WORDS_MASK    GENMASK(4, 0)
> +#define EFA_ADMIN_CREATE_CQ_CMD_SET_SRC_ADDR_MASK           BIT(5)
>  
>  /* create_cq_resp */
>  #define EFA_ADMIN_CREATE_CQ_RESP_DB_VALID_MASK              BIT(0)
> diff --git a/drivers/infiniband/hw/efa/efa_com_cmd.c b/drivers/infiniband/hw/efa/efa_com_cmd.c
> index fb405da4e1db..8f8885e002ba 100644
> --- a/drivers/infiniband/hw/efa/efa_com_cmd.c
> +++ b/drivers/infiniband/hw/efa/efa_com_cmd.c
> @@ -168,7 +168,10 @@ int efa_com_create_cq(struct efa_com_dev *edev,
>  			EFA_ADMIN_CREATE_CQ_CMD_INTERRUPT_MODE_ENABLED, 1);
>  		create_cmd.eqn = params->eqn;
>  	}
> -
> +	if (params->set_src_addr) {
> +		EFA_SET(&create_cmd.cq_caps_2,
> +			EFA_ADMIN_CREATE_CQ_CMD_SET_SRC_ADDR, 1);
> +	}
>  	efa_com_set_dma_addr(params->dma_addr,
>  			     &create_cmd.cq_ba.mem_addr_high,
>  			     &create_cmd.cq_ba.mem_addr_low);
> diff --git a/drivers/infiniband/hw/efa/efa_com_cmd.h b/drivers/infiniband/hw/efa/efa_com_cmd.h
> index c33010bbf9e8..671a04d69fc2 100644
> --- a/drivers/infiniband/hw/efa/efa_com_cmd.h
> +++ b/drivers/infiniband/hw/efa/efa_com_cmd.h
> @@ -75,7 +75,8 @@ struct efa_com_create_cq_params {
>  	u16 uarn;
>  	u16 eqn;
>  	u8 entry_size_in_bytes;
> -	bool interrupt_mode_enabled;
> +	bool interrupt_mode_enabled : 1;
> +	bool set_src_addr : 1;

It should be u8 xxx : 1 and not bool ...
Fixes locally and applied.

Thanks

      reply	other threads:[~2022-08-21  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 14:04 [PATCH for-next v2] RDMA/efa: Support CQ receive entries with source GID Michael Margolin
2022-08-21  9:35 ` Leon Romanovsky [this message]

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=YwH8WyQZZ/Bzk80h@unreal \
    --to=leon@kernel.org \
    --cc=dkkranzd@amazon.com \
    --cc=firasj@amazon.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mrgolin@amazon.com \
    --cc=sleybo@amazon.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