static struct vdpa_port vports[MAX_VDPA_SAMPLE_PORTS];
static char iface[MAX_PATH_LEN];
-static int dev_total;
static int devcnt;
static int interactive;
static int client_mode;
vdpa_sample_quit(void)
{
int i;
- for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, dev_total); i++) {
+ for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, devcnt); i++) {
if (vports[i].ifname[0] != '\0')
close_vdpa(&vports[i]);
}
res->bdf);
return;
}
- for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, dev_total); i++) {
+ for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, devcnt); i++) {
if (vports[i].dev == vdev) {
vport = &vports[i];
break;
argc -= ret;
argv += ret;
- dev_total = rte_vdpa_get_device_num();
- if (dev_total <= 0)
- rte_exit(EXIT_FAILURE, "No available vdpa device found\n");
-
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);