git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kni: check code of promiscuous mode switch
[dpdk.git]
/
examples
/
vm_power_manager
/
main.c
diff --git
a/examples/vm_power_manager/main.c
b/examples/vm_power_manager/main.c
index
58c5fa4
..
0f48ae9
100644
(file)
--- a/
examples/vm_power_manager/main.c
+++ b/
examples/vm_power_manager/main.c
@@
-31,9
+31,15
@@
#include "vm_power_cli.h"
#include "oob_monitor.h"
#include "parse.h"
#include "vm_power_cli.h"
#include "oob_monitor.h"
#include "parse.h"
+#ifdef RTE_LIBRTE_IXGBE_PMD
#include <rte_pmd_ixgbe.h>
#include <rte_pmd_ixgbe.h>
+#endif
+#ifdef RTE_LIBRTE_I40E_PMD
#include <rte_pmd_i40e.h>
#include <rte_pmd_i40e.h>
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
#include <rte_pmd_bnxt.h>
#include <rte_pmd_bnxt.h>
+#endif
#define RX_RING_SIZE 1024
#define TX_RING_SIZE 1024
#define RX_RING_SIZE 1024
#define TX_RING_SIZE 1024
@@
-48,7
+54,7
@@
static volatile bool force_quit;
/****************/
static const struct rte_eth_conf port_conf_default = {
.rxmode = {
/****************/
static const struct rte_eth_conf port_conf_default = {
.rxmode = {
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len =
RTE_
ETHER_MAX_LEN,
},
};
},
};
@@
-65,7
+71,13
@@
port_init(uint16_t port, struct rte_mempool *mbuf_pool)
if (!rte_eth_dev_is_valid_port(port))
return -1;
if (!rte_eth_dev_is_valid_port(port))
return -1;
- rte_eth_dev_info_get(port, &dev_info);
+ retval = rte_eth_dev_info_get(port, &dev_info);
+ if (retval != 0) {
+ printf("Error during getting device (port %u) info: %s\n",
+ port, strerror(-retval));
+ return retval;
+ }
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@
-99,7
+111,7
@@
port_init(uint16_t port, struct rte_mempool *mbuf_pool)
return retval;
/* Display the port MAC address. */
return retval;
/* Display the port MAC address. */
- struct ether_addr addr;
+ struct
rte_
ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
@@
-175,6
+187,7
@@
parse_args(int argc, char **argv)
if (cnt < 0) {
printf("Invalid core-list - [%s]\n",
optarg);
if (cnt < 0) {
printf("Invalid core-list - [%s]\n",
optarg);
+ free(oob_enable);
break;
}
for (i = 0; i < ci->core_count; i++) {
break;
}
for (i = 0; i < ci->core_count; i++) {
@@
-348,7
+361,7
@@
main(int argc, char **argv)
/* Initialize ports. */
RTE_ETH_FOREACH_DEV(portid) {
/* Initialize ports. */
RTE_ETH_FOREACH_DEV(portid) {
- struct ether_addr eth;
+ struct
rte_
ether_addr eth;
int w, j;
int ret;
int w, j;
int ret;
@@
-369,14
+382,21
@@
main(int argc, char **argv)
for (w = 0; w < MAX_VFS; w++) {
eth.addr_bytes[5] = w + 0xf0;
for (w = 0; w < MAX_VFS; w++) {
eth.addr_bytes[5] = w + 0xf0;
+ ret = -ENOTSUP;
+#ifdef RTE_LIBRTE_IXGBE_PMD
ret = rte_pmd_ixgbe_set_vf_mac_addr(portid,
w, ð);
ret = rte_pmd_ixgbe_set_vf_mac_addr(portid,
w, ð);
+#endif
+#ifdef RTE_LIBRTE_I40E_PMD
if (ret == -ENOTSUP)
ret = rte_pmd_i40e_set_vf_mac_addr(
portid, w, ð);
if (ret == -ENOTSUP)
ret = rte_pmd_i40e_set_vf_mac_addr(
portid, w, ð);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
if (ret == -ENOTSUP)
ret = rte_pmd_bnxt_set_vf_mac_addr(
portid, w, ð);
if (ret == -ENOTSUP)
ret = rte_pmd_bnxt_set_vf_mac_addr(
portid, w, ð);
+#endif
switch (ret) {
case 0:
switch (ret) {
case 0:
@@
-390,7
+410,6
@@
main(int argc, char **argv)
break;
}
printf("\n");
break;
}
printf("\n");
- break;
}
}
}
}
}
}
@@
-421,6
+440,8
@@
main(int argc, char **argv)
return -1;
}
return -1;
}
+ add_host_channels();
+
printf("Running core monitor on lcore id %d\n", lcore_id);
rte_eal_remote_launch(run_core_monitor, NULL, lcore_id);
printf("Running core monitor on lcore id %d\n", lcore_id);
rte_eal_remote_launch(run_core_monitor, NULL, lcore_id);