---
name: "RTE_DEFINE_PER_LCORE"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_per_lcore.h"
---

# RTE\_DEFINE\_PER\_LCORE(3)

Part of [rte\_per\_lcore.h(3)](/rte_per_lcore.h/3.md).

## NAME

rte\_per\_lcore.h

## SYNOPSIS

### Macros

\#define **RTE\_DEFINE\_PER\_LCORE**(type,  name)   	\_\_thread type per\_lcore\_##name\
 \#define **RTE\_DECLARE\_PER\_LCORE**(type,  name)   	extern \_\_thread type per\_lcore\_##name\
 \#define **RTE\_PER\_LCORE**(name)   (per\_lcore\_##name)\

## Detailed Description

Per-lcore variables in RTE

This file defines an API for instantiating per-lcore 'global variables' that are environment-specific. Note that in all environments, a 'shared variable' is the default when you use a global variable.

Parts of this are execution environment specific.

Definition in file **rte\_per\_lcore.h**.

## Macro Definition Documentation

### #define RTE\_DEFINE\_PER\_LCORE(type, name) \_\_thread type per\_lcore\_##name

Macro to define a per lcore variable 'var' of type 'type', don't use keywords like 'static' or 'volatile' in type, just prefix the whole macro.

Definition at line **33** of file **rte\_per\_lcore.h**.

### #define RTE\_DECLARE\_PER\_LCORE(type, name) extern \_\_thread type per\_lcore\_##name

Macro to declare an extern per lcore variable 'var' of type 'type'

Definition at line **39** of file **rte\_per\_lcore.h**.

### #define RTE\_PER\_LCORE(name) (per\_lcore\_##name)

Read/write the per-lcore variable value

Definition at line **46** of file **rte\_per\_lcore.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
