app/testpmd: fix build for 16-byte Rx descriptor mode
[dpdk.git] / examples / vm_power_manager / guest_cli / vm_power_cli_guest.c
index 0db1b80..77e5440 100644 (file)
@@ -34,7 +34,7 @@ struct cmd_quit_result {
 };
 
 union PFID {
-       struct ether_addr addr;
+       struct rte_ether_addr addr;
        uint64_t pfid;
 };
 
@@ -51,9 +51,15 @@ set_policy_mac(int port, int idx)
 {
        struct channel_packet *policy;
        union PFID pfid;
+       int ret;
 
        /* Use port MAC address as the vfid */
-       rte_eth_macaddr_get(port, &pfid.addr);
+       ret = rte_eth_macaddr_get(port, &pfid.addr);
+       if (retval != 0) {
+               printf("Failed to get device (port %u) MAC address: %s\n",
+                               port, rte_strerror(-retval));
+               return retval;
+       }
 
        printf("Port %u MAC: %02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":"
                        "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 "\n",
@@ -66,10 +72,15 @@ set_policy_mac(int port, int idx)
        return 0;
 }
 
-void
+int
 set_policy_defaults(struct channel_packet *pkt)
 {
-       set_policy_mac(0, 0);
+       int ret;
+
+       ret = set_policy_mac(0, 0);
+       if (ret != 0)
+               return ret;
+
        pkt->nb_mac_to_monitor = 1;
 
        pkt->t_boost_status.tbEnabled = false;
@@ -92,6 +103,7 @@ set_policy_defaults(struct channel_packet *pkt)
        pkt->timer_policy.hours_to_use_traffic_profile[0] = 8;
        pkt->timer_policy.hours_to_use_traffic_profile[1] = 10;
 
+       pkt->core_type = CORE_TYPE_VIRTUAL;
        pkt->workload = LOW;
        pkt->policy_to_use = TIME;
        pkt->command = PKT_POLICY;