From: "Loftus, Ciara" <ciara.loftus@intel.com>
To: "Wang, Haiyue" <haiyue.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhang, Qi Z" <qi.z.zhang@intel.com>
Subject: RE: [PATCH v1] net/af_xdp: make umem configure code more readable
Date: Thu, 10 Feb 2022 08:53:29 +0000 [thread overview]
Message-ID: <CO1PR11MB4785106C4C2E9F0CEF660B878E2F9@CO1PR11MB4785.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220209124358.137807-1-haiyue.wang@intel.com>
> Subject: [PATCH v1] net/af_xdp: make umem configure code more readable
>
> The below compile time defined style make the code not so readable, the
> first function end block is after "#endif" segment.
>
> #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
>
> xdp_umem_configure()
> {
>
> #else
> xdp_umem_configure()
> {
>
> #endif
> 'shared code block'
> }
>
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Thanks for the patch!
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
> drivers/net/af_xdp/rte_eth_af_xdp.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c
> b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 1b6192fa44..802f912cb7 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -1078,6 +1078,12 @@ xsk_umem_info *xdp_umem_configure(struct
> pmd_internals *internals,
> __atomic_store_n(&umem->refcnt, 1, __ATOMIC_RELEASE);
> }
>
> + return umem;
> +
> +err:
> + xdp_umem_destroy(umem);
> + return NULL;
> +}
> #else
> static struct
> xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
> @@ -1138,13 +1144,13 @@ xsk_umem_info *xdp_umem_configure(struct
> pmd_internals *internals,
> }
> umem->mz = mz;
>
> -#endif
> return umem;
>
> err:
> xdp_umem_destroy(umem);
> return NULL;
> }
> +#endif
>
> static int
> load_custom_xdp_prog(const char *prog_path, int if_index, struct bpf_map
> **map)
> --
> 2.35.1
next prev parent reply other threads:[~2022-02-10 8:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 12:43 Haiyue Wang
2022-02-10 8:53 ` Loftus, Ciara [this message]
2022-02-10 10:31 ` Ferruh Yigit
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=CO1PR11MB4785106C4C2E9F0CEF660B878E2F9@CO1PR11MB4785.namprd11.prod.outlook.com \
--to=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
--cc=haiyue.wang@intel.com \
--cc=qi.z.zhang@intel.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).