@@ -47,7 +47,7 @@ struct aead_test_data {
} key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned len;
} iv;
@@ -79,7 +79,7 @@ struct gmac_test_data {
} key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned len;
} iv;
@@ -2025,7 +2025,7 @@ struct cryptodev_perf_test_data {
} key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned len;
} iv;
@@ -72,7 +72,7 @@ struct blockcipher_test_data {
} cipher_key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned int len;
} iv;
@@ -12,7 +12,7 @@ struct kasumi_test_data {
} key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned int len;
} cipher_iv;
@@ -32,7 +32,7 @@ struct mixed_cipher_auth_test_data {
} cipher_key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned int len; /* length must be in Bytes */
} cipher_iv;
@@ -21,7 +21,7 @@ struct docsis_test_data {
} key;
struct {
- uint8_t data[16] __rte_aligned(16);
+ alignas(16) uint8_t data[16];
unsigned int len;
} iv;
@@ -12,7 +12,7 @@ struct snow3g_test_data {
} key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned len;
} cipher_iv;
@@ -12,7 +12,7 @@ struct wireless_test_data {
} key;
struct {
- uint8_t data[64] __rte_aligned(16);
+ alignas(16) uint8_t data[64];
unsigned len;
} cipher_iv;
@@ -53,9 +53,9 @@ struct worker_params {
static volatile unsigned worker_idx;
static volatile unsigned zero_idx;
-struct worker_stats {
+struct __rte_cache_aligned worker_stats {
volatile unsigned handled_packets;
-} __rte_cache_aligned;
+};
struct worker_stats worker_stats[RTE_MAX_LCORE];
/* returns the total count of the number of packets handled by the worker
@@ -87,7 +87,7 @@ struct worker_stats {
static int
handle_work(void *arg)
{
- struct rte_mbuf *buf[8] __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) struct rte_mbuf *buf[8];
struct worker_params *wp = arg;
struct rte_distributor *db = wp->dist;
unsigned int num;
@@ -306,7 +306,7 @@ struct worker_stats {
static int
handle_work_with_free_mbufs(void *arg)
{
- struct rte_mbuf *buf[8] __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) struct rte_mbuf *buf[8];
struct worker_params *wp = arg;
struct rte_distributor *d = wp->dist;
unsigned int i;
@@ -375,7 +375,7 @@ struct worker_stats {
static int
handle_work_for_shutdown_test(void *arg)
{
- struct rte_mbuf *buf[8] __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) struct rte_mbuf *buf[8];
struct worker_params *wp = arg;
struct rte_distributor *d = wp->dist;
unsigned int num;
@@ -592,7 +592,7 @@ struct worker_stats {
static int
handle_and_mark_work(void *arg)
{
- struct rte_mbuf *buf[8] __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) struct rte_mbuf *buf[8];
struct worker_params *wp = arg;
struct rte_distributor *db = wp->dist;
unsigned int num, i;
@@ -33,9 +33,9 @@
static volatile int quit;
static volatile unsigned worker_idx;
-struct worker_stats {
+struct __rte_cache_aligned worker_stats {
volatile unsigned handled_packets;
-} __rte_cache_aligned;
+};
static struct worker_stats worker_stats[RTE_MAX_LCORE];
/*
@@ -122,7 +122,7 @@ struct worker_stats {
unsigned int num = 0;
int i;
unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
- struct rte_mbuf *buf[8] __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) struct rte_mbuf *buf[8];
for (i = 0; i < 8; i++)
buf[i] = NULL;
@@ -101,9 +101,9 @@
static int use_constant_values;
/* number of enqueues / dequeues */
-struct mempool_test_stats {
+struct __rte_cache_aligned mempool_test_stats {
uint64_t enq_count;
-} __rte_cache_aligned;
+};
static struct mempool_test_stats stats[RTE_MAX_LCORE];
@@ -124,7 +124,7 @@ struct mempool_test_stats {
test_loop(struct rte_mempool *mp, struct rte_mempool_cache *cache,
unsigned int x_keep, unsigned int x_get_bulk, unsigned int x_put_bulk)
{
- void *obj_table[MAX_KEEP] __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) void *obj_table[MAX_KEEP];
unsigned int idx;
unsigned int i;
int ret;
@@ -94,12 +94,12 @@ enum {
LCORE_USED,
};
-struct lcore_conf {
+struct __rte_cache_aligned lcore_conf {
uint8_t status;
uint8_t socketid;
uint16_t nb_ports;
uint16_t portlist[RTE_MAX_ETHPORTS];
-} __rte_cache_aligned;
+};
struct lcore_conf lcore_conf[RTE_MAX_LCORE];
@@ -24,7 +24,7 @@ enum {
WRK_CMD_RUN,
};
-static uint32_t wrk_cmd __rte_cache_aligned = WRK_CMD_STOP;
+static alignas(RTE_CACHE_LINE_SIZE) uint32_t wrk_cmd = WRK_CMD_STOP;
/* test run-time in seconds */
static const uint32_t run_time = 60;
@@ -41,14 +41,14 @@ struct lcore_stat {
} op;
};
-struct lcore_arg {
+struct __rte_cache_aligned lcore_arg {
struct rte_ring *rng;
struct lcore_stat stats;
-} __rte_cache_aligned;
+};
-struct ring_elem {
+struct __rte_cache_aligned ring_elem {
uint32_t cnt[RTE_CACHE_LINE_SIZE / sizeof(uint32_t)];
-} __rte_cache_aligned;
+};
/*
* redefinable functions
@@ -42,7 +42,7 @@ enum {
LC_TYPE_WRLOCK,
};
-static struct {
+static alignas(RTE_CACHE_LINE_SIZE) struct {
rte_rwlock_t lock;
uint64_t tick;
@@ -50,9 +50,9 @@ enum {
uint8_t u8[RTE_CACHE_LINE_SIZE];
uint64_t u64[RTE_CACHE_LINE_SIZE / sizeof(uint64_t)];
} data;
-} __rte_cache_aligned try_rwlock_data;
+} try_rwlock_data;
-struct try_rwlock_lcore {
+struct __rte_cache_aligned try_rwlock_lcore {
int32_t rc;
int32_t type;
struct {
@@ -60,7 +60,7 @@ struct try_rwlock_lcore {
uint64_t fail;
uint64_t success;
} stat;
-} __rte_cache_aligned;
+};
static struct try_rwlock_lcore try_lcore_data[RTE_MAX_LCORE];
@@ -12,13 +12,13 @@
#include "test.h"
-struct data {
+struct __rte_cache_aligned data {
rte_seqlock_t lock;
uint64_t a;
- uint64_t b __rte_cache_aligned;
- uint64_t c __rte_cache_aligned;
-} __rte_cache_aligned;
+ alignas(RTE_CACHE_LINE_SIZE) uint64_t b;
+ alignas(RTE_CACHE_LINE_SIZE) uint64_t c;
+};
struct reader {
struct data *data;
@@ -95,8 +95,8 @@
}
static rte_ticketlock_t lk = RTE_TICKETLOCK_INITIALIZER;
-static uint64_t lcount __rte_cache_aligned;
-static uint64_t lcore_count[RTE_MAX_LCORE] __rte_cache_aligned;
+static alignas(RTE_CACHE_LINE_SIZE) uint64_t lcount;
+static alignas(RTE_CACHE_LINE_SIZE) uint64_t lcore_count[RTE_MAX_LCORE];
static uint64_t time_cost[RTE_MAX_LCORE];
#define MAX_LOOP 10000
@@ -14,17 +14,17 @@
struct test_data;
-struct lcore_data {
+struct __rte_cache_aligned lcore_data {
volatile bool done;
volatile bool started;
uint64_t total_cycles;
uint64_t total_calls;
-} __rte_cache_aligned;
+};
-struct test_data {
+struct __rte_cache_aligned test_data {
unsigned int nb_workers;
struct lcore_data ldata[];
-} __rte_cache_aligned;
+};
#define STEP 100
#define CENT_OPS(OP) do { \