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
fix spelling in comments and strings
[dpdk.git]
/
drivers
/
net
/
softnic
/
rte_eth_softnic.c
diff --git
a/drivers/net/softnic/rte_eth_softnic.c
b/drivers/net/softnic/rte_eth_softnic.c
index
ad9e2aa
..
8c098ca
100644
(file)
--- a/
drivers/net/softnic/rte_eth_softnic.c
+++ b/
drivers/net/softnic/rte_eth_softnic.c
@@
-6,8
+6,8
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
-#include <
rte_
ethdev_driver.h>
-#include <
rte_
ethdev_vdev.h>
+#include <ethdev_driver.h>
+#include <ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
@@
-80,7
+80,7
@@
static const struct softnic_conn_params conn_params_default = {
.msg_handle_arg = NULL,
};
.msg_handle_arg = NULL,
};
-RTE_LOG_REGISTER
(pmd_softnic_logtype, pmd.net.softnic
, NOTICE);
+RTE_LOG_REGISTER
_DEFAULT(pmd_softnic_logtype
, NOTICE);
#define PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, pmd_softnic_logtype, \
#define PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, pmd_softnic_logtype, \
@@
-93,6
+93,7
@@
pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
dev_info->max_rx_pktlen = UINT32_MAX;
dev_info->max_rx_queues = UINT16_MAX;
dev_info->max_tx_queues = UINT16_MAX;
dev_info->max_rx_pktlen = UINT32_MAX;
dev_info->max_rx_queues = UINT16_MAX;
dev_info->max_tx_queues = UINT16_MAX;
+ dev_info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
return 0;
}
return 0;
}
@@
-173,18
+174,18
@@
pmd_dev_start(struct rte_eth_dev *dev)
return status;
/* Link UP */
return status;
/* Link UP */
- dev->data->dev_link.link_status = ETH_LINK_UP;
+ dev->data->dev_link.link_status =
RTE_
ETH_LINK_UP;
return 0;
}
return 0;
}
-static
void
+static
int
pmd_dev_stop(struct rte_eth_dev *dev)
{
struct pmd_internals *p = dev->data->dev_private;
/* Link DOWN */
pmd_dev_stop(struct rte_eth_dev *dev)
{
struct pmd_internals *p = dev->data->dev_private;
/* Link DOWN */
- dev->data->dev_link.link_status = ETH_LINK_DOWN;
+ dev->data->dev_link.link_status =
RTE_
ETH_LINK_DOWN;
/* Firmware */
softnic_pipeline_disable_all(p);
/* Firmware */
softnic_pipeline_disable_all(p);
@@
-199,6
+200,8
@@
pmd_dev_stop(struct rte_eth_dev *dev)
tm_hierarchy_free(p);
softnic_mtr_free(p);
tm_hierarchy_free(p);
softnic_mtr_free(p);
+
+ return 0;
}
static void
}
static void
@@
-246,18
+249,11
@@
pmd_link_update(struct rte_eth_dev *dev __rte_unused,
}
static int
}
static int
-pmd_filter_ctrl(struct rte_eth_dev *dev __rte_unused,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg)
+pmd_flow_ops_get(struct rte_eth_dev *dev __rte_unused,
+ const struct rte_flow_ops **ops)
{
{
- if (filter_type == RTE_ETH_FILTER_GENERIC &&
- filter_op == RTE_ETH_FILTER_GET) {
- *(const void **)arg = &pmd_flow_ops;
- return 0;
- }
-
- return -ENOTSUP;
+ *ops = &pmd_flow_ops;
+ return 0;
}
static int
}
static int
@@
-285,7
+281,7
@@
static const struct eth_dev_ops pmd_ops = {
.dev_infos_get = pmd_dev_infos_get,
.rx_queue_setup = pmd_rx_queue_setup,
.tx_queue_setup = pmd_tx_queue_setup,
.dev_infos_get = pmd_dev_infos_get,
.rx_queue_setup = pmd_rx_queue_setup,
.tx_queue_setup = pmd_tx_queue_setup,
- .f
ilter_ctrl = pmd_filter_ctrl
,
+ .f
low_ops_get = pmd_flow_ops_get
,
.tm_ops_get = pmd_tm_ops_get,
.mtr_ops_get = pmd_mtr_ops_get,
};
.tm_ops_get = pmd_tm_ops_get,
.mtr_ops_get = pmd_mtr_ops_get,
};
@@
-390,12
+386,11
@@
pmd_ethdev_register(struct rte_vdev_device *vdev,
dev->device = &vdev->device;
/* dev->data */
dev->device = &vdev->device;
/* dev->data */
- dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
dev->data->dev_private = dev_private;
dev->data->dev_private = dev_private;
- dev->data->dev_link.link_speed = ETH_SPEED_NUM_100G;
- dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
- dev->data->dev_link.link_autoneg = ETH_LINK_FIXED;
- dev->data->dev_link.link_status = ETH_LINK_DOWN;
+ dev->data->dev_link.link_speed =
RTE_
ETH_SPEED_NUM_100G;
+ dev->data->dev_link.link_duplex =
RTE_
ETH_LINK_FULL_DUPLEX;
+ dev->data->dev_link.link_autoneg =
RTE_
ETH_LINK_FIXED;
+ dev->data->dev_link.link_status =
RTE_
ETH_LINK_DOWN;
dev->data->mac_addrs = ð_addr;
dev->data->promiscuous = 1;
dev->data->numa_node = params->cpu_id;
dev->data->mac_addrs = ð_addr;
dev->data->promiscuous = 1;
dev->data->numa_node = params->cpu_id;
@@
-446,6
+441,7
@@
pmd_parse_args(struct pmd_params *p, const char *params)
{
struct rte_kvargs *kvlist;
int ret = 0;
{
struct rte_kvargs *kvlist;
int ret = 0;
+ char *firmware = NULL;
kvlist = rte_kvargs_parse(params, pmd_valid_args);
if (kvlist == NULL)
kvlist = rte_kvargs_parse(params, pmd_valid_args);
if (kvlist == NULL)
@@
-453,7
+449,14
@@
pmd_parse_args(struct pmd_params *p, const char *params)
/* Set default values */
memset(p, 0, sizeof(*p));
/* Set default values */
memset(p, 0, sizeof(*p));
- p->firmware = SOFTNIC_FIRMWARE;
+ if (rte_strscpy(p->firmware, SOFTNIC_FIRMWARE,
+ sizeof(p->firmware)) < 0) {
+ PMD_LOG(WARNING,
+ "\"%s\": firmware path should be shorter than %zu",
+ SOFTNIC_FIRMWARE, sizeof(p->firmware));
+ ret = -EINVAL;
+ goto out_free;
+ }
p->cpu_id = SOFTNIC_CPU_ID;
p->sc = SOFTNIC_SC;
p->tm.n_queues = SOFTNIC_TM_N_QUEUES;
p->cpu_id = SOFTNIC_CPU_ID;
p->sc = SOFTNIC_SC;
p->tm.n_queues = SOFTNIC_TM_N_QUEUES;
@@
-474,11
+477,22
@@
pmd_parse_args(struct pmd_params *p, const char *params)
/* Firmware script (optional) */
if (rte_kvargs_count(kvlist, PMD_PARAM_FIRMWARE) == 1) {
ret = rte_kvargs_process(kvlist, PMD_PARAM_FIRMWARE,
/* Firmware script (optional) */
if (rte_kvargs_count(kvlist, PMD_PARAM_FIRMWARE) == 1) {
ret = rte_kvargs_process(kvlist, PMD_PARAM_FIRMWARE,
- &get_string, &
p->
firmware);
+ &get_string, &firmware);
if (ret < 0)
goto out_free;
if (ret < 0)
goto out_free;
- }
+ if (rte_strscpy(p->firmware, firmware,
+ sizeof(p->firmware)) < 0) {
+ PMD_LOG(WARNING,
+ "\"%s\": "
+ "firmware path should be shorter than %zu",
+ firmware, sizeof(p->firmware));
+ free(firmware);
+ ret = -EINVAL;
+ goto out_free;
+ }
+ free(firmware);
+ }
/* Connection listening port (optional) */
if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) {
ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT,
/* Connection listening port (optional) */
if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) {
ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT,
@@
-627,7
+641,12
@@
pmd_probe(struct rte_vdev_device *vdev)
if (status)
return status;
if (status)
return status;
- p.name = name;
+ if (rte_strscpy(p.name, name, sizeof(p.name)) < 0) {
+ PMD_LOG(WARNING,
+ "\"%s\": device name should be shorter than %zu",
+ name, sizeof(p.name));
+ return -EINVAL;
+ }
/* Allocate and initialize soft ethdev private data */
dev_private = pmd_init(&p);
/* Allocate and initialize soft ethdev private data */
dev_private = pmd_init(&p);