qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Keith Busch <kbusch@kernel.org>,
	Jesper Devantier <foss@defmacro.it>,
	Arun Kumar <arun.kka@samsung.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Klaus Jensen <k.jensen@samsung.com>
Subject: Re: [PATCH] hw/nvme: add knob for CTRATT.MEM
Date: Mon, 30 Sep 2024 12:43:16 +0200	[thread overview]
Message-ID: <ZvqAxASMwl-Q-frr@AALNPWKJENSEN.aal.scsc.local> (raw)
In-Reply-To: <20240924-add-ctratt-mem-knob-v1-1-0674de9b88b4@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]

On Sep 24 08:35, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> Add a boolean prop (ctratt.mem) for setting CTRATT.MEM and default it to
> unset (false) to keep existing behavior of the device intact.
> 
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
>  hw/nvme/ctrl.c | 7 ++++++-
>  hw/nvme/nvme.h | 4 ++++
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index f36c45931821..8556f3e61fa0 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -8492,7 +8492,11 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
>      id->cntlid = cpu_to_le16(n->cntlid);
>  
>      id->oaes = cpu_to_le32(NVME_OAES_NS_ATTR);
> -    ctratt = NVME_CTRATT_ELBAS | NVME_CTRATT_MEM;
> +
> +    ctratt = NVME_CTRATT_ELBAS;
> +    if (n->params.ctratt.mem) {
> +        ctratt |= NVME_CTRATT_MEM;
> +    }
>  
>      id->rab = 6;
>  
> @@ -8751,6 +8755,7 @@ static Property nvme_props[] = {
>                       false),
>      DEFINE_PROP_UINT16("mqes", NvmeCtrl, params.mqes, 0x7ff),
>      DEFINE_PROP_UINT16("spdm_port", PCIDevice, spdm_port, 0),
> +    DEFINE_PROP_BOOL("ctratt.mem", NvmeCtrl, params.ctratt.mem, false),
>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h
> index 781985754d0d..bd3c6ba33a67 100644
> --- a/hw/nvme/nvme.h
> +++ b/hw/nvme/nvme.h
> @@ -538,6 +538,10 @@ typedef struct NvmeParams {
>      uint32_t  sriov_max_vq_per_vf;
>      uint32_t  sriov_max_vi_per_vf;
>      bool     msix_exclusive_bar;
> +
> +    struct {
> +        bool mem;
> +    } ctratt;
>  } NvmeParams;
>  
>  typedef struct NvmeCtrl {
> 
> ---
> base-commit: 3245de3f3d002bc9ce2ecae61e8d86cb9e375808
> change-id: 20240924-add-ctratt-mem-knob-ae4431251cb1
> 
> Best regards,
> -- 
> Klaus Jensen <k.jensen@samsung.com>
> 
> 

Applied to nvme-next.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2024-09-30 10:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240924063550epcas5p46118c878bebe3289884819017cb0b11b@epcas5p4.samsung.com>
2024-09-24  6:35 ` [PATCH] hw/nvme: add knob for CTRATT.MEM Klaus Jensen
2024-09-24  1:18   ` Arun Kumar
2024-09-26  4:27   ` Minwoo Im
2024-09-30 10:43   ` Klaus Jensen [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=ZvqAxASMwl-Q-frr@AALNPWKJENSEN.aal.scsc.local \
    --to=its@irrelevant.dk \
    --cc=arun.kka@samsung.com \
    --cc=foss@defmacro.it \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).