#include <rte_alarm.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
-#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_mempool.h>
#include <rte_malloc.h>
continue;
/* Fail to setup rx queue, return */
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING,
- RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr,
"Port %d can not be set back to stopped\n", pi);
fprintf(stderr, "Fail to configure port %d hairpin queues\n",
continue;
/* Fail to setup rx queue, return */
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING,
- RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr,
"Port %d can not be set back to stopped\n", pi);
fprintf(stderr, "Fail to configure port %d hairpin queues\n",
need_check_link_status = 0;
port = &ports[pi];
- if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STOPPED,
- RTE_PORT_HANDLING) == 0) {
+ if (port->port_status == RTE_PORT_STOPPED)
+ port->port_status = RTE_PORT_HANDLING;
+ else {
fprintf(stderr, "Port %d is now not stopped\n", pi);
continue;
}
nb_txq + nb_hairpinq,
&(port->dev_conf));
if (diag != 0) {
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr,
"Port %d can not be set back to stopped\n",
pi);
continue;
/* Fail to setup tx queue, return */
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING,
- RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr,
"Port %d can not be set back to stopped\n",
pi);
continue;
/* Fail to setup rx queue, return */
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING,
- RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr,
"Port %d can not be set back to stopped\n",
pi);
pi, rte_strerror(-diag));
/* Fail to setup rx queue, return */
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr,
"Port %d can not be set back to stopped\n",
pi);
continue;
}
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STARTED;
+ else
fprintf(stderr, "Port %d can not be set into started\n",
pi);
}
port = &ports[pi];
- if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STARTED,
- RTE_PORT_HANDLING) == 0)
+ if (port->port_status == RTE_PORT_STARTED)
+ port->port_status = RTE_PORT_HANDLING;
+ else
continue;
if (hairpin_mode & 0xf) {
RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n",
pi);
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
+ if (port->port_status == RTE_PORT_HANDLING)
+ port->port_status = RTE_PORT_STOPPED;
+ else
fprintf(stderr, "Port %d can not be set into stopped\n",
pi);
need_check_link_status = 1;
}
port = &ports[pi];
- if (rte_atomic16_cmpset(&(port->port_status),
- RTE_PORT_CLOSED, RTE_PORT_CLOSED) == 1) {
+ if (port->port_status == RTE_PORT_CLOSED) {
fprintf(stderr, "Port %d is already closed\n", pi);
continue;
}