All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamlesh Gurudasani <kamlesh@ti.com>
To: Xin Zeng <xin.zeng@intel.com>, <herbert@gondor.apana.org.au>,
	<alex.williamson@redhat.com>, <jgg@nvidia.com>,
	<yishaih@nvidia.com>, <shameerali.kolothum.thodi@huawei.com>,
	<kevin.tian@intel.com>
Cc: <linux-crypto@vger.kernel.org>, <kvm@vger.kernel.org>,
	<qat-linux@intel.com>, Siming Wan <siming.wan@intel.com>,
	Xin Zeng <xin.zeng@intel.com>
Subject: Re: [EXTERNAL] [PATCH 07/10] crypto: qat - add bank save and restore flows
Date: Sun, 4 Feb 2024 13:19:34 +0530	[thread overview]
Message-ID: <87o7cwzn1t.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <20240201153337.4033490-8-xin.zeng@intel.com>

Xin Zeng <xin.zeng@intel.com> writes:

> This message was sent from outside of Texas Instruments. 
> Do not click links or open attachments unless you recognize the source of this email and know the content is safe. 
>  
> From: Siming Wan <siming.wan@intel.com>
>
> Add logic to save, restore, quiesce and drain a ring bank for QAT GEN4
> devices.
> This allows to save and restore the state of a Virtual Function (VF) and
> will be used to implement VM live migration.
>
> Signed-off-by: Siming Wan <siming.wan@intel.com>
> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> Reviewed-by: Xin Zeng <xin.zeng@intel.com>
> Signed-off-by: Xin Zeng <xin.zeng@intel.com>
...
> +#define CHECK_STAT(op, expect_val, name, args...) \
> +({ \
> +	u32 __expect_val = (expect_val); \
> +	u32 actual_val = op(args); \
> +	if (__expect_val != actual_val) \
> +		pr_err("QAT: Fail to restore %s register. Expected 0x%x, but actual is 0x%x\n", \
> +			name, __expect_val, actual_val); \
> +	(__expect_val == actual_val) ? 0 : -EINVAL; \
I was wondering if this can be done like following, saves repeat comparison.

(__expect_val == actual_val) ? 0 : (pr_err("QAT: Fail to restore %s \
                                          register. Expected 0x%x, \
                                          but actual is 0x%x\n", \
                 			  name, __expect_val, \
                                          actual_val), -EINVAL); \
Regards,
Kamlesh

> +})
...

  reply	other threads:[~2024-02-04  7:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 15:33 [PATCH 00/10] crypto: qat - enable SRIOV VF live migration for Xin Zeng
2024-02-01 15:33 ` [PATCH 01/10] crypto: qat - adf_get_etr_base() helper Xin Zeng
2024-02-01 15:33 ` [PATCH 02/10] crypto: qat - relocate and rename 4xxx PF2VM definitions Xin Zeng
2024-02-01 15:33 ` [PATCH 03/10] crypto: qat - move PFVF compat checker to a function Xin Zeng
2024-02-01 15:33 ` [PATCH 04/10] crypto: qat - relocate CSR access code Xin Zeng
2024-02-01 15:33 ` [PATCH 05/10] crypto: qat - rename get_sla_arr_of_type() Xin Zeng
2024-02-01 15:33 ` [PATCH 06/10] crypto: qat - expand CSR operations for QAT GEN4 devices Xin Zeng
2024-02-01 15:33 ` [PATCH 07/10] crypto: qat - add bank save and restore flows Xin Zeng
2024-02-04  7:49   ` Kamlesh Gurudasani [this message]
2024-02-19  3:41     ` [EXTERNAL] " Wan, Siming
2024-02-01 15:33 ` [PATCH 08/10] crypto: qat - add interface for live migration Xin Zeng
2024-02-01 15:33 ` [PATCH 09/10] crypto: qat - implement " Xin Zeng
2024-02-01 15:33 ` [PATCH 10/10] vfio/qat: Add vfio_pci driver for Intel QAT VF devices Xin Zeng
2024-02-06 12:55   ` Jason Gunthorpe
2024-02-09  8:23     ` Zeng, Xin
2024-02-09 12:10       ` Jason Gunthorpe
2024-02-11  8:17         ` Yishai Hadas
2024-02-17 16:20           ` Zeng, Xin
2024-02-20 13:24             ` Jason Gunthorpe
2024-02-20 15:53               ` Zeng, Xin
2024-02-20 17:03                 ` Jason Gunthorpe
2024-02-21  8:44                   ` Zeng, Xin
2024-02-21 13:18                     ` Jason Gunthorpe
2024-02-21 15:11                       ` Yishai Hadas
2024-02-22  9:39                         ` Yishai Hadas
2024-02-06 21:14   ` Alex Williamson
2024-02-09 16:16     ` Zeng, Xin
2024-02-08 12:17   ` Shameerali Kolothum Thodi
2024-02-13 13:08     ` Zeng, Xin
2024-02-13 14:55       ` Jason Gunthorpe

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=87o7cwzn1t.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me \
    --to=kamlesh@ti.com \
    --cc=alex.williamson@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jgg@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=siming.wan@intel.com \
    --cc=xin.zeng@intel.com \
    --cc=yishaih@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.