From: "Wang, Xiao W" <xiao.w.wang@intel.com>
To: jilei chen <chenjilei@cmss.chinamobile.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] Enhance code readability when dma_map in ifc/ifcvp_vdpa
Date: Mon, 27 Sep 2021 02:09:13 +0000 [thread overview]
Message-ID: <DM8PR11MB5751658ACED25B1C8FB7CF82B8A79@DM8PR11MB5751.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210926164518.8982-1-chenjilei@cmss.chinamobile.com>
Hi Jilei,
Please notice the patch format requirement, the subject of the patch should start with "vdpa/ifc: ".
You also need to keep it concise, around ~50 characters.
Refer " doc/guides/contributing/patches.rst" for more detail.
Back to this patch, it looks we can just change function ifcvf_dma_map(struct ifcvf_internal *internal, int do_map) to
ifcvf_dma_map(struct ifcvf_internal *internal, bool do_map), and use "true" or "false" when calling it.
This would align with vdpa_enable_vfio_intr(). In your next version patch, you can also change the "1", "0" parameter to
"true", "false" when calling vdpa_enable_vfio_intr().
BRs,
Xiao
> -----Original Message-----
> From: jilei chen <chenjilei@cmss.chinamobile.com>
> Sent: Monday, September 27, 2021 12:45 AM
> To: Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] Enhance code readability when dma_map in
> ifc/ifcvp_vdpa
>
> Signed-off-by: jilei chen <chenjilei@cmss.chinamobile.com>
> ---
> drivers/vdpa/ifc/ifcvf_vdpa.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 1dc813d0a3..c2bf26f2b7 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -36,6 +36,8 @@ RTE_LOG_REGISTER(ifcvf_vdpa_logtype,
> pmd.vdpa.ifcvf, NOTICE);
>
> #define IFCVF_VDPA_MODE "vdpa"
> #define IFCVF_SW_FALLBACK_LM "sw-live-migration"
> +#define IFCVF_MAP 1
> +#define IFCVF_UNMAP 0
>
> #define THREAD_NAME_LEN 16
>
> @@ -538,7 +540,7 @@ update_datapath(struct ifcvf_internal *internal)
> if (!rte_atomic32_read(&internal->running) &&
> (rte_atomic32_read(&internal->started) &&
> rte_atomic32_read(&internal->dev_attached))) {
> - ret = ifcvf_dma_map(internal, 1);
> + ret = ifcvf_dma_map(internal, IFCVF_MAP);
> if (ret)
> goto err;
>
> @@ -568,7 +570,7 @@ update_datapath(struct ifcvf_internal *internal)
> if (ret)
> goto err;
>
> - ret = ifcvf_dma_map(internal, 0);
> + ret = ifcvf_dma_map(internal, IFCVF_UNMAP);
> if (ret)
> goto err;
>
> @@ -875,7 +877,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal
> *internal)
> unset_intr:
> vdpa_disable_vfio_intr(internal);
> unmap:
> - ifcvf_dma_map(internal, 0);
> + ifcvf_dma_map(internal, IFCVF_UNMAP);
> error:
> return -1;
> }
> @@ -934,7 +936,7 @@ ifcvf_dev_close(int vid)
> vdpa_disable_vfio_intr(internal);
>
> /* unset DMA map for guest memory */
> - ifcvf_dma_map(internal, 0);
> + ifcvf_dma_map(internal, IFCVF_UNMAP);
>
> internal->sw_fallback_running = false;
> } else {
> --
> 2.12.2
>
>
next prev parent reply other threads:[~2021-09-27 2:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 16:45 jilei chen
2021-09-27 2:09 ` Wang, Xiao W [this message]
2021-09-27 5:17 ` [dpdk-dev] [PATCH] vdpa/ifc: increase readability in function jilei chen
2021-09-27 10:17 ` [dpdk-dev] [PATCH] [v3] " jilei chen
2021-09-28 2:22 ` Wang, Xiao W
2021-09-30 17:24 ` Ferruh Yigit
-- strict thread matches above, loose matches on Subject: below --
2021-09-26 15:57 [dpdk-dev] [PATCH] Enhance code readability when dma_map in ifc/ifcvp_vdpa jilei chen
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=DM8PR11MB5751658ACED25B1C8FB7CF82B8A79@DM8PR11MB5751.namprd11.prod.outlook.com \
--to=xiao.w.wang@intel.com \
--cc=chenjilei@cmss.chinamobile.com \
--cc=dev@dpdk.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).