#include <getopt.h>
#include <signal.h>
-#include <rte_atomic.h>
#include <rte_common.h>
#include <rte_eal.h>
#include <rte_cycles.h>
static const struct rte_eth_conf port_conf = {
.rxmode = {
- .mq_mode = ETH_MQ_RX_NONE,
- .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+ .mq_mode = RTE_ETH_MQ_RX_NONE,
.split_hdr_size = 0,
},
.txmode = {
- .mq_mode = ETH_MQ_TX_NONE,
+ .mq_mode = RTE_ETH_MQ_TX_NONE,
},
};
.num_dec_cores = 1,
};
-static rte_atomic16_t global_exit_flag;
+static uint16_t global_exit_flag;
/* display usage */
static inline void
signal_handler(int signum)
{
printf("\nSignal %d received\n", signum);
- rte_atomic16_set(&global_exit_flag, 1);
+ __atomic_store_n(&global_exit_flag, 1, __ATOMIC_RELAXED);
}
static void
{
printf("Port %u, MAC address: " RTE_ETHER_ADDR_PRT_FMT "\n\n",
(unsigned int) portid,
- bbdev_ports_eth_address->addr_bytes[0],
- bbdev_ports_eth_address->addr_bytes[1],
- bbdev_ports_eth_address->addr_bytes[2],
- bbdev_ports_eth_address->addr_bytes[3],
- bbdev_ports_eth_address->addr_bytes[4],
- bbdev_ports_eth_address->addr_bytes[5]);
+ RTE_ETHER_ADDR_BYTES(bbdev_ports_eth_address));
}
static inline void
fflush(stdout);
for (count = 0; count <= MAX_CHECK_TIME &&
- !rte_atomic16_read(&global_exit_flag); count++) {
+ !__atomic_load_n(&global_exit_flag, __ATOMIC_RELAXED); count++) {
memset(&link, 0, sizeof(link));
link_get_err = rte_eth_link_get_nowait(port_id, &link);
if (link_get_err >= 0 && link.link_status) {
const char *dp = (link.link_duplex ==
- ETH_LINK_FULL_DUPLEX) ?
+ RTE_ETH_LINK_FULL_DUPLEX) ?
"full-duplex" : "half-duplex";
printf("\nPort %u Link Up - speed %s - %s\n",
port_id,
/* Encoder output to Decoder input adapter. The Decoder accepts only soft input
* so each bit of the encoder output must be translated into one byte of LLR. If
* Sub-block Deinterleaver is bypassed, which is the case, the padding bytes
- * must additionally be insterted at the end of each sub-block.
+ * must additionally be inserted at the end of each sub-block.
*/
static inline void
transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf,
{
struct stats_lcore_params *stats_lcore = arg;
- while (!rte_atomic16_read(&global_exit_flag)) {
+ while (!__atomic_load_n(&global_exit_flag, __ATOMIC_RELAXED)) {
print_stats(stats_lcore);
rte_delay_ms(500);
}
const bool run_decoder = (lcore_conf->core_type &
(1 << RTE_BBDEV_OP_TURBO_DEC));
- while (!rte_atomic16_read(&global_exit_flag)) {
+ while (!__atomic_load_n(&global_exit_flag, __ATOMIC_RELAXED)) {
if (run_encoder)
run_encoding(lcore_conf);
if (run_decoder)
.align = __alignof__(struct rte_mbuf *),
};
- rte_atomic16_init(&global_exit_flag);
+ __atomic_store_n(&global_exit_flag, 0, __ATOMIC_RELAXED);
sigret = signal(SIGTERM, signal_handler);
if (sigret == SIG_ERR)