@@ -5,10 +5,6 @@
#ifndef PACKET_BURST_GENERATOR_H_
#define PACKET_BURST_GENERATOR_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_mbuf.h>
#include <rte_ether.h>
#include <rte_arp.h>
@@ -17,6 +13,10 @@ extern "C" {
#include <rte_tcp.h>
#include <rte_sctp.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define IPV4_ADDR(a, b, c, d)(((a & 0xff) << 24) | ((b & 0xff) << 16) | \
((c & 0xff) << 8) | (d & 0xff))
@@ -5,12 +5,12 @@
#ifndef __VIRTUAL_ETHDEV_H_
#define __VIRTUAL_ETHDEV_H_
+#include <rte_ether.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ether.h>
-
int
virtual_ethdev_init(void);
@@ -43,10 +43,17 @@ chkextern = find_program('chkextern.py')
missing_extern_headers = run_command(chkextern, 'missing', dpdk_chkinc_headers,
capture: true, check: true).stdout().split()
+redundant_extern_headers = run_command(chkextern, 'redundant', dpdk_chkinc_headers,
+ capture: true, check: true).stdout().split()
+
if missing_extern_headers != []
error('Files missing C++ \'extern "C"\' guards:\n- ' + '\n- '.join(missing_extern_headers))
endif
+if redundant_extern_headers != []
+ error('Redundant C++ \'extern "C"\' guards:\n- ' + '\n- '.join(redundant_extern_headers))
+endif
+
gen_cpp_files = generator(gen_c_file_for_header,
output: '@BASENAME@.cpp',
arguments: ['@INPUT@', '@OUTPUT@'])
@@ -11,10 +11,6 @@
* Auxiliary Bus Interface.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@@ -28,6 +24,10 @@ extern "C" {
#include <dev_driver.h>
#include <rte_kvargs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_BUS_AUXILIARY_NAME "auxiliary"
/* Forward declarations */
@@ -10,10 +10,6 @@
* AMD CDX bus interface
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdlib.h>
#include <inttypes.h>
#include <linux/types.h>
@@ -22,6 +18,10 @@ extern "C" {
#include <dev_driver.h>
#include <rte_interrupts.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward declarations */
struct rte_cdx_device;
struct rte_cdx_driver;
@@ -8,14 +8,14 @@
#ifndef __FSL_QMAN_H
#define __FSL_QMAN_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <dpaa_rbtree.h>
#include <rte_compat.h>
#include <rte_eventdev.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* FQ lookups (turn this on for 64bit user-space) */
#ifdef RTE_ARCH_64
#define CONFIG_FSL_QMAN_FQ_LOOKUP
@@ -13,10 +13,6 @@
* RTE FSLMC Bus Interface
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@@ -40,6 +36,10 @@ extern "C" {
#include "portal/dpaa2_hw_pvt.h"
#include "portal/dpaa2_hw_dpio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define FSLMC_OBJECT_MAX_LEN 32 /**< Length of each device on bus */
#define DPAA2_INVALID_MBUF_SEQN 0
@@ -6,14 +6,14 @@
#ifndef BUS_PCI_DRIVER_H
#define BUS_PCI_DRIVER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_bus_pci.h>
#include <dev_driver.h>
#include <rte_compat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Pathname of PCI devices directory. */
__rte_internal
const char *rte_pci_get_sysfs_path(void);
@@ -11,10 +11,6 @@
* PCI device & driver interface
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@@ -27,6 +23,10 @@ extern "C" {
#include <rte_interrupts.h>
#include <rte_pci.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward declarations */
struct rte_pci_device;
struct rte_pci_driver;
@@ -10,10 +10,6 @@
* Platform bus interface.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stddef.h>
#include <stdint.h>
@@ -23,6 +19,10 @@ extern "C" {
#include <rte_os.h>
#include <rte_vfio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward declarations */
struct rte_platform_bus;
struct rte_platform_device;
@@ -5,15 +5,15 @@
#ifndef BUS_VDEV_DRIVER_H
#define BUS_VDEV_DRIVER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_bus_vdev.h>
#include <rte_compat.h>
#include <dev_driver.h>
#include <rte_devargs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_vdev_device {
RTE_TAILQ_ENTRY(rte_vdev_device) next; /**< Next attached vdev */
struct rte_device device; /**< Inherit core device */
@@ -6,14 +6,14 @@
#ifndef BUS_VMBUS_DRIVER_H
#define BUS_VMBUS_DRIVER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_bus_vmbus.h>
#include <rte_compat.h>
#include <dev_driver.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct vmbus_channel;
struct vmbus_mon_page;
@@ -11,10 +11,6 @@
*
* VMBUS Interface
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@@ -28,6 +24,10 @@ extern "C" {
#include <rte_interrupts.h>
#include <rte_vmbus_reg.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward declarations */
struct rte_vmbus_device;
struct rte_vmbus_driver;
@@ -5,16 +5,16 @@
#ifndef _CNXK_DMA_EVENT_DP_H_
#define _CNXK_DMA_EVENT_DP_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_eventdev.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
__rte_internal
uint16_t cn10k_dma_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_events);
@@ -5,12 +5,12 @@
#ifndef IOAT_HW_DEFS_H
#define IOAT_HW_DEFS_H
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-
#define IOAT_PCI_CHANERR_INT_OFFSET 0x180
#define IOAT_VER_3_0 0x30
@@ -11,14 +11,14 @@
#ifndef _RTE_PMD_DLB2_H_
#define _RTE_PMD_DLB2_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
@@ -12,13 +12,13 @@
*
*/
+#include <rte_compat.h>
+#include <rte_mempool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_compat.h>
-#include <rte_mempool.h>
-
/**
* Get BPID corresponding to the packet pool
*
@@ -8,10 +8,6 @@
#include "rte_avp_common.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef __KERNEL__
/* Write memory barrier for kernel compiles */
#define AVP_WMB() smp_wmb()
@@ -27,6 +23,10 @@ extern "C" {
#ifndef __KERNEL__
#include <rte_debug.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Initializes the avp fifo structure
*/
@@ -17,12 +17,12 @@
* load balancing of network ports
*/
+#include <rte_ether.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ether.h>
-
/* Supported modes of operation of link bonding library */
#define BONDING_MODE_ROUND_ROBIN (0)
@@ -14,14 +14,14 @@
*
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Response sent back to i40e driver from user app after callback
*/
@@ -11,14 +11,14 @@
* API for mlx5 PMD trace support
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <mlx5_prm.h>
#include <rte_mbuf.h>
#include <rte_trace_point.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* TX burst subroutines trace points. */
RTE_TRACE_POINT_FP(
rte_pmd_mlx5_trace_tx_entry,
@@ -5,12 +5,12 @@
#ifndef _RTE_ETH_RING_H_
#define _RTE_ETH_RING_H_
+#include <rte_ring.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ring.h>
-
/**
* Create a new ethdev port from a set of rings
*
@@ -5,15 +5,15 @@
#ifndef _RTE_ETH_VHOST_H_
#define _RTE_ETH_VHOST_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdbool.h>
#include <rte_vhost.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Event description.
*/
@@ -5,10 +5,6 @@
#ifndef AFU_PMD_CORE_H
#define AFU_PMD_CORE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
@@ -20,6 +16,10 @@ extern "C" {
#include "ifpga_rawdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define AFU_RAWDEV_MAX_DRVS 32
struct afu_rawdev;
@@ -5,13 +5,13 @@
#ifndef AFU_PMD_HE_HSSI_H
#define AFU_PMD_HE_HSSI_H
+#include "afu_pmd_core.h"
+#include "rte_pmd_afu.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "afu_pmd_core.h"
-#include "rte_pmd_afu.h"
-
#define HE_HSSI_UUID_L 0xbb370242ac130002
#define HE_HSSI_UUID_H 0x823c334c98bf11ea
#define NUM_HE_HSSI_PORTS 8
@@ -5,13 +5,13 @@
#ifndef AFU_PMD_HE_LPBK_H
#define AFU_PMD_HE_LPBK_H
+#include "afu_pmd_core.h"
+#include "rte_pmd_afu.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "afu_pmd_core.h"
-#include "rte_pmd_afu.h"
-
#define HE_LPBK_UUID_L 0xb94b12284c31e02b
#define HE_LPBK_UUID_H 0x56e203e9864f49a7
#define HE_MEM_LPBK_UUID_L 0xbb652a578330a8eb
@@ -5,13 +5,13 @@
#ifndef AFU_PMD_HE_MEM_H
#define AFU_PMD_HE_MEM_H
+#include "afu_pmd_core.h"
+#include "rte_pmd_afu.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "afu_pmd_core.h"
-#include "rte_pmd_afu.h"
-
#define HE_MEM_TG_UUID_L 0xa3dc5b831f5cecbb
#define HE_MEM_TG_UUID_H 0x4dadea342c7848cb
@@ -5,13 +5,13 @@
#ifndef AFU_PMD_N3000_H
#define AFU_PMD_N3000_H
+#include "afu_pmd_core.h"
+#include "rte_pmd_afu.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "afu_pmd_core.h"
-#include "rte_pmd_afu.h"
-
#define N3000_AFU_UUID_L 0xc000c9660d824272
#define N3000_AFU_UUID_H 0x9aeffe5f84570612
#define N3000_NLB0_UUID_L 0xf89e433683f9040b
@@ -14,12 +14,12 @@
*
*/
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-
#define RTE_PMD_AFU_N3000_NLB 1
#define RTE_PMD_AFU_N3000_DMA 2
@@ -14,12 +14,12 @@
*
*/
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-
#define IFPGA_MAX_PORT_NUM 4
/**
@@ -30,14 +30,14 @@
* rte_ethtool_net_set_rx_mode net_device_ops::ndo_set_rx_mode
*
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_ethdev.h>
#include <linux/ethtool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Retrieve the Ethernet device driver information according to
* attributes described by ethtool data structure, ethtool_drvinfo.
@@ -5,12 +5,12 @@
#ifndef _MAIN_H_
#define _MAIN_H_
+#include <rte_sched.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_sched.h>
-
#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
/*
@@ -5,16 +5,16 @@
#ifndef CHANNEL_MANAGER_H_
#define CHANNEL_MANAGER_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <linux/limits.h>
#include <linux/un.h>
#include <stdbool.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Maximum name length including '\0' terminator */
#define CHANNEL_MGR_MAX_NAME_LEN 64
@@ -5,10 +5,6 @@
#ifndef _RTE_ACL_OSDEP_H_
#define _RTE_ACL_OSDEP_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
*
@@ -49,8 +45,4 @@ extern "C" {
#include <rte_cpuflags.h>
#include <rte_debug.h>
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_ACL_OSDEP_H_ */
@@ -20,10 +20,6 @@
* from the same queue.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdbool.h>
@@ -32,6 +28,10 @@ extern "C" {
#include "rte_bbdev_op.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_BBDEV_MAX_DEVS
#define RTE_BBDEV_MAX_DEVS 128 /**< Max number of devices */
#endif
@@ -11,10 +11,6 @@
* Defines wireless base band layer 1 operations and capabilities
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
@@ -23,6 +19,10 @@ extern "C" {
#include <rte_memory.h>
#include <rte_mempool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Number of columns in sub-block interleaver (36.212, section 5.1.4.1.1) */
#define RTE_BBDEV_TURBO_C_SUBBLOCK (32)
/* Maximum size of Transport Block (36.213, Table, Table 7.1.7.2.5-1) */
@@ -14,15 +14,15 @@
* bbdev interface. User applications should not use this API.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_log.h>
#include "rte_bbdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Suggested value for SW based devices */
#define RTE_BBDEV_DEFAULT_MAX_NB_QUEUES RTE_MAX_LCORE
@@ -7,10 +7,6 @@
#ifndef _RTE_BPF_DEF_H_
#define _RTE_BPF_DEF_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
*
@@ -25,7 +21,6 @@ extern "C" {
#include <stdint.h>
-
/*
* The instruction encodings.
*/
@@ -144,8 +139,4 @@ struct ebpf_insn {
*/
#define EBPF_FUNC_MAX_ARGS (EBPF_REG_6 - EBPF_REG_1)
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_BPF_DEF_H_ */
@@ -11,12 +11,12 @@
* RTE definitions for Data Compression Service
*/
+#include <rte_mbuf.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_mbuf.h>
-
/**
* compression service feature flags
*
@@ -13,13 +13,13 @@
* Defines comp device APIs for the provisioning of compression operations.
*/
+
+#include "rte_comp.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-
-#include "rte_comp.h"
-
/**
* Parameter log base 2 range description.
* Final value will be 2^value.
@@ -5,10 +5,6 @@
#ifndef _RTE_COMPRESSDEV_INTERNAL_H_
#define _RTE_COMPRESSDEV_INTERNAL_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* rte_compressdev_internal.h
* This file holds Compressdev private data structures.
*/
@@ -16,6 +12,10 @@ extern "C" {
#include "rte_comp.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_COMPRESSDEV_NAME_MAX_LEN (64)
/**< Max length of name of comp PMD */
@@ -13,10 +13,6 @@
* them directly.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <string.h>
#include <dev_driver.h>
@@ -24,6 +20,10 @@ extern "C" {
#include "rte_compressdev.h"
#include "rte_compressdev_internal.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_COMPRESSDEV_PMD_NAME_ARG ("name")
#define RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG ("socket_id")
@@ -5,10 +5,6 @@
#ifndef _CRYPTODEV_PMD_H_
#define _CRYPTODEV_PMD_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** @file
* RTE Crypto PMD APIs
*
@@ -28,6 +24,10 @@ extern "C" {
#include "rte_crypto.h"
#include "rte_cryptodev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS 8
@@ -11,14 +11,14 @@
* API for cryptodev trace support
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_trace_point.h>
#include "rte_cryptodev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
RTE_TRACE_POINT(
rte_cryptodev_trace_configure,
RTE_TRACE_POINT_ARGS(uint8_t dev_id,
@@ -11,10 +11,6 @@
* RTE Cryptography Common Definitions
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_mbuf.h>
#include <rte_memory.h>
@@ -24,6 +20,10 @@ extern "C" {
#include "rte_crypto_sym.h"
#include "rte_crypto_asym.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Crypto operation types */
enum rte_crypto_op_type {
RTE_CRYPTO_OP_TYPE_UNDEFINED,
@@ -14,10 +14,6 @@
* asymmetric crypto operations.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <string.h>
#include <stdint.h>
@@ -728,8 +724,4 @@ struct rte_crypto_asym_op {
*/
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_CRYPTO_ASYM_H_ */
@@ -14,10 +14,6 @@
* as supported symmetric crypto operation combinations.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <string.h>
#include <rte_compat.h>
@@ -26,6 +22,10 @@ extern "C" {
#include <rte_mempool.h>
#include <rte_common.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Crypto IO Vector (in analogy with struct iovec)
* Supposed be used to pass input/output data buffers for crypto data-path
@@ -14,10 +14,6 @@
* authentication operations.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include "rte_kvargs.h"
#include "rte_crypto.h"
@@ -1859,6 +1855,10 @@ int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
struct rte_cryptodev_cb *cb);
#include <rte_cryptodev_core.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
*
* Dequeue a burst of processed crypto operations from a queue on the crypto
@@ -5,12 +5,12 @@
#ifndef _RTE_CRYPTODEV_TRACE_FP_H_
#define _RTE_CRYPTODEV_TRACE_FP_H_
+#include <rte_trace_point.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_trace_point.h>
-
RTE_TRACE_POINT_FP(
rte_cryptodev_trace_enqueue_burst,
RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, void **ops,
@@ -19,16 +19,16 @@
* event device.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <stdint.h>
#include <rte_compat.h>
#include <rte_eventdev.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Function prototype for match callbacks.
*
@@ -772,9 +772,17 @@ struct rte_dma_sge {
uint32_t length; /**< The DMA operation length. */
};
+#ifdef __cplusplus
+}
+#endif
+
#include "rte_dmadev_core.h"
#include "rte_dmadev_trace_fp.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**@{@name DMA operation flag
* @see rte_dma_copy()
* @see rte_dma_copy_sg()
@@ -9,12 +9,12 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
+#include "generic/rte_atomic.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_atomic.h"
-
#define rte_mb() __sync_synchronize()
#define rte_wmb() do { asm volatile ("dmb st" : : : "memory"); } while (0)
@@ -10,14 +10,14 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_atomic.h"
#include <rte_branch_prediction.h>
#include <rte_debug.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define rte_mb() asm volatile("dmb osh" : : : "memory")
#define rte_wmb() asm volatile("dmb oshst" : : : "memory")
@@ -9,14 +9,14 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
#include "generic/rte_byteorder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* ARM architecture is bi-endian (both big and little). */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -5,10 +5,6 @@
#ifndef _RTE_CPUFLAGS_ARM32_H_
#define _RTE_CPUFLAGS_ARM32_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Enumeration of all CPU features supported
*/
@@ -46,8 +42,4 @@ enum rte_cpu_flag_t {
#include "generic/rte_cpuflags.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_CPUFLAGS_ARM32_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_CPUFLAGS_ARM64_H_
#define _RTE_CPUFLAGS_ARM64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Enumeration of all CPU features supported
*/
@@ -40,8 +36,4 @@ enum rte_cpu_flag_t {
#include "generic/rte_cpuflags.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_CPUFLAGS_ARM64_H_ */
@@ -15,12 +15,12 @@
#include <time.h>
+#include "generic/rte_cycles.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_cycles.h"
-
/**
* Read the time base register.
*
@@ -6,12 +6,12 @@
#ifndef _RTE_CYCLES_ARM64_H_
#define _RTE_CYCLES_ARM64_H_
+#include "generic/rte_cycles.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_cycles.h"
-
/** Read generic counter frequency */
static __rte_always_inline uint64_t
__rte_arm64_cntfrq(void)
@@ -5,18 +5,10 @@
#ifndef _RTE_IO_ARM_H_
#define _RTE_IO_ARM_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef RTE_ARCH_64
#include "rte_io_64.h"
#else
#include "generic/rte_io.h"
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_IO_ARM_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_IO_ARM64_H_
#define _RTE_IO_ARM64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#define RTE_OVERRIDE_IO_H
@@ -17,6 +13,10 @@ extern "C" {
#include <rte_compat.h>
#include "rte_atomic_64.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static __rte_always_inline uint8_t
rte_read8_relaxed(const volatile void *addr)
{
@@ -8,10 +8,6 @@
#include <stdint.h>
#include <string.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_memcpy.h"
#ifdef RTE_ARCH_ARM_NEON_MEMCPY
@@ -23,6 +19,10 @@ extern "C" {
/* ARM NEON Intrinsics are used to copy data */
#include <arm_neon.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void
rte_mov16(uint8_t *dst, const uint8_t *src)
{
@@ -5,10 +5,6 @@
#ifndef _RTE_MEMCPY_ARM64_H_
#define _RTE_MEMCPY_ARM64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <string.h>
@@ -18,6 +14,10 @@ extern "C" {
#include <rte_common.h>
#include <rte_branch_prediction.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* The memory copy performance differs on different AArch64 micro-architectures.
* And the most recent glibc (e.g. 2.23 or later) can provide a better memcpy()
@@ -324,7 +324,16 @@ void *rte_memcpy(void *dst, const void *src, size_t n)
}
#endif /* RTE_CACHE_LINE_SIZE >= 128 */
-#else
+#ifdef __cplusplus
+}
+#endif
+
+#else /* RTE_ARCH_ARM64_MEMCPY */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void
rte_mov16(uint8_t *dst, const uint8_t *src)
{
@@ -363,10 +372,10 @@ rte_mov256(uint8_t *dst, const uint8_t *src)
#define rte_memcpy(d, s, n) memcpy((d), (s), (n))
-#endif /* RTE_ARCH_ARM64_MEMCPY */
-
#ifdef __cplusplus
}
#endif
+#endif /* RTE_ARCH_ARM64_MEMCPY */
+
#endif /* _RTE_MEMCPY_ARM_64_H_ */
@@ -5,18 +5,10 @@
#ifndef _RTE_PAUSE_ARM_H_
#define _RTE_PAUSE_ARM_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef RTE_ARCH_64
#include <rte_pause_64.h>
#else
#include <rte_pause_32.h>
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_PAUSE_ARM_H_ */
@@ -5,13 +5,13 @@
#ifndef _RTE_PAUSE_ARM32_H_
#define _RTE_PAUSE_ARM32_H_
+#include <rte_common.h>
+#include "generic/rte_pause.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include "generic/rte_pause.h"
-
static inline void rte_pause(void)
{
}
@@ -6,10 +6,6 @@
#ifndef _RTE_PAUSE_ARM64_H_
#define _RTE_PAUSE_ARM64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_stdatomic.h>
@@ -19,6 +15,10 @@ extern "C" {
#include "generic/rte_pause.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_pause(void)
{
asm volatile("yield" ::: "memory");
@@ -5,16 +5,8 @@
#ifndef _RTE_POWER_INTRINSIC_ARM_H_
#define _RTE_POWER_INTRINSIC_ARM_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include "generic/rte_power_intrinsics.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_POWER_INTRINSIC_ARM_H_ */
@@ -5,14 +5,14 @@
#ifndef _RTE_PREFETCH_ARM32_H_
#define _RTE_PREFETCH_ARM32_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include "generic/rte_prefetch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_prefetch0(const volatile void *p)
{
asm volatile ("pld [%0]" : : "r" (p));
@@ -5,14 +5,14 @@
#ifndef _RTE_PREFETCH_ARM_64_H_
#define _RTE_PREFETCH_ARM_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include "generic/rte_prefetch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_prefetch0(const volatile void *p)
{
asm volatile ("PRFM PLDL1KEEP, [%0]" : : "r" (p));
@@ -5,12 +5,12 @@
#ifndef _RTE_RWLOCK_ARM_H_
#define _RTE_RWLOCK_ARM_H_
+#include "generic/rte_rwlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_rwlock.h"
-
static inline void
rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
{
@@ -9,13 +9,13 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
+#include <rte_common.h>
+#include "generic/rte_spinlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include "generic/rte_spinlock.h"
-
static inline int rte_tm_supported(void)
{
return 0;
@@ -5,10 +5,6 @@
#ifndef _RTE_OS_H_
#define _RTE_OS_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* This header should contain any definition
* which is not supported natively or named differently in FreeBSD.
@@ -78,8 +74,4 @@ typedef cpuset_t rte_cpuset_t;
#endif /* RTE_EAL_FREEBSD_CPUSET_LEGACY */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_OS_H_ */
@@ -5,16 +5,16 @@
#ifndef BUS_DRIVER_H
#define BUS_DRIVER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_bus.h>
#include <rte_compat.h>
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_tailq.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_devargs;
struct rte_device;
@@ -5,10 +5,6 @@
#ifndef DEV_DRIVER_H
#define DEV_DRIVER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_dev.h>
@@ -34,8 +30,4 @@ struct rte_device {
struct rte_devargs *devargs; /**< Arguments for latest probing */
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* DEV_DRIVER_H */
@@ -11,16 +11,16 @@
* API for EAL trace support
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_alarm.h>
#include <rte_interrupts.h>
#include <rte_trace_point.h>
#include "eal_interrupts.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Alarm */
RTE_TRACE_POINT(
rte_eal_trace_alarm_set,
@@ -17,6 +17,10 @@
#include <rte_common.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __DOXYGEN__
/** @name Memory Barrier
@@ -1156,4 +1160,8 @@ rte_atomic128_cmp_exchange(rte_int128_t *dst,
#endif /* __DOXYGEN__ */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_ATOMIC_H_ */
@@ -24,6 +24,10 @@
#include <rte_common.h>
#include <rte_config.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Compile-time endianness detection
*/
@@ -251,4 +255,8 @@ static uint64_t rte_be_to_cpu_64(rte_be64_t x);
#endif
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_BYTEORDER_H_ */
@@ -15,6 +15,10 @@
#include <rte_compat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Structure used to describe platform-specific intrinsics that may or may not
* be supported at runtime.
@@ -104,4 +108,8 @@ rte_cpu_getauxval(unsigned long type);
int
rte_cpu_strcmp_auxval(unsigned long type, const char *str);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_CPUFLAGS_H_ */
@@ -16,6 +16,10 @@
#include <rte_debug.h>
#include <rte_atomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MS_PER_S 1000
#define US_PER_S 1000000
#define NS_PER_S 1000000000
@@ -175,4 +179,8 @@ void rte_delay_us_sleep(unsigned int us);
*/
void rte_delay_us_callback_register(void(*userfunc)(unsigned int));
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_CYCLES_H_ */
@@ -17,6 +17,10 @@
#include <rte_compat.h>
#include <rte_atomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __DOXYGEN__
/**
@@ -396,4 +400,8 @@ rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
#endif /* RTE_OVERRIDE_IO_H */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_IO_H_ */
@@ -5,6 +5,10 @@
#ifndef _RTE_MEMCPY_H_
#define _RTE_MEMCPY_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @file
*
@@ -113,4 +117,8 @@ rte_memcpy(void *dst, const void *src, size_t n);
#endif /* __DOXYGEN__ */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_MEMCPY_H_ */
@@ -19,6 +19,10 @@
#include <rte_atomic.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Pause CPU execution for a short while
*
@@ -136,4 +140,8 @@ rte_wait_until_equal_64(volatile uint64_t *addr, uint64_t expected,
} while (0)
#endif /* ! RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_PAUSE_H_ */
@@ -9,6 +9,10 @@
#include <rte_spinlock.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @file
* Advanced power management operations.
@@ -147,4 +151,8 @@ int rte_power_pause(const uint64_t tsc_timestamp);
int rte_power_monitor_multi(const struct rte_power_monitor_cond pmc[],
const uint32_t num, const uint64_t tsc_timestamp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_POWER_INTRINSIC_H_ */
@@ -7,6 +7,10 @@
#include <rte_compat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @file
*
@@ -146,4 +150,8 @@ __rte_experimental
static inline void
rte_cldemote(const volatile void *p);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_PREFETCH_H_ */
@@ -22,10 +22,6 @@
* https://locklessinc.com/articles/locks/
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <errno.h>
#include <rte_branch_prediction.h>
@@ -34,6 +30,10 @@ extern "C" {
#include <rte_pause.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The rte_rwlock_t type.
*
@@ -25,6 +25,10 @@
#include <rte_pause.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The rte_spinlock_t type.
*/
@@ -318,4 +322,8 @@ __rte_warn_unused_result
static inline int rte_spinlock_recursive_trylock_tm(
rte_spinlock_recursive_t *slr);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_SPINLOCK_H_ */
@@ -209,6 +209,10 @@ enum rte_vect_max_simd {
*/
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Get the supported SIMD bitwidth.
*
@@ -230,4 +234,8 @@ uint16_t rte_vect_get_max_simd_bitwidth(void);
*/
int rte_vect_set_max_simd_bitwidth(uint16_t bitwidth);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_VECT_H_ */
@@ -14,12 +14,12 @@
* Does not require hpet support.
*/
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-
/**
* Signature of callback back function called when an alarm goes off.
*/
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_BITMAP_H__
#define __INCLUDE_RTE_BITMAP_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Bitmap
@@ -43,6 +39,10 @@ extern "C" {
#include <rte_branch_prediction.h>
#include <rte_prefetch.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Slab */
#define RTE_BITMAP_SLAB_BIT_SIZE 64
#define RTE_BITMAP_SLAB_BIT_SIZE_LOG2 6
@@ -10,10 +10,6 @@
#ifndef _RTE_BRANCH_PREDICTION_H_
#define _RTE_BRANCH_PREDICTION_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Check if a branch is likely to be taken.
*
@@ -48,8 +44,4 @@ extern "C" {
#endif
#endif /* unlikely */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_BRANCH_PREDICTION_H_ */
@@ -14,14 +14,14 @@
* over the devices and drivers in EAL.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <rte_eal.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_bus;
struct rte_device;
@@ -18,12 +18,12 @@
* cryptographic co-processor (crypto), etc.
*/
+#include <rte_dev.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_dev.h>
-
/** Double linked list of classes */
RTE_TAILQ_HEAD(rte_class_list, rte_class);
@@ -12,10 +12,6 @@
* for DPDK.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <assert.h>
#include <limits.h>
#include <stdint.h>
@@ -26,6 +22,10 @@ extern "C" {
/* OS specific include */
#include <rte_os.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_TOOLCHAIN_MSVC
#ifndef typeof
#define typeof __typeof__
@@ -6,10 +6,6 @@
#ifndef _RTE_COMPAT_H_
#define _RTE_COMPAT_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef ALLOW_EXPERIMENTAL_API
#ifdef RTE_TOOLCHAIN_MSVC
@@ -70,8 +66,4 @@ __attribute__((section(".text.internal")))
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_COMPAT_H_ */
@@ -13,16 +13,16 @@
* This file manages the list of device drivers.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <rte_config.h>
#include <rte_common.h>
#include <rte_log.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_bus;
struct rte_devargs;
struct rte_device;
@@ -16,14 +16,14 @@
* list of rte_devargs structures.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <rte_dev.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_bus;
/**
@@ -11,12 +11,12 @@
* API for EAL trace support
*/
+#include <rte_trace_point.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_trace_point.h>
-
/* Generic */
RTE_TRACE_POINT(
rte_eal_trace_generic_void,
@@ -11,12 +11,12 @@
#ifndef _RTE_ERRNO_H_
#define _RTE_ERRNO_H_
+#include <rte_per_lcore.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_per_lcore.h>
-
RTE_DECLARE_PER_LCORE(int, _rte_errno); /**< Per core error number. */
/**
@@ -30,14 +30,14 @@
* another process is using ``rte_fbarray``.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <rte_rwlock.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_FBARRAY_NAME_LEN 64
struct rte_fbarray {
@@ -10,13 +10,13 @@
#ifndef _KEEPALIVE_H_
#define _KEEPALIVE_H_
+#include <rte_config.h>
+#include <rte_memory.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_config.h>
-#include <rte_memory.h>
-
#ifndef RTE_KEEPALIVE_MAXCORES
/**
* Number of cores to track.
@@ -19,16 +19,16 @@
* they acquired the lock.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_lcore.h>
#include <rte_common.h>
#include <rte_pause.h>
#include <rte_branch_prediction.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The rte_mcslock_t type.
*/
@@ -15,16 +15,16 @@
#include <stddef.h>
#include <stdio.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_bitops.h>
#include <rte_common.h>
#include <rte_config.h>
#include <rte_eal_memconfig.h>
#include <rte_fbarray.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_PGSIZE_4K (1ULL << 12)
#define RTE_PGSIZE_64K (1ULL << 16)
#define RTE_PGSIZE_256K (1ULL << 18)
@@ -5,10 +5,6 @@
#ifndef _RTE_PCI_DEV_DEFS_H_
#define _RTE_PCI_DEV_DEFS_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* interrupt mode */
enum rte_intr_mode {
RTE_INTR_MODE_NONE = 0,
@@ -17,8 +13,4 @@ enum rte_intr_mode {
RTE_INTR_MODE_MSIX
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_PCI_DEV_DEFS_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_PCI_DEV_FEATURES_H
#define _RTE_PCI_DEV_FEATURES_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_pci_dev_feature_defs.h>
#define RTE_INTR_MODE_NONE_NAME "none"
@@ -16,8 +12,4 @@ extern "C" {
#define RTE_INTR_MODE_MSI_NAME "msi"
#define RTE_INTR_MODE_MSIX_NAME "msix"
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -18,10 +18,6 @@
* Parts of this are execution environment specific.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef RTE_TOOLCHAIN_MSVC
#define RTE_DEFINE_PER_LCORE(type, name) \
__declspec(thread) type per_lcore_##name
@@ -49,8 +45,4 @@ extern "C" {
*/
#define RTE_PER_LCORE(name) (per_lcore_##name)
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_PER_LCORE_H_ */
@@ -27,14 +27,14 @@
* All locks must be initialised before use, and only initialised once.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_pause.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The rte_pflock_t type.
*/
@@ -11,12 +11,12 @@
* Pseudo-random Generators in RTE
*/
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-
/**
* Seed the pseudo-random generator.
*
@@ -5,10 +5,6 @@
#ifndef _RTE_SEQCOUNT_H_
#define _RTE_SEQCOUNT_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Seqcount
@@ -27,6 +23,10 @@ extern "C" {
#include <rte_branch_prediction.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The RTE seqcount type.
*/
@@ -5,10 +5,6 @@
#ifndef _RTE_SEQLOCK_H_
#define _RTE_SEQLOCK_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Seqlock
@@ -95,6 +91,10 @@ extern "C" {
#include <rte_seqcount.h>
#include <rte_spinlock.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The RTE seqlock type.
*/
@@ -23,16 +23,16 @@
* application has access to the remaining lcores as normal.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include<stdio.h>
#include <stdint.h>
#include <rte_config.h>
#include <rte_lcore.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_SERVICE_NAME_MAX 32
/* Capabilities of a service.
@@ -10,12 +10,12 @@
* operate, and you wish to run the component using service cores
*/
+#include <rte_service.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_service.h>
-
/**
* Signature of callback function to run a service.
*
@@ -7,10 +7,6 @@
#include <assert.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef RTE_ENABLE_STDATOMIC
#ifndef _MSC_VER
#ifdef __STDC_NO_ATOMICS__
@@ -188,6 +184,7 @@ typedef int rte_memory_order;
#endif
#ifdef __cplusplus
+extern "C" {
}
#endif
@@ -11,10 +11,6 @@
#ifndef _RTE_STRING_FNS_H_
#define _RTE_STRING_FNS_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -22,6 +18,10 @@ extern "C" {
#include <rte_common.h>
#include <rte_compat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Takes string "string" parameter and splits it at character "delim"
* up to maxtokens-1 times - to give "maxtokens" resulting tokens. Like
@@ -77,6 +77,10 @@ rte_strlcat(char *dst, const char *src, size_t size)
return l + strlen(src);
}
+#ifdef __cplusplus
+}
+#endif
+
/* pull in a strlcpy function */
#ifdef RTE_EXEC_ENV_FREEBSD
#ifndef __BSD_VISIBLE /* non-standard functions are hidden */
@@ -95,6 +99,10 @@ rte_strlcat(char *dst, const char *src, size_t size)
#endif /* RTE_USE_LIBBSD */
#endif /* FREEBSD */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Copy string src to buffer dst of size dsize.
* At most dsize-1 chars will be copied.
@@ -141,7 +149,6 @@ rte_str_skip_leading_spaces(const char *src)
return p;
}
-
#ifdef __cplusplus
}
#endif
@@ -10,13 +10,13 @@
* Here defines rte_tailq APIs for only internal use
*/
+#include <stdio.h>
+#include <rte_debug.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdio.h>
-#include <rte_debug.h>
-
/** dummy structure type used by the rte_tailq APIs */
struct rte_tailq_entry {
RTE_TAILQ_ENTRY(rte_tailq_entry) next; /**< Pointer entries for a tailq list */
@@ -17,15 +17,15 @@
* All locks must be initialised before use, and only initialised once.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_lcore.h>
#include <rte_pause.h>
#include <rte_stdatomic.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* The rte_ticketlock_t type.
*/
@@ -5,13 +5,13 @@
#ifndef _RTE_TIME_H_
#define _RTE_TIME_H_
+#include <stdint.h>
+#include <time.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-#include <time.h>
-
#define NSEC_PER_SEC 1000000000L
/**
@@ -16,16 +16,16 @@
* @b EXPERIMENTAL: this API may change without prior notice
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <stdio.h>
#include <rte_common.h>
#include <rte_compat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Test if trace is enabled.
*
@@ -16,10 +16,6 @@
* @b EXPERIMENTAL: this API may change without prior notice
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <stdio.h>
@@ -32,6 +28,10 @@ extern "C" {
#include <rte_string_fns.h>
#include <rte_uuid.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** The tracepoint object. */
typedef RTE_ATOMIC(uint64_t) rte_trace_point_t;
@@ -5,10 +5,6 @@
#ifndef _RTE_TRACE_POINT_REGISTER_H_
#define _RTE_TRACE_POINT_REGISTER_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef _RTE_TRACE_POINT_H_
#error for registration, include this file first before <rte_trace_point.h>
#endif
@@ -16,6 +12,10 @@ extern "C" {
#include <rte_per_lcore.h>
#include <rte_trace_point.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
RTE_DECLARE_PER_LCORE(volatile int, trace_point_sz);
#define RTE_TRACE_POINT_REGISTER(trace, name) \
@@ -10,14 +10,14 @@
#ifndef _RTE_UUID_H_
#define _RTE_UUID_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Struct describing a Universal Unique Identifier
*/
@@ -10,13 +10,13 @@
#ifndef _RTE_VERSION_H_
#define _RTE_VERSION_H_
+#include <string.h>
+#include <stdio.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <string.h>
-#include <stdio.h>
-
/**
* Macro to compute a version number usable for comparisons
*/
@@ -10,10 +10,6 @@
* RTE VFIO. This library provides various VFIO related utility functions.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <stdint.h>
@@ -32,6 +28,10 @@ extern "C" {
#endif /* kernel version >= 4.0.0 */
#endif /* RTE_EAL_VFIO */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef VFIO_PRESENT
#include <linux/vfio.h>
@@ -5,10 +5,6 @@
#ifndef _RTE_OS_H_
#define _RTE_OS_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* This header should contain any definition
* which is not supported natively or named differently in Linux.
@@ -46,8 +42,4 @@ typedef cpu_set_t rte_cpuset_t;
} while (0)
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_OS_H_ */
@@ -9,13 +9,13 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
+#include <rte_common.h>
+#include "generic/rte_atomic.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include "generic/rte_atomic.h"
-
#define rte_mb() do { asm volatile("dbar 0":::"memory"); } while (0)
#define rte_wmb() rte_mb()
@@ -5,12 +5,12 @@
#ifndef RTE_BYTEORDER_LOONGARCH_H
#define RTE_BYTEORDER_LOONGARCH_H
+#include "generic/rte_byteorder.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_byteorder.h"
-
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
#define rte_cpu_to_le_16(x) (x)
@@ -5,10 +5,6 @@
#ifndef RTE_CPUFLAGS_LOONGARCH_H
#define RTE_CPUFLAGS_LOONGARCH_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Enumeration of all CPU features supported
*/
@@ -30,8 +26,4 @@ enum rte_cpu_flag_t {
#include "generic/rte_cpuflags.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_CPUFLAGS_LOONGARCH_H */
@@ -5,12 +5,12 @@
#ifndef RTE_CYCLES_LOONGARCH_H
#define RTE_CYCLES_LOONGARCH_H
+#include "generic/rte_cycles.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_cycles.h"
-
/**
* Read the time base register.
*
@@ -5,14 +5,6 @@
#ifndef RTE_IO_LOONGARCH_H
#define RTE_IO_LOONGARCH_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_io.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_IO_LOONGARCH_H */
@@ -10,12 +10,12 @@
#include "rte_common.h"
+#include "generic/rte_memcpy.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_memcpy.h"
-
static inline void
rte_mov16(uint8_t *dst, const uint8_t *src)
{
@@ -5,14 +5,14 @@
#ifndef RTE_PAUSE_LOONGARCH_H
#define RTE_PAUSE_LOONGARCH_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "rte_atomic.h"
#include "generic/rte_pause.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_pause(void)
{
}
@@ -5,16 +5,8 @@
#ifndef RTE_POWER_INTRINSIC_LOONGARCH_H
#define RTE_POWER_INTRINSIC_LOONGARCH_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include "generic/rte_power_intrinsics.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_POWER_INTRINSIC_LOONGARCH_H */
@@ -5,14 +5,14 @@
#ifndef RTE_PREFETCH_LOONGARCH_H
#define RTE_PREFETCH_LOONGARCH_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include "generic/rte_prefetch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_prefetch0(const volatile void *p)
{
__builtin_prefetch((const void *)(uintptr_t)p, 0, 3);
@@ -5,12 +5,12 @@
#ifndef RTE_RWLOCK_LOONGARCH_H
#define RTE_RWLOCK_LOONGARCH_H
+#include "generic/rte_rwlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_rwlock.h"
-
static inline void
rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
{
@@ -5,13 +5,13 @@
#ifndef RTE_SPINLOCK_LOONGARCH_H
#define RTE_SPINLOCK_LOONGARCH_H
+#include <rte_common.h>
+#include "generic/rte_spinlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include "generic/rte_spinlock.h"
-
#ifndef RTE_FORCE_INTRINSICS
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
@@ -12,13 +12,13 @@
#ifndef _RTE_ATOMIC_PPC_64_H_
#define _RTE_ATOMIC_PPC_64_H_
+#include <stdint.h>
+#include "generic/rte_atomic.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-#include "generic/rte_atomic.h"
-
#define rte_mb() asm volatile("sync" : : : "memory")
#define rte_wmb() asm volatile("sync" : : : "memory")
@@ -8,13 +8,13 @@
#ifndef _RTE_BYTEORDER_PPC_64_H_
#define _RTE_BYTEORDER_PPC_64_H_
+#include <stdint.h>
+#include "generic/rte_byteorder.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-#include "generic/rte_byteorder.h"
-
/*
* An architecture-optimized byte swap for a 16-bit value.
*
@@ -6,10 +6,6 @@
#ifndef _RTE_CPUFLAGS_PPC_64_H_
#define _RTE_CPUFLAGS_PPC_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Enumeration of all CPU features supported
*/
@@ -52,8 +48,4 @@ enum rte_cpu_flag_t {
#include "generic/rte_cpuflags.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_CPUFLAGS_PPC_64_H_ */
@@ -6,10 +6,6 @@
#ifndef _RTE_CYCLES_PPC_64_H_
#define _RTE_CYCLES_PPC_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <features.h>
#ifdef __GLIBC__
#include <sys/platform/ppc.h>
@@ -20,6 +16,10 @@ extern "C" {
#include <rte_byteorder.h>
#include <rte_common.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Read the time base register.
*
@@ -5,14 +5,6 @@
#ifndef _RTE_IO_PPC_64_H_
#define _RTE_IO_PPC_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_io.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_IO_PPC_64_H_ */
@@ -12,12 +12,12 @@
#include "rte_altivec.h"
#include "rte_common.h"
+#include "generic/rte_memcpy.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_memcpy.h"
-
#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
@@ -5,14 +5,14 @@
#ifndef _RTE_PAUSE_PPC64_H_
#define _RTE_PAUSE_PPC64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "rte_atomic.h"
#include "generic/rte_pause.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_pause(void)
{
/* Set hardware multi-threading low priority */
@@ -5,16 +5,8 @@
#ifndef _RTE_POWER_INTRINSIC_PPC_H_
#define _RTE_POWER_INTRINSIC_PPC_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include "generic/rte_power_intrinsics.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_POWER_INTRINSIC_PPC_H_ */
@@ -6,14 +6,14 @@
#ifndef _RTE_PREFETCH_PPC_64_H_
#define _RTE_PREFETCH_PPC_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include "generic/rte_prefetch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_prefetch0(const volatile void *p)
{
asm volatile ("dcbt 0,%[p],0" : : [p] "r" (p));
@@ -3,12 +3,12 @@
#ifndef _RTE_RWLOCK_PPC_64_H_
#define _RTE_RWLOCK_PPC_64_H_
+#include "generic/rte_rwlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_rwlock.h"
-
static inline void
rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
{
@@ -6,14 +6,14 @@
#ifndef _RTE_SPINLOCK_PPC_64_H_
#define _RTE_SPINLOCK_PPC_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_pause.h>
#include "generic/rte_spinlock.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Fixme: Use intrinsics to implement the spinlock on Power architecture */
#ifndef RTE_FORCE_INTRINSICS
@@ -12,15 +12,15 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
#include <rte_config.h>
#include "generic/rte_atomic.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define rte_mb() asm volatile("fence rw, rw" : : : "memory")
#define rte_wmb() asm volatile("fence w, w" : : : "memory")
@@ -8,14 +8,14 @@
#ifndef RTE_BYTEORDER_RISCV_H
#define RTE_BYTEORDER_RISCV_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
#include "generic/rte_byteorder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_BYTE_ORDER
#define RTE_BYTE_ORDER RTE_LITTLE_ENDIAN
#endif
@@ -8,10 +8,6 @@
#ifndef RTE_CPUFLAGS_RISCV_H
#define RTE_CPUFLAGS_RISCV_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Enumeration of all CPU features supported
*/
@@ -46,8 +42,4 @@ enum rte_cpu_flag_t {
#include "generic/rte_cpuflags.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_CPUFLAGS_RISCV_H */
@@ -8,12 +8,12 @@
#ifndef RTE_CYCLES_RISCV_H
#define RTE_CYCLES_RISCV_H
+#include "generic/rte_cycles.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_cycles.h"
-
#ifndef RTE_RISCV_RDTSC_USE_HPM
#define RTE_RISCV_RDTSC_USE_HPM 0
#endif
@@ -8,14 +8,6 @@
#ifndef RTE_IO_RISCV_H
#define RTE_IO_RISCV_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_io.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_IO_RISCV_H */
@@ -12,12 +12,12 @@
#include "rte_common.h"
+#include "generic/rte_memcpy.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_memcpy.h"
-
static inline void
rte_mov16(uint8_t *dst, const uint8_t *src)
{
@@ -7,14 +7,14 @@
#ifndef RTE_PAUSE_RISCV_H
#define RTE_PAUSE_RISCV_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "rte_atomic.h"
#include "generic/rte_pause.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_pause(void)
{
/* Insert pause hint directly to be compatible with old compilers.
@@ -7,16 +7,8 @@
#ifndef RTE_POWER_INTRINSIC_RISCV_H
#define RTE_POWER_INTRINSIC_RISCV_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include "generic/rte_power_intrinsics.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_POWER_INTRINSIC_RISCV_H */
@@ -8,14 +8,14 @@
#ifndef RTE_PREFETCH_RISCV_H
#define RTE_PREFETCH_RISCV_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include "generic/rte_prefetch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_prefetch0(const volatile void *p)
{
RTE_SET_USED(p);
@@ -7,12 +7,12 @@
#ifndef RTE_RWLOCK_RISCV_H
#define RTE_RWLOCK_RISCV_H
+#include "generic/rte_rwlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_rwlock.h"
-
static inline void
rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
{
@@ -12,13 +12,13 @@
# error Platform must be built with RTE_FORCE_INTRINSICS
#endif
+#include <rte_common.h>
+#include "generic/rte_spinlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include "generic/rte_spinlock.h"
-
static inline int rte_tm_supported(void)
{
return 0;
@@ -13,13 +13,13 @@
* eal_common_thread.c and common\include\rte_per_lcore.h as Microsoft libc
* does not contain pthread.h. This may be removed in future releases.
*/
+#include <rte_common.h>
+#include <rte_windows.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include <rte_windows.h>
-
#define PTHREAD_BARRIER_SERIAL_THREAD TRUE
/* defining pthread_t type on Windows since there is no in Microsoft libc*/
@@ -10,15 +10,15 @@
* as Microsoft libc does not contain regex.h. This may be removed in
* future releases.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define REG_NOMATCH 1
#define REG_ESPACE 12
#include <rte_common.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* defining regex_t for Windows */
typedef void *regex_t;
/* defining regmatch_t for Windows */
@@ -16,10 +16,6 @@
#include <sched.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* These macros are compatible with bundled sys/queue.h. */
#define RTE_TAILQ_HEAD(name, type) \
struct name { \
@@ -59,8 +55,4 @@ struct { \
*/
typedef long long ssize_t;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_OS_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_WINDOWS_H_
#define _RTE_WINDOWS_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file Windows-specific facilities
*
@@ -51,8 +47,4 @@ extern "C" {
RTE_LOG_LINE_PREFIX(DEBUG, EAL, \
"GetLastError()=%lu: ", GetLastError(), __VA_ARGS__)
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_WINDOWS_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_ATOMIC_X86_H_
#define _RTE_ATOMIC_X86_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
#include <rte_config.h>
@@ -31,6 +27,10 @@ extern "C" {
#define rte_smp_rmb() rte_compiler_barrier()
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* From Intel Software Development Manual; Vol 3;
* 8.2.2 Memory Ordering in P6 and More Recent Processor Families:
@@ -99,10 +99,18 @@ rte_atomic_thread_fence(rte_memory_order memorder)
__rte_atomic_thread_fence(memorder);
}
+#ifdef __cplusplus
+}
+#endif
+
#ifndef RTE_TOOLCHAIN_MSVC
/*------------------------- 16 bit atomic operations -------------------------*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_FORCE_INTRINSICS
static inline int
rte_atomic16_cmpset(volatile uint16_t *dst, uint16_t exp, uint16_t src)
@@ -273,6 +281,11 @@ static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
);
return ret != 0;
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#ifdef RTE_ARCH_I686
@@ -283,8 +296,4 @@ static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_ATOMIC_X86_H_ */
@@ -5,15 +5,15 @@
#ifndef _RTE_BYTEORDER_X86_H_
#define _RTE_BYTEORDER_X86_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
#include <rte_config.h>
#include "generic/rte_byteorder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_BYTE_ORDER
#define RTE_BYTE_ORDER RTE_LITTLE_ENDIAN
#endif
@@ -48,6 +48,10 @@ static inline uint32_t rte_arch_bswap32(uint32_t _x)
return x;
}
+#ifdef __cplusplus
+}
+#endif
+
#define rte_bswap16(x) ((uint16_t)(__builtin_constant_p(x) ? \
rte_constant_bswap16(x) : \
rte_arch_bswap16(x)))
@@ -83,8 +87,4 @@ static inline uint32_t rte_arch_bswap32(uint32_t _x)
#define rte_be_to_cpu_32(x) rte_bswap32(x)
#define rte_be_to_cpu_64(x) rte_bswap64(x)
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_BYTEORDER_X86_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_CPUFLAGS_X86_64_H_
#define _RTE_CPUFLAGS_X86_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
enum rte_cpu_flag_t {
/* (EAX 01h) ECX features*/
RTE_CPUFLAG_SSE3 = 0, /**< SSE3 */
@@ -138,8 +134,4 @@ enum rte_cpu_flag_t {
#include "generic/rte_cpuflags.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_CPUFLAGS_X86_64_H_ */
@@ -12,10 +12,6 @@
#include <x86intrin.h>
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_cycles.h"
#ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
@@ -26,6 +22,10 @@ extern int rte_cycles_vmware_tsc_map;
#include <rte_common.h>
#include <rte_config.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline uint64_t
rte_rdtsc(void)
{
@@ -5,16 +5,16 @@
#ifndef _RTE_IO_X86_H_
#define _RTE_IO_X86_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include "rte_cpuflags.h"
#define RTE_NATIVE_WRITE32_WC
#include "generic/rte_io.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
* MOVDIRI wrapper.
@@ -5,13 +5,14 @@
#ifndef _RTE_PAUSE_X86_H_
#define _RTE_PAUSE_X86_H_
+#include "generic/rte_pause.h"
+
+#include <emmintrin.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_pause.h"
-
-#include <emmintrin.h>
static inline void rte_pause(void)
{
_mm_pause();
@@ -5,16 +5,8 @@
#ifndef _RTE_POWER_INTRINSIC_X86_H_
#define _RTE_POWER_INTRINSIC_X86_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include "generic/rte_power_intrinsics.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_POWER_INTRINSIC_X86_H_ */
@@ -5,10 +5,6 @@
#ifndef _RTE_PREFETCH_X86_64_H_
#define _RTE_PREFETCH_X86_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef RTE_TOOLCHAIN_MSVC
#include <emmintrin.h>
#endif
@@ -17,6 +13,10 @@ extern "C" {
#include <rte_common.h>
#include "generic/rte_prefetch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void rte_prefetch0(const volatile void *p)
{
#ifdef RTE_TOOLCHAIN_MSVC
@@ -5,13 +5,13 @@
#ifndef _RTE_RWLOCK_X86_64_H_
#define _RTE_RWLOCK_X86_64_H_
+#include "generic/rte_rwlock.h"
+#include "rte_spinlock.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "generic/rte_rwlock.h"
-#include "rte_spinlock.h"
-
static inline void
rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
__rte_no_thread_safety_analysis
@@ -5,10 +5,6 @@
#ifndef _RTE_SPINLOCK_X86_64_H_
#define _RTE_SPINLOCK_X86_64_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "generic/rte_spinlock.h"
#include "rte_rtm.h"
#include "rte_cpuflags.h"
@@ -17,6 +13,10 @@ extern "C" {
#include "rte_pause.h"
#include "rte_cycles.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_RTM_MAX_RETRIES (20)
#define RTE_XABORT_LOCK_BUSY (0xff)
@@ -182,7 +182,6 @@ rte_spinlock_recursive_trylock_tm(rte_spinlock_recursive_t *slr)
return rte_spinlock_recursive_trylock(slr);
}
-
#ifdef __cplusplus
}
#endif
@@ -5,10 +5,6 @@
#ifndef _RTE_ETHDEV_DRIVER_H_
#define _RTE_ETHDEV_DRIVER_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
*
@@ -24,6 +20,10 @@ extern "C" {
#include <rte_compat.h>
#include <rte_ethdev.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
* Structure used to hold information about the callbacks to be called for a
@@ -6,16 +6,16 @@
#ifndef _RTE_ETHDEV_PCI_H_
#define _RTE_ETHDEV_PCI_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_malloc.h>
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_config.h>
#include <ethdev_driver.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Copy pci device info to the Ethernet device data.
* Shared memory (eth_dev->data) only updated by primary process, so it is safe
@@ -11,10 +11,6 @@
* API for ethdev trace support
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <dev_driver.h>
#include <rte_trace_point.h>
@@ -22,6 +18,10 @@ extern "C" {
#include "rte_mtr.h"
#include "rte_tm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
RTE_TRACE_POINT(
rte_ethdev_trace_configure,
RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t nb_rx_q,
@@ -6,15 +6,15 @@
#ifndef _RTE_ETHDEV_VDEV_H_
#define _RTE_ETHDEV_VDEV_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_config.h>
#include <rte_malloc.h>
#include <bus_vdev_driver.h>
#include <ethdev_driver.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
* Allocates a new ethdev slot for an Ethernet device and returns the pointer
@@ -5,10 +5,6 @@
#ifndef RTE_CMAN_H
#define RTE_CMAN_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_bitops.h>
/**
@@ -48,8 +44,4 @@ struct rte_cman_red_params {
uint16_t maxp_inv;
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_CMAN_H */
@@ -5,10 +5,6 @@
#ifndef _RTE_DEV_INFO_H_
#define _RTE_DEV_INFO_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
/*
@@ -52,8 +48,4 @@ struct rte_eth_dev_module_info {
#define RTE_ETH_MODULE_SFF_8436_LEN 256
#define RTE_ETH_MODULE_SFF_8436_MAX_LEN 640
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_DEV_INFO_H_ */
@@ -19,10 +19,6 @@
* by control APIs should be defined in this file.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Define all structures for ntuple Filter type.
*/
@@ -487,8 +483,4 @@ struct rte_eth_fdir_stats {
uint32_t best_cnt; /**< Number of filters in best effort spaces. */
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_ETH_CTRL_H_ */
@@ -145,10 +145,6 @@
* a 0 value by the receive function of the driver for a given number of tries.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
/* Use this macro to check if LRO API is supported */
@@ -5966,6 +5962,10 @@ int rte_eth_cman_config_get(uint16_t port_id, struct rte_eth_cman_config *config
#include <rte_ethdev_core.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
* Helper routine for rte_eth_rx_burst().
@@ -11,12 +11,12 @@
* API for ethdev trace support
*/
+#include <rte_trace_point.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_trace_point.h>
-
RTE_TRACE_POINT_FP(
rte_ethdev_trace_rx_burst,
RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id,
@@ -16,10 +16,6 @@
* versioning.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "rte_event_timer_adapter.h"
/*
@@ -112,8 +108,4 @@ struct __rte_cache_aligned rte_event_timer_adapter_data {
/**< Flag to indicate adapter started. */
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* __EVENT_TIMER_ADAPTER_PMD_H__ */
@@ -5,10 +5,6 @@
#ifndef _RTE_EVENTDEV_PMD_H_
#define _RTE_EVENTDEV_PMD_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** @file
* RTE Event PMD APIs
*
@@ -31,6 +27,10 @@ extern "C" {
#include "event_timer_adapter_pmd.h"
#include "rte_eventdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int rte_event_logtype;
#define RTE_LOGTYPE_EVENTDEV rte_event_logtype
@@ -5,10 +5,6 @@
#ifndef _RTE_EVENTDEV_PMD_PCI_H_
#define _RTE_EVENTDEV_PMD_PCI_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** @file
* RTE Eventdev PCI PMD APIs
*
@@ -28,6 +24,10 @@ extern "C" {
#include "eventdev_pmd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef int (*eventdev_pmd_pci_callback_t)(struct rte_eventdev *dev);
/**
@@ -5,10 +5,6 @@
#ifndef _RTE_EVENTDEV_PMD_VDEV_H_
#define _RTE_EVENTDEV_PMD_VDEV_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** @file
* RTE Eventdev VDEV PMD APIs
*
@@ -27,6 +23,10 @@ extern "C" {
#include "eventdev_pmd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
* Creates a new virtual event device and returns the pointer to that device.
@@ -11,10 +11,6 @@
* API for ethdev trace support
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_trace_point.h>
#include "rte_eventdev.h"
@@ -22,6 +18,10 @@ extern "C" {
#include "rte_event_eth_rx_adapter.h"
#include "rte_event_timer_adapter.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
RTE_TRACE_POINT(
rte_eventdev_trace_configure,
RTE_TRACE_POINT_ARGS(uint8_t dev_id,
@@ -167,14 +167,14 @@
* from the start of the rte_crypto_op including initialization vector (IV).
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include "rte_eventdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Crypto event adapter mode
*/
@@ -87,10 +87,6 @@
* event based so the callback can also modify the event data if it needs to.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
@@ -98,6 +94,10 @@ extern "C" {
#include "rte_eventdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE 32
/* struct rte_event_eth_rx_adapter_queue_conf flags definitions */
@@ -76,10 +76,6 @@
* impact due to a change in how the transmit queue index is specified.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
@@ -87,6 +83,10 @@ extern "C" {
#include "rte_eventdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Adapter configuration structure
*
@@ -14,10 +14,6 @@
#ifndef _RTE_EVENT_RING_
#define _RTE_EVENT_RING_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
@@ -25,6 +21,10 @@ extern "C" {
#include <rte_ring_elem.h>
#include "rte_eventdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_TAILQ_EVENT_RING_NAME "RTE_EVENT_RING"
/**
@@ -107,14 +107,14 @@
* All these use cases require high resolution and low time drift.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "rte_eventdev.h"
#include "rte_eventdev_trace_fp.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Timer adapter clock source
*/
@@ -237,10 +237,6 @@
* \endcode
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include <rte_errno.h>
@@ -2469,6 +2465,10 @@ rte_event_vector_pool_create(const char *name, unsigned int n,
#include <rte_eventdev_core.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static __rte_always_inline uint16_t
__rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
const struct rte_event ev[], uint16_t nb_events,
@@ -11,12 +11,12 @@
* API for ethdev trace support
*/
+#include <rte_trace_point.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_trace_point.h>
-
RTE_TRACE_POINT_FP(
rte_eventdev_trace_deq_burst,
RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table,
@@ -12,10 +12,6 @@
* dispatch model.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_errno.h>
#include <rte_mempool.h>
#include <rte_memzone.h>
@@ -23,6 +19,10 @@ extern "C" {
#include "rte_graph_worker_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_GRAPH_SCHED_WQ_SIZE_MULTIPLIER 8
#define RTE_GRAPH_SCHED_WQ_SIZE(nb_nodes) \
((typeof(nb_nodes))((nb_nodes) * RTE_GRAPH_SCHED_WQ_SIZE_MULTIPLIER))
@@ -6,13 +6,13 @@
#ifndef _RTE_GRAPH_WORKER_H_
#define _RTE_GRAPH_WORKER_H_
+#include "rte_graph_model_rtc.h"
+#include "rte_graph_model_mcore_dispatch.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "rte_graph_model_rtc.h"
-#include "rte_graph_model_mcore_dispatch.h"
-
/**
* Perform graph walk on the circular buffer and invoke the process function
* of the nodes and collect the stats.
@@ -10,13 +10,13 @@
* Interface to GSO library
*/
+#include <stdint.h>
+#include <rte_mbuf.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-#include <rte_mbuf.h>
-
/* Minimum GSO segment size for TCP based packets. */
#define RTE_GSO_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_tcp_hdr) + 1)
@@ -18,15 +18,15 @@
#include <stdint.h>
#include <errno.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <string.h>
#include <rte_hash_crc.h>
#include <rte_jhash.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_FBK_HASH_INIT_VAL_DEFAULT
/** Initialising value used when calculating hash. */
#define RTE_FBK_HASH_INIT_VAL_DEFAULT 0xFFFFFFFF
@@ -11,10 +11,6 @@
* RTE CRC Hash
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_branch_prediction.h>
@@ -39,6 +35,10 @@ extern uint8_t rte_hash_crc32_alg;
#include "rte_crc_generic.h"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash
* calculation.
@@ -11,10 +11,6 @@
* jhash functions.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <string.h>
#include <limits.h>
@@ -23,6 +19,10 @@ extern "C" {
#include <rte_log.h>
#include <rte_byteorder.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* jhash.h: Jenkins hash support.
*
* Copyright (C) 2006 Bob Jenkins (bob_jenkins@burtleburtle.net)
@@ -15,10 +15,6 @@
* after GRE header decapsulating)
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_byteorder.h>
@@ -30,6 +26,10 @@ extern "C" {
#include <rte_vect.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef RTE_ARCH_X86
/* Byte swap mask used for converting IPv6 address
* 4-byte chunks to CPU byte order
@@ -5,10 +5,6 @@
#ifndef _RTE_THASH_GFNI_H_
#define _RTE_THASH_GFNI_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_log.h>
@@ -18,6 +14,10 @@ extern "C" {
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
* Stubs only used when GFNI is not available.
@@ -12,10 +12,6 @@
* Implementation of IP packet fragmentation and reassembly.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdio.h>
@@ -25,6 +21,10 @@ extern "C" {
#include <rte_ip.h>
#include <rte_byteorder.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_mbuf;
/** death row size (in packets) */
@@ -17,10 +17,6 @@
#include <rte_ipsec_sa.h>
#include <rte_mbuf.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
struct rte_ipsec_session;
/**
@@ -181,6 +177,10 @@ rte_ipsec_telemetry_sa_del(const struct rte_ipsec_sa *sa);
#include <rte_ipsec_group.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __cplusplus
}
#endif
@@ -13,10 +13,6 @@
* This file provides a log API to RTE applications.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
@@ -26,6 +22,10 @@ extern "C" {
#include <rte_common.h>
#include <rte_config.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* SDK log type */
#define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */
/* was RTE_LOGTYPE_MALLOC */
@@ -391,6 +391,10 @@ static inline void
rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],
uint32_t defv);
+#ifdef __cplusplus
+}
+#endif
+
#if defined(RTE_ARCH_ARM)
#ifdef RTE_HAS_SVE_ACLE
#include "rte_lpm_sve.h"
@@ -407,8 +411,4 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],
#include "rte_lpm_scalar.h"
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_LPM_H_ */
@@ -54,10 +54,6 @@
#ifndef _RTE_MEMBER_H_
#define _RTE_MEMBER_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdbool.h>
#include <inttypes.h>
@@ -100,6 +96,10 @@ typedef uint16_t member_set_t;
#define MEMBER_HASH_FUNC rte_jhash
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** @internal setsummary structure. */
struct rte_member_setsum;
@@ -5,13 +5,13 @@
#ifndef RTE_MEMBER_SKETCH_H
#define RTE_MEMBER_SKETCH_H
+#include <rte_vect.h>
+#include <rte_ring_elem.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_vect.h>
-#include <rte_ring_elem.h>
-
#define NUM_ROW_SCALAR 5
#define INTERVAL (1 << 15)
@@ -5,14 +5,14 @@
#ifndef RTE_MEMBER_SKETCH_AVX512_H
#define RTE_MEMBER_SKETCH_AVX512_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_vect.h>
#include "rte_member.h"
#include "rte_member_sketch.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define NUM_ROW_VEC 8
void
@@ -5,12 +5,12 @@
#ifndef _RTE_MEMBER_X86_H_
#define _RTE_MEMBER_X86_H_
+#include <x86intrin.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <x86intrin.h>
-
#if defined(__AVX2__)
static inline int
@@ -5,13 +5,13 @@
#ifndef RTE_XXH64_AVX512_H
#define RTE_XXH64_AVX512_H
+#include <rte_common.h>
+#include <immintrin.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include <immintrin.h>
-
/* 0b1001111000110111011110011011000110000101111010111100101010000111 */
static const uint64_t PRIME64_1 = 0x9E3779B185EBCA87ULL;
/* 0b1100001010110010101011100011110100100111110101001110101101001111 */
@@ -11,15 +11,15 @@
* APIs for mempool trace support
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include "rte_mempool.h"
#include <rte_memzone.h>
#include <rte_trace_point.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
RTE_TRACE_POINT(
rte_mempool_trace_create,
RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
@@ -11,12 +11,12 @@
* Mempool fast path API for trace support
*/
+#include <rte_trace_point.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_trace_point.h>
-
RTE_TRACE_POINT_FP(
rte_mempool_trace_ops_dequeue_bulk,
RTE_TRACE_POINT_ARGS(void *mempool, void **obj_table,
@@ -6,10 +6,6 @@
#ifndef __INCLUDE_RTE_METER_H__
#define __INCLUDE_RTE_METER_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Traffic Metering
@@ -22,6 +18,10 @@ extern "C" {
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Application Programmer's Interface (API)
*/
@@ -5,10 +5,6 @@
#ifndef RTE_MLDEV_UTILS_H
#define RTE_MLDEV_UTILS_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
*
@@ -20,6 +16,10 @@ extern "C" {
#include <rte_compat.h>
#include <rte_mldev.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
*
@@ -16,10 +16,6 @@
* These APIs are for MLDEV PMDs and library only.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <dev_driver.h>
@@ -668,8 +664,4 @@ struct rte_ml_dev_global {
uint8_t max_devs;
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_MLDEV_INTERNAL_H */
@@ -14,10 +14,6 @@
* These APIs are for MLDEV PMDs only and user applications should not call them directly.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_common.h>
@@ -25,6 +21,10 @@ extern "C" {
#include <rte_mldev.h>
#include <rte_mldev_core.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @internal
*
@@ -13,10 +13,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define RTE_DTLS_TYPE_INVALID 0 /**< Invalid DTLS message type. */
#define RTE_DTLS_TYPE_CHANGE_CIPHER_SPEC 20 /**< Change cipher spec message. */
#define RTE_DTLS_TYPE_ALERT 21 /**< Alert message. */
@@ -54,8 +50,4 @@ struct rte_dtls_hdr {
rte_be16_t length;
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_DTLS_H */
@@ -17,10 +17,6 @@
#include <stdint.h>
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*
* eCPRI Protocol Revision 1.0, 1.1, 1.2, 2.0: 0001b
* Other values are reserved for future
@@ -182,8 +178,4 @@ struct rte_ecpri_combined_msg_hdr {
};
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_ECPRI_H_ */
@@ -13,10 +13,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* ESP Header
*/
@@ -33,8 +29,4 @@ struct rte_esp_tail {
uint8_t next_proto; /**< IPv4 or IPv6 or next layer header */
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_ESP_H_ */
@@ -11,10 +11,6 @@
* Ethernet Helpers in RTE
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdio.h>
@@ -22,6 +18,10 @@ extern "C" {
#include <rte_mbuf.h>
#include <rte_byteorder.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_ETHER_ADDR_LEN 6 /**< Length of Ethernet address. */
#define RTE_ETHER_TYPE_LEN 2 /**< Length of Ethernet type field. */
#define RTE_ETHER_CRC_LEN 4 /**< Length of Ethernet CRC. */
@@ -14,10 +14,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** GENEVE default port. */
#define RTE_GENEVE_DEFAULT_PORT 6081
@@ -61,8 +57,4 @@ struct rte_geneve_hdr {
/* GENEVE ETH next protocol types */
#define RTE_GENEVE_TYPE_ETH 0x6558 /**< Ethernet Protocol. */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_GENEVE_H_ */
@@ -19,10 +19,6 @@
* over an Internet Protocol network.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* GRE Header
*/
@@ -70,8 +66,4 @@ struct rte_gre_hdr_opt_sequence {
rte_be32_t sequence;
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_GRE_H_ */
@@ -17,10 +17,6 @@
#include <stdint.h>
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Simplified GTP protocol header.
* Contains 8-bit header info, 8-bit message type,
@@ -150,8 +146,4 @@ struct rte_gtp_psc_type1_hdr {
#define RTE_GTPC_UDP_PORT 2123 /**< GTP-C UDP destination port */
#define RTE_GTPU_UDP_PORT 2152 /**< GTP-U UDP destination port */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_GTP_H_ */
@@ -16,10 +16,6 @@
#include <stdint.h>
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
*
* higig2 frc header.
@@ -144,8 +140,4 @@ struct rte_higig2_hdr {
};
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_HIGIG_H_ */
@@ -17,10 +17,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* InfiniBand Base Transport Header according to
* IB Specification Vol 1-Release-1.4.
@@ -63,8 +59,4 @@ struct rte_ib_bth {
/** RoCEv2 default port. */
#define RTE_ROCEV2_DEFAULT_PORT 4791
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_IB_H */
@@ -18,10 +18,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* ICMP base header
*/
@@ -59,8 +55,4 @@ struct rte_icmp_hdr {
#define RTE_ICMP6_ECHO_REQUEST 128
#define RTE_ICMP6_ECHO_REPLY 129
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_ICMP_H_ */
@@ -74,10 +74,6 @@
#include <stdint.h>
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*
* L2TPv2 Message Type
*/
@@ -239,8 +235,4 @@ struct rte_l2tpv2_combined_msg_hdr {
};
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_L2TPV2_H_ */
@@ -13,10 +13,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define RTE_MACSEC_TCI_VER_MASK 0x80 /**< Version mask for MACsec. Should be 0. */
#define RTE_MACSEC_TCI_ES 0x40 /**< Mask for End station (ES) bit - SCI is not valid. */
#define RTE_MACSEC_TCI_SC 0x20 /**< Mask for SCI present bit. */
@@ -56,8 +52,4 @@ struct rte_macsec_sci_hdr {
uint8_t sci[RTE_MACSEC_SCI_LEN]; /**< Optional secure channel ID. */
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_MACSEC_H */
@@ -14,10 +14,6 @@
#include <stdint.h>
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* MPLS header.
*/
@@ -36,8 +32,4 @@ struct rte_mpls_hdr {
uint8_t ttl; /**< Time to live. */
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_MPLS_H_ */
@@ -5,14 +5,14 @@
#ifndef _RTE_NET_PTYPE_H_
#define _RTE_NET_PTYPE_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_ip.h>
#include <rte_udp.h>
#include <rte_tcp.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Structure containing header lengths associated to a packet, filled
* by rte_net_get_ptype().
@@ -16,10 +16,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* 4.3.1
*
@@ -140,8 +136,4 @@ struct rte_pdcp_up_ctrl_pdu_hdr {
uint8_t bitmap[];
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_PDCP_HDR_H */
@@ -14,10 +14,6 @@
#include <stdint.h>
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* PPP Header
*/
@@ -27,8 +23,4 @@ struct rte_ppp_hdr {
rte_be16_t proto_id; /**< PPP protocol identifier(16) */
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_PPP_H_ */
@@ -14,10 +14,6 @@
#ifndef _RTE_SCTP_H_
#define _RTE_SCTP_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_byteorder.h>
@@ -32,8 +28,4 @@ struct rte_sctp_hdr {
rte_be32_t cksum; /**< Checksum. */
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_SCTP_H_ */
@@ -18,10 +18,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* TCP Header
*/
@@ -49,8 +45,4 @@ struct rte_tcp_hdr {
#define RTE_TCP_SYN_FLAG 0x02 /**< Synchronize sequence numbers */
#define RTE_TCP_FIN_FLAG 0x01 /**< No more data from sender */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_TCP_H_ */
@@ -13,10 +13,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define RTE_TLS_TYPE_INVALID 0 /**< Invalid TLS message type. */
#define RTE_TLS_TYPE_CHANGE_CIPHER_SPEC 20 /**< Change cipher spec message. */
#define RTE_TLS_TYPE_ALERT 21 /**< Alert message. */
@@ -41,8 +37,4 @@ struct rte_tls_hdr {
rte_be16_t length;
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_TLS_H */
@@ -18,10 +18,6 @@
#include <rte_byteorder.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* UDP Header
*/
@@ -32,8 +28,4 @@ struct rte_udp_hdr {
rte_be16_t dgram_cksum; /**< UDP datagram checksum */
} __rte_packed;
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_UDP_H_ */
@@ -16,11 +16,6 @@
#include <rte_byteorder.h>
#include <rte_udp.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** VXLAN default port. */
#define RTE_VXLAN_DEFAULT_PORT 4789
/** VXLAN GPE port. */
@@ -152,9 +147,4 @@ struct rte_vxlan_gpe_hdr {
#define RTE_VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
#define RTE_VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
-
-#ifdef __cplusplus
-}
-#endif
-
#endif /* RTE_VXLAN_H_ */
@@ -16,15 +16,15 @@
* and its queue associations.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include <rte_graph.h>
#include <rte_mempool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Port config for ethdev_rx and ethdev_tx node.
*/
@@ -15,15 +15,15 @@
* This API allows to do control path functions of ip4_* nodes
* like ip4_lookup, ip4_rewrite.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_graph.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* IP4 lookup next nodes.
*/
@@ -15,13 +15,13 @@
* This API allows to do control path functions of ip6_* nodes
* like ip6_lookup, ip6_rewrite.
*/
+#include <rte_common.h>
+#include <rte_compat.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include <rte_compat.h>
-
/**
* IP6 lookup next nodes.
*/
@@ -16,14 +16,14 @@
* like udp4_input.
*
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_common.h>
#include <rte_compat.h>
#include "rte_graph.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* UDP4 lookup next nodes.
*/
@@ -12,14 +12,14 @@
* RTE PCI Library
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h>
#include <inttypes.h>
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
* configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of
@@ -19,10 +19,6 @@
#include <rte_pdcp_hdr.h>
#include <rte_security.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* Forward declarations. */
struct rte_pdcp_entity;
@@ -373,6 +369,10 @@ rte_pdcp_t_reordering_expiry_handle(const struct rte_pdcp_entity *entity,
*/
#include <rte_pdcp_group.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __cplusplus
}
#endif
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PIPELINE_H__
#define __INCLUDE_RTE_PIPELINE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Pipeline
@@ -59,6 +55,10 @@ extern "C" {
#include <rte_table.h>
#include <rte_common.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_mbuf;
/*
@@ -46,10 +46,6 @@
* @b EXPERIMENTAL: this API may change without prior notice
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
@@ -57,6 +53,10 @@ extern "C" {
#include "rte_pipeline.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Input port actions. */
enum rte_port_in_action_type {
/** Filter selected input packets. */
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_CTL_H__
#define __INCLUDE_RTE_SWX_CTL_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Pipeline Control
@@ -22,6 +18,10 @@ extern "C" {
#include "rte_swx_port.h"
#include "rte_swx_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rte_swx_pipeline;
/** Name size. */
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_EXTERN_H__
#define __INCLUDE_RTE_SWX_EXTERN_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Extern objects and functions
@@ -91,8 +87,4 @@ typedef int
typedef int
(*rte_swx_extern_func_t)(void *mailbox);
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_IPSEC_H__
#define __INCLUDE_RTE_SWX_IPSEC_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Internet Protocol Security (IPsec)
@@ -53,6 +49,10 @@ extern "C" {
#include <rte_compat.h>
#include <rte_crypto_sym.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* IPsec Setup API
*/
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_PIPELINE_H__
#define __INCLUDE_RTE_SWX_PIPELINE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Pipeline
@@ -22,6 +18,10 @@ extern "C" {
#include "rte_swx_table.h"
#include "rte_swx_extern.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Name size. */
#ifndef RTE_SWX_NAME_SIZE
#define RTE_SWX_NAME_SIZE 64
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_PIPELINE_SPEC_H__
#define __INCLUDE_RTE_SWX_PIPELINE_SPEC_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <stdio.h>
@@ -15,6 +11,10 @@ extern "C" {
#include <rte_swx_pipeline.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* extobj.
*
@@ -52,10 +52,6 @@
* @b EXPERIMENTAL: this API may change without prior notice
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
@@ -65,6 +61,10 @@ extern "C" {
#include "rte_pipeline.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Table actions. */
enum rte_table_action_type {
/** Forward to next pipeline table, output port or drop. */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_H__
#define __INCLUDE_RTE_PORT_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port
@@ -224,8 +220,4 @@ struct rte_port_out_ops {
rte_port_out_op_stats_read f_stats; /**< Stats */
};
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_ETHDEV_H__
#define __INCLUDE_RTE_PORT_ETHDEV_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port Ethernet Device
@@ -21,6 +17,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** ethdev_reader port parameters */
struct rte_port_ethdev_reader_params {
/** NIC RX port ID */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_EVENTDEV_H__
#define __INCLUDE_RTE_PORT_EVENTDEV_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port Eventdev Interface
@@ -24,6 +20,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Eventdev_reader port parameters */
struct rte_port_eventdev_reader_params {
/** Eventdev Device ID */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_FD_H__
#define __INCLUDE_RTE_PORT_FD_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port FD Device
@@ -21,6 +17,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** fd_reader port parameters */
struct rte_port_fd_reader_params {
/** File descriptor */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_IP_FRAG_H__
#define __INCLUDE_RTE_PORT_IP_FRAG_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port for IPv4 Fragmentation
@@ -31,6 +27,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** ring_reader_ipv4_frag port parameters */
struct rte_port_ring_reader_frag_params {
/** Underlying single consumer ring that has to be pre-initialized. */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_RAS_H__
#define __INCLUDE_RTE_PORT_RAS_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port for IPv4 Reassembly
@@ -31,6 +27,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** ring_writer_ipv4_ras port parameters */
struct rte_port_ring_writer_ras_params {
/** Underlying single consumer ring that has to be pre-initialized. */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_RING_H__
#define __INCLUDE_RTE_PORT_RING_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port Ring
@@ -27,6 +23,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** ring_reader port parameters */
struct rte_port_ring_reader_params {
/** Underlying consumer ring that has to be pre-initialized */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_SCHED_H__
#define __INCLUDE_RTE_PORT_SCHED_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port Hierarchical Scheduler
@@ -23,6 +19,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** sched_reader port parameters */
struct rte_port_sched_reader_params {
/** Underlying pre-initialized rte_sched_port */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_SOURCE_SINK_H__
#define __INCLUDE_RTE_PORT_SOURCE_SINK_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port Source/Sink
@@ -19,6 +15,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** source port parameters */
struct rte_port_source_params {
/** Pre-initialized buffer pool */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_PORT_SYM_CRYPTO_H__
#define __INCLUDE_RTE_PORT_SYM_CRYPTO_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Port sym crypto Interface
@@ -23,6 +19,10 @@ extern "C" {
#include "rte_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Function prototype for reader post action. */
typedef void (*rte_port_sym_crypto_reader_callback_fn)(struct rte_mbuf **pkts,
uint16_t n_pkts, void *arg);
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_PORT_H__
#define __INCLUDE_RTE_SWX_PORT_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Port
@@ -240,8 +236,4 @@ struct rte_swx_port_out_ops {
rte_swx_port_out_stats_read_t stats_read;
};
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_PORT_ETHDEV_H__
#define __INCLUDE_RTE_SWX_PORT_ETHDEV_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Ethernet Device Input and Output Ports
@@ -17,6 +13,10 @@ extern "C" {
#include "rte_swx_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Ethernet device input port (reader) creation parameters. */
struct rte_swx_port_ethdev_reader_params {
/** Name of a valid and fully configured Ethernet device. */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_SWX_PORT_FD_H__
#define __INCLUDE_RTE_SWX_PORT_FD_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX FD Input and Output Ports
@@ -18,6 +14,10 @@ extern "C" {
#include "rte_swx_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** fd_reader port parameters */
struct rte_swx_port_fd_reader_params {
/** File descriptor. Must be valid and opened in non-blocking mode. */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_SWX_PORT_RING_H__
#define __INCLUDE_RTE_SWX_PORT_RING_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Ring Input and Output Ports
@@ -18,6 +14,10 @@ extern "C" {
#include "rte_swx_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Ring input port (reader) creation parameters. */
struct rte_swx_port_ring_reader_params {
/** Name of valid RTE ring. */
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_PORT_SOURCE_SINK_H__
#define __INCLUDE_RTE_SWX_PORT_SOURCE_SINK_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Source and Sink Ports
@@ -15,6 +11,10 @@ extern "C" {
#include "rte_swx_port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Maximum number of packets to read from the PCAP file. */
#ifndef RTE_SWX_PORT_SOURCE_PKTS_MAX
#define RTE_SWX_PORT_SOURCE_PKTS_MAX 1024
@@ -14,13 +14,13 @@
* no specific type already available in DPDK.
*/
+#include <rte_common.h>
+#include <rte_memory.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_common.h>
-#include <rte_memory.h>
-
/* Rawdevice object - essentially a void to be typecast by implementation */
typedef void *rte_rawdev_obj_t;
@@ -13,10 +13,6 @@
* any application.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <string.h>
#include <dev_driver.h>
@@ -26,6 +22,10 @@ extern "C" {
#include "rte_rawdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int librawdev_logtype;
#define RTE_LOGTYPE_RAWDEV librawdev_logtype
@@ -21,10 +21,6 @@
* entered quiescent state.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <inttypes.h>
#include <stdalign.h>
#include <stdbool.h>
@@ -36,6 +32,10 @@ extern "C" {
#include <rte_atomic.h>
#include <rte_ring.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int rte_rcu_log_type;
#define RTE_LOGTYPE_RCU rte_rcu_log_type
@@ -194,10 +194,6 @@
* - rte_regexdev_dequeue_burst()
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_compat.h>
#include <rte_common.h>
#include <rte_dev.h>
@@ -1428,6 +1424,10 @@ struct rte_regex_ops {
#include "rte_regexdev_core.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
@@ -34,13 +34,13 @@
* for more information.
*/
+#include <rte_ring_core.h>
+#include <rte_ring_elem.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ring_core.h>
-#include <rte_ring_elem.h>
-
/**
* Calculate the memory size needed for a ring
*
@@ -19,10 +19,6 @@
* instead.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdalign.h>
#include <stdio.h>
#include <stdint.h>
@@ -167,8 +163,4 @@ struct rte_ring {
#define RING_F_MP_HTS_ENQ 0x0020 /**< The default enqueue is "MP HTS". */
#define RING_F_MC_HTS_DEQ 0x0040 /**< The default dequeue is "MC HTS". */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _RTE_RING_CORE_H_ */
@@ -16,10 +16,6 @@
* RTE Ring with user defined element size
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_ring_core.h>
#include <rte_ring_elem_pvt.h>
@@ -699,6 +695,10 @@ rte_ring_dequeue_burst_elem(struct rte_ring *r, void *obj_table,
#include <rte_ring.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __cplusplus
}
#endif
@@ -24,12 +24,12 @@
* To achieve that 64-bit CAS is used by head update routine.
*/
+#include <rte_ring_hts_elem_pvt.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ring_hts_elem_pvt.h>
-
/**
* Enqueue several objects on the HTS ring (multi-producers safe).
*
@@ -43,12 +43,12 @@
* with enqueue(/dequeue) operation till _finish_ completes.
*/
+#include <rte_ring_peek_elem_pvt.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ring_peek_elem_pvt.h>
-
/**
* Start to enqueue several objects on the ring.
* Note that no actual objects are put in the queue by this function,
@@ -67,12 +67,12 @@
* with enqueue/dequeue operation till _finish_ completes.
*/
+#include <rte_ring_peek_elem_pvt.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ring_peek_elem_pvt.h>
-
/**
* Ring zero-copy information structure.
*
@@ -51,12 +51,12 @@
* By default HTD_MAX == ring.capacity / 8.
*/
+#include <rte_ring_rts_elem_pvt.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_ring_rts_elem_pvt.h>
-
/**
* Enqueue several objects on the RTS ring (multi-producers safe).
*
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_APPROX_H__
#define __INCLUDE_RTE_APPROX_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Rational Approximation
@@ -20,6 +16,10 @@ extern "C" {
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Find best rational approximation
*
@@ -5,10 +5,6 @@
#ifndef __RTE_PIE_H_INCLUDED__
#define __RTE_PIE_H_INCLUDED__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* Proportional Integral controller Enhanced (PIE)
@@ -20,6 +16,10 @@ extern "C" {
#include <rte_debug.h>
#include <rte_cycles.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_DQ_THRESHOLD 16384 /**< Queue length threshold (2^14)
* to start measurement cycle (bytes)
*/
@@ -5,10 +5,6 @@
#ifndef __RTE_RED_H_INCLUDED__
#define __RTE_RED_H_INCLUDED__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Random Early Detection (RED)
@@ -20,6 +16,10 @@ extern "C" {
#include <rte_cycles.h>
#include <rte_branch_prediction.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_RED_SCALING 10 /**< Fraction size for fixed-point */
#define RTE_RED_S (1 << 22) /**< Packet size multiplied by number of leaf queues */
#define RTE_RED_MAX_TH_MAX 1023 /**< Max threshold limit in fixed point format */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_SCHED_H__
#define __INCLUDE_RTE_SCHED_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Hierarchical Scheduler
@@ -62,6 +58,10 @@ extern "C" {
#include "rte_red.h"
#include "rte_pie.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Maximum number of queues per pipe.
* Note that the multiple queues (power of 2) can only be assigned to
* lowest priority (best-effort) traffic class. Other higher priority traffic
@@ -5,13 +5,13 @@
#ifndef __INCLUDE_RTE_SCHED_COMMON_H__
#define __INCLUDE_RTE_SCHED_COMMON_H__
+#include <stdint.h>
+#include <sys/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-#include <sys/types.h>
-
#if 0
static inline uint32_t
rte_min_pos_4_u16(uint16_t *x)
@@ -12,10 +12,6 @@
* RTE Security Common Definitions
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <sys/types.h>
#include <rte_compat.h>
@@ -24,6 +20,10 @@ extern "C" {
#include <rte_ip.h>
#include <rte_mbuf_dyn.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** IPSec protocol mode */
enum rte_security_ipsec_sa_mode {
RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT = 1,
@@ -12,13 +12,13 @@
* RTE Security Common Definitions
*/
+#include <rte_compat.h>
+#include "rte_security.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rte_compat.h>
-#include "rte_security.h"
-
/**
* @internal
* Security session to be used by library for internal usage
@@ -15,10 +15,6 @@
#ifndef _RTE_STACK_H_
#define _RTE_STACK_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdalign.h>
#include <rte_debug.h>
@@ -95,6 +91,10 @@ struct __rte_cache_aligned rte_stack {
#include "rte_stack_std.h"
#include "rte_stack_lf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Push several objects on the stack (MT-safe).
*
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_LRU_H__
#define __INCLUDE_RTE_LRU_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rte_config.h>
#ifdef RTE_ARCH_X86_64
#include "rte_lru_x86.h"
@@ -86,8 +82,4 @@ do { \
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -5,14 +5,14 @@
#ifndef __RTE_LRU_ARM64_H__
#define __RTE_LRU_ARM64_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_vect.h>
#include <rte_bitops.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef RTE_TABLE_HASH_LRU_STRATEGY
#ifdef __ARM_NEON
#define RTE_TABLE_HASH_LRU_STRATEGY 3
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_LRU_X86_H__
#define __INCLUDE_RTE_LRU_X86_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_config.h>
@@ -97,8 +93,4 @@ do { \
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_HASH_FUNC_H__
#define __INCLUDE_RTE_SWX_HASH_FUNC_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Hash Function
@@ -32,8 +28,4 @@ typedef uint32_t
uint32_t length,
uint32_t seed);
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_KEYCMP_H__
#define __INCLUDE_RTE_SWX_KEYCMP_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Key Comparison Functions
@@ -16,6 +12,10 @@ extern "C" {
#include <stdint.h>
#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Key comparison function prototype
*
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_TABLE_H__
#define __INCLUDE_RTE_SWX_TABLE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Table
@@ -314,8 +310,4 @@ struct rte_swx_table_ops {
rte_swx_table_free_t free;
};
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_TABLE_EM_H__
#define __INCLUDE_RTE_SWX_TABLE_EM_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Exact Match Table
@@ -16,6 +12,10 @@ extern "C" {
#include <rte_swx_table.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Exact match table operations - unoptimized. */
extern struct rte_swx_table_ops rte_swx_table_exact_match_unoptimized_ops;
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_TABLE_LEARNER_H__
#define __INCLUDE_RTE_SWX_TABLE_LEARNER_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Learner Table
@@ -53,6 +49,10 @@ extern "C" {
#include "rte_swx_hash_func.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Maximum number of key timeout values per learner table. */
#ifndef RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX
#define RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX 16
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_TABLE_SELECTOR_H__
#define __INCLUDE_RTE_SWX_TABLE_SELECTOR_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Selector Table
@@ -21,6 +17,10 @@ extern "C" {
#include "rte_swx_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Selector table creation parameters. */
struct rte_swx_table_selector_params {
/** Group ID offset. */
@@ -4,10 +4,6 @@
#ifndef __INCLUDE_RTE_SWX_TABLE_WM_H__
#define __INCLUDE_RTE_SWX_TABLE_WM_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE SWX Wildcard Match Table
@@ -16,6 +12,10 @@ extern "C" {
#include <rte_swx_table.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Wildcard match table operations. */
extern struct rte_swx_table_ops rte_swx_table_wildcard_match_ops;
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_H__
#define __INCLUDE_RTE_TABLE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table
@@ -264,8 +260,4 @@ struct rte_table_ops {
rte_table_op_stats_read f_stats; /**< Stats */
};
-#ifdef __cplusplus
-}
-#endif
-
#endif
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_ACL_H__
#define __INCLUDE_RTE_TABLE_ACL_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table ACL
@@ -25,6 +21,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** ACL table parameters */
struct rte_table_acl_params {
/** Name */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_ARRAY_H__
#define __INCLUDE_RTE_TABLE_ARRAY_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table Array
@@ -20,6 +16,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Array table parameters */
struct rte_table_array_params {
/** Number of array entries. Has to be a power of two. */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_HASH_H__
#define __INCLUDE_RTE_TABLE_HASH_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table Hash
@@ -52,6 +48,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Hash function */
typedef uint64_t (*rte_table_hash_op_hash)(
void *key,
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_HASH_CUCKOO_H__
#define __INCLUDE_RTE_TABLE_HASH_CUCKOO_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table Hash Cuckoo
@@ -20,6 +16,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Hash table parameters */
struct rte_table_hash_cuckoo_params {
/** Name */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_HASH_FUNC_H__
#define __INCLUDE_RTE_TABLE_HASH_FUNC_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
@@ -18,16 +14,28 @@ extern "C" {
#include <x86intrin.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline uint64_t
rte_crc32_u64(uint64_t crc, uint64_t v)
{
return _mm_crc32_u64(crc, v);
}
+#ifdef __cplusplus
+}
+#endif
+
#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32)
#include "rte_table_hash_func_arm64.h"
#else
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline uint64_t
rte_crc32_u64(uint64_t crc, uint64_t v)
{
@@ -44,6 +52,14 @@ rte_crc32_u64(uint64_t crc, uint64_t v)
return crc;
}
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
#endif
__rte_experimental
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_LPM_H__
#define __INCLUDE_RTE_TABLE_LPM_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table LPM for IPv4
@@ -45,6 +41,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** LPM table parameters */
struct rte_table_lpm_params {
/** Table name */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_LPM_IPV6_H__
#define __INCLUDE_RTE_TABLE_LPM_IPV6_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table LPM for IPv6
@@ -45,6 +41,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_LPM_IPV6_ADDR_SIZE 16
/** LPM table parameters */
@@ -5,10 +5,6 @@
#ifndef __INCLUDE_RTE_TABLE_STUB_H__
#define __INCLUDE_RTE_TABLE_STUB_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
* RTE Table Stub
@@ -18,6 +14,10 @@ extern "C" {
#include "rte_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Stub table parameters: NONE */
/** Stub table operations */
@@ -5,14 +5,14 @@
#ifndef _RTE_TELEMETRY_H_
#define _RTE_TELEMETRY_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
#include <rte_common.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Maximum length for string used in object. */
#define RTE_TEL_MAX_STRING_LEN 128
/** Maximum length of string. */
@@ -5,10 +5,6 @@
#ifndef _RTE_VDPA_H_
#define _RTE_VDPA_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @file
*
@@ -17,6 +13,10 @@ extern "C" {
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Maximum name length for statistics counters */
#define RTE_VDPA_STATS_NAME_SIZE 64
@@ -18,10 +18,6 @@
#include <rte_memory.h>
#include <rte_mempool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef __cplusplus
/* These are not C++-aware. */
#include <linux/vhost.h>
@@ -29,6 +25,10 @@ extern "C" {
#include <linux/virtio_net.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_VHOST_USER_CLIENT (1ULL << 0)
#define RTE_VHOST_USER_NO_RECONNECT (1ULL << 1)
#define RTE_VHOST_USER_RESERVED_1 (1ULL << 2)
@@ -5,15 +5,15 @@
#ifndef _RTE_VHOST_ASYNC_H_
#define _RTE_VHOST_ASYNC_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdint.h>
#include <rte_compat.h>
#include <rte_mbuf.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Register an async channel for a vhost queue
*
@@ -5,12 +5,12 @@
#ifndef _VHOST_CRYPTO_H_
#define _VHOST_CRYPTO_H_
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdint.h>
-
/* pre-declare structs to avoid including full headers */
struct rte_mempool;
struct rte_crypto_op;
@@ -5,10 +5,6 @@
#ifndef _VDPA_DRIVER_H_
#define _VDPA_DRIVER_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <rte_compat.h>
@@ -16,6 +12,10 @@ extern "C" {
#include "rte_vhost.h"
#include "rte_vdpa.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RTE_VHOST_QUEUE_ALL UINT16_MAX
/**