#include "commands.h"
struct cmdline *cl,
{
cmdline_printf(cl,
"commands:\n"
"- attach <devargs>\n"
"- detach <devargs>\n"
"- list\n\n");
}
void
struct cmdline *cl,
{
cmdline_quit(cl);
}
void
struct cmdline *cl,
{
uint16_t port_id;
char dev_name[RTE_DEV_NAME_MAX_LEN];
cmdline_printf(cl, "list all etherdev\n");
if (strlen(dev_name) > 0)
cmdline_printf(cl, "%d\t%s\n", port_id, dev_name);
else
printf("empty dev_name is not expected!\n");
}
}
void
cmd_attach_parsed(void *parsed_result,
struct cmdline *cl,
{
struct cmd_attach_result *res = parsed_result;
memset(&da, 0, sizeof(da));
cmdline_printf(cl, "cannot parse devargs\n");
return;
}
cmdline_printf(cl, "attached device %s\n", da.name);
else
cmdline_printf(cl, "failed to attached device %s\n",
da.name);
}
void
cmd_detach_parsed(void *parsed_result,
struct cmdline *cl,
{
struct cmd_detach_result *res = parsed_result;
memset(&da, 0, sizeof(da));
cmdline_printf(cl, "cannot parse devargs\n");
return;
}
printf("detaching...\n");
cmdline_printf(cl, "detached device %s\n",
da.name);
else
cmdline_printf(cl, "failed to detach device %s\n",
da.name);
}
const char * rte_bus_name(const struct rte_bus *bus)
int rte_eal_hotplug_add(const char *busname, const char *devname, const char *drvargs)
int rte_eal_hotplug_remove(const char *busname, const char *devname)
int rte_devargs_parsef(struct rte_devargs *da, const char *format,...) __rte_format_printf(2
int void rte_devargs_reset(struct rte_devargs *da)
#define RTE_ETH_FOREACH_DEV(p)
int rte_eth_dev_get_name_by_port(uint16_t port_id, char *name)