X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fchannel_monitor.c;h=97b8def7cadde30dbe926d17a8793844af3dae33;hb=68629be3a622ee53cd5b40c8447ae9b083ff3f6c;hp=99f81544d761a92907851246b0022637621d226a;hpb=825fddf651d49b991a5a08eb02bab90695ec85c7;p=dpdk.git diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index 99f81544d7..97b8def7ca 100644 --- a/examples/vm_power_manager/channel_monitor.c +++ b/examples/vm_power_manager/channel_monitor.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #ifdef RTE_NET_I40E @@ -124,9 +123,7 @@ set_policy_mac(struct rte_power_channel_packet *pkt, int idx, char *mac) printf("Received MAC Address: %02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":" "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 "\n", - pfid.addr.addr_bytes[0], pfid.addr.addr_bytes[1], - pfid.addr.addr_bytes[2], pfid.addr.addr_bytes[3], - pfid.addr.addr_bytes[4], pfid.addr.addr_bytes[5]); + RTE_ETHER_ADDR_BYTES(&pfid.addr)); pkt->vfid[idx] = pfid.pfid; return 0; @@ -407,7 +404,7 @@ get_pcpu_to_control(struct policy *pol) /* * So now that we're handling virtual and physical cores, we need to - * differenciate between them when adding them to the branch monitor. + * differentiate between them when adding them to the branch monitor. * Virtual cores need to be converted to physical cores. */ if (pol->pkt.core_type == RTE_POWER_CORE_TYPE_VIRTUAL) { @@ -829,8 +826,9 @@ process_request(struct rte_power_channel_packet *pkt, if (chan_info == NULL) return -1; - if (rte_atomic32_cmpset(&(chan_info->status), CHANNEL_MGR_CHANNEL_CONNECTED, - CHANNEL_MGR_CHANNEL_PROCESSING) == 0) + uint32_t channel_connected = CHANNEL_MGR_CHANNEL_CONNECTED; + if (__atomic_compare_exchange_n(&(chan_info->status), &channel_connected, + CHANNEL_MGR_CHANNEL_PROCESSING, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED) == 0) return -1; if (pkt->command == RTE_POWER_CPU_POWER) { @@ -934,8 +932,9 @@ process_request(struct rte_power_channel_packet *pkt, * Return is not checked as channel status may have been set to DISABLED * from management thread */ - rte_atomic32_cmpset(&(chan_info->status), CHANNEL_MGR_CHANNEL_PROCESSING, - CHANNEL_MGR_CHANNEL_CONNECTED); + uint32_t channel_processing = CHANNEL_MGR_CHANNEL_PROCESSING; + __atomic_compare_exchange_n(&(chan_info->status), &channel_processing, + CHANNEL_MGR_CHANNEL_CONNECTED, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); return 0; }