* strtok() is used so the params string will be copied to be modified.
*/
static int
-rte_kvargs_tokenize(struct rte_kvargs *kvlist, const char *name,
- const char *params)
+rte_kvargs_tokenize(struct rte_kvargs *kvlist, const char *params)
{
unsigned i, count;
char *args;
/* If params are empty, nothing to do */
if (params == NULL || params[0] == 0) {
- RTE_LOG(ERR, PMD, "Couldn't parse %s device, empty arguments\n", name);
+ RTE_LOG(ERR, PMD, "Cannot parse empty arguments\n");
return -1;
}
*/
args = strdup(params);
if(args == NULL){
- RTE_LOG(ERR, PMD, "Couldn't parse %s device \n", name);
+ RTE_LOG(ERR, PMD, "Cannot parse arguments: not enough memory\n");
return -1;
}
if (pair[0] == NULL || pair[1] == NULL || pair[0][0] == 0
|| pair[1][0] == 0) {
RTE_LOG(ERR, PMD,
- "Couldn't parse %s device, wrong key or value \n", name);
+ "Cannot parse arguments: wrong key or value\n"
+ "params=<%s>\n", params);
goto error;
}
*/
int
rte_kvargs_parse(struct rte_kvargs *kvlist,
- const char *name,
const char *args,
const char *valid_keys[])
{
int ret;
- ret = rte_kvargs_tokenize(kvlist, name, args);
+ ret = rte_kvargs_tokenize(kvlist, args);
if (ret < 0)
return ret;
*
* @param kvlist
* The rte_kvargs structure
- * @param name
- * The name of the driver
* @param args
* The input string containing the key/value associations
* @param valid_keys
* - 0 on success
* - Negative on error
*/
-int rte_kvargs_parse(struct rte_kvargs *kvlist, const char *name,
+int rte_kvargs_parse(struct rte_kvargs *kvlist,
const char *args, const char *valid_keys[]);
/**
struct rx_pcaps pcaps;
struct tx_pcaps dumpers;
+ RTE_LOG(INFO, PMD, "Initializing pmd_pcap for %s\n", name);
+
rte_kvargs_init(&kvlist);
numa_node = rte_socket_id();
start_cycles = rte_get_timer_cycles();
hz = rte_get_timer_hz();
- if (rte_kvargs_parse(&kvlist, name, params, valid_arguments) < 0)
+ if (rte_kvargs_parse(&kvlist, params, valid_arguments) < 0)
return -1;
/*
int
rte_pmd_ring_init(const char *name, const char *params)
{
+ RTE_LOG(INFO, PMD, "Initializing pmd_ring for %s\n", name);
+
if (params == NULL)
eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE);
else {