[dpdk-dev] [PATCH 05/22] event/dlb2: add inline functions

Eads, Gage gage.eads at intel.com
Tue Oct 6 23:33:28 CEST 2020



> -----Original Message-----
> From: McDaniel, Timothy <timothy.mcdaniel at intel.com>
> Sent: Friday, September 11, 2020 3:26 PM
> Cc: dev at dpdk.org; Carrillo, Erik G <erik.g.carrillo at intel.com>; Eads, Gage
> <gage.eads at intel.com>; Van Haaren, Harry <harry.van.haaren at intel.com>;
> jerinj at marvell.com
> Subject: [PATCH 05/22] event/dlb2: add inline functions
> 
> Add miscellaneous inline functions that may be called
> from multiple files.  These functions include inline
> assembly of new x86 instructions, such as movdir64b,
> since they are not available as builtin functions in
> the minimum supported GCC version.
> 
> Signed-off-by: Timothy McDaniel <timothy.mcdaniel at intel.com>
> ---
>  drivers/event/dlb2/dlb2_inline_fns.h | 85
> ++++++++++++++++++++++++++++++++++++
>  1 file changed, 85 insertions(+)
>  create mode 100644 drivers/event/dlb2/dlb2_inline_fns.h
> 
> diff --git a/drivers/event/dlb2/dlb2_inline_fns.h
> b/drivers/event/dlb2/dlb2_inline_fns.h
> new file mode 100644
> index 0000000..f2f0935
> --- /dev/null
> +++ b/drivers/event/dlb2/dlb2_inline_fns.h
> @@ -0,0 +1,85 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2016-2020 Intel Corporation
> + */
> +
> +#ifndef _DLB2_INLINE_FNS_H_
> +#define _DLB2_INLINE_FNS_H_
> +
> +/* Inline functions required in more than one source file.
> + */

Nit: this comment can be a one-liner.

> +
> +static inline struct dlb2_eventdev *
> +dlb2_pmd_priv(const struct rte_eventdev *eventdev)
> +{
> +	return eventdev->data->dev_private;
> +}
> +
> +static inline void
> +dlb2_umonitor(volatile void *addr)
> +{
> +	/* TODO: Change to proper assembly when compiler support available */

I would drop/reword the 'TODO', here and elsewhere in the file, so it doesn't give the
wrong impression that this code is incomplete.

> +	asm volatile(".byte 0xf3, 0x0f, 0xae, 0xf7\t\n"
> +			:
> +			: "D" (addr));
> +}

Thanks,
Gage


More information about the dev mailing list