#define INVALID_PORT_ID 0xFF
-/* Maximum long option length for option parsing. */
-#define MAX_LONG_OPT_SZ 64
-
/* mask of enabled ports */
static uint32_t enabled_port_mask = 0;
static int async_vhost_driver;
-static char dma_type[MAX_LONG_OPT_SZ];
+static char *dma_type;
/* Specify timeout (in useconds) between retries on RX. */
static uint32_t burst_rx_delay_time = BURST_RX_WAIT_US;
static inline int
open_dma(const char *value)
{
- if (strncmp(dma_type, "ioat", 4) == 0)
+ if (dma_type != NULL && strncmp(dma_type, "ioat", 4) == 0)
return open_ioat(value);
return -1;
break;
case OPT_DMA_TYPE_NUM:
- strcpy(dma_type, optarg);
+ dma_type = optarg;
break;
case OPT_DMAS_NUM:
struct rte_vhost_async_features f;
struct rte_vhost_async_channel_ops channel_ops;
- if (strncmp(dma_type, "ioat", 4) == 0) {
+ if (dma_type != NULL && strncmp(dma_type, "ioat", 4) == 0) {
channel_ops.transfer_data = ioat_transfer_data_cb;
channel_ops.check_completed_copies =
ioat_check_completed_copies_cb;