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
net/mlx5: fix meter policy flow match item
[dpdk.git]
/
drivers
/
net
/
failsafe
/
failsafe_args.c
diff --git
a/drivers/net/failsafe/failsafe_args.c
b/drivers/net/failsafe/failsafe_args.c
index
c04ea08
..
b203e02
100644
(file)
--- a/
drivers/net/failsafe/failsafe_args.c
+++ b/
drivers/net/failsafe/failsafe_args.c
@@
-22,8
+22,8
@@
typedef int (parse_cb)(struct rte_eth_dev *dev, const char *params,
uint8_t head);
typedef int (parse_cb)(struct rte_eth_dev *dev, const char *params,
uint8_t head);
-uint64_t hotplug_poll = FAILSAFE_HOTPLUG_DEFAULT_TIMEOUT_MS;
-int
mac_from_arg = 0
;
+uint64_t
failsafe_
hotplug_poll = FAILSAFE_HOTPLUG_DEFAULT_TIMEOUT_MS;
+int
failsafe_mac_from_arg
;
static const char * const pmd_failsafe_init_parameters[] = {
PMD_FAILSAFE_HOTPLUG_POLL_KVARG,
static const char * const pmd_failsafe_init_parameters[] = {
PMD_FAILSAFE_HOTPLUG_POLL_KVARG,
@@
-102,7
+102,7
@@
fs_execute_cmd(struct sub_device *sdev, char *cmdline)
ERROR("Command line allocation failed");
return -ENOMEM;
}
ERROR("Command line allocation failed");
return -ENOMEM;
}
- s
nprintf(sdev->cmdline, len, "%s", cmdline
);
+ s
trlcpy(sdev->cmdline, cmdline, len
);
/* Replace all commas in the command line by spaces */
for (i = 0; i < len; i++)
if (sdev->cmdline[i] == ',')
/* Replace all commas in the command line by spaces */
for (i = 0; i < len; i++)
if (sdev->cmdline[i] == ',')
@@
-367,16
+367,12
@@
static int
fs_get_mac_addr_arg(const char *key __rte_unused,
const char *value, void *out)
{
fs_get_mac_addr_arg(const char *key __rte_unused,
const char *value, void *out)
{
- struct ether_addr *ea = out;
- int ret;
+ struct rte_ether_addr *ea = out;
if ((value == NULL) || (out == NULL))
return -EINVAL;
if ((value == NULL) || (out == NULL))
return -EINVAL;
- ret = sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
- &ea->addr_bytes[0], &ea->addr_bytes[1],
- &ea->addr_bytes[2], &ea->addr_bytes[3],
- &ea->addr_bytes[4], &ea->addr_bytes[5]);
- return ret != ETHER_ADDR_LEN;
+
+ return rte_ether_unformat_addr(value, ea);
}
int
}
int
@@
-420,7
+416,7
@@
failsafe_args_parse(struct rte_eth_dev *dev, const char *params)
if (arg_count == 1) {
ret = rte_kvargs_process(kvlist,
PMD_FAILSAFE_HOTPLUG_POLL_KVARG,
if (arg_count == 1) {
ret = rte_kvargs_process(kvlist,
PMD_FAILSAFE_HOTPLUG_POLL_KVARG,
- &fs_get_u64_arg, &hotplug_poll);
+ &fs_get_u64_arg, &
failsafe_
hotplug_poll);
if (ret < 0)
goto free_kvlist;
}
if (ret < 0)
goto free_kvlist;
}
@@
-435,7
+431,7
@@
failsafe_args_parse(struct rte_eth_dev *dev, const char *params)
if (ret < 0)
goto free_kvlist;
if (ret < 0)
goto free_kvlist;
- mac_from_arg = 1;
+
failsafe_
mac_from_arg = 1;
}
}
PRIV(dev)->state = DEV_PARSED;
}
}
PRIV(dev)->state = DEV_PARSED;
@@
-455,8
+451,7
@@
failsafe_args_free(struct rte_eth_dev *dev)
sdev->cmdline = NULL;
free(sdev->fd_str);
sdev->fd_str = NULL;
sdev->cmdline = NULL;
free(sdev->fd_str);
sdev->fd_str = NULL;
- free(sdev->devargs.args);
- sdev->devargs.args = NULL;
+ rte_devargs_reset(&sdev->devargs);
}
}
}
}