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
ring: remove unnecessary forward declaration
[dpdk.git]
/
drivers
/
net
/
vdev_netvsc
/
vdev_netvsc.c
diff --git
a/drivers/net/vdev_netvsc/vdev_netvsc.c
b/drivers/net/vdev_netvsc/vdev_netvsc.c
index
48717f2
..
edab63e
100644
(file)
--- a/
drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/
drivers/net/vdev_netvsc/vdev_netvsc.c
@@
-68,7
+68,7
@@
struct vdev_netvsc_ctx {
char devargs[256]; /**< Fail-safe device arguments. */
char if_name[IF_NAMESIZE]; /**< NetVSC netdevice name. */
unsigned int if_index; /**< NetVSC netdevice index. */
char devargs[256]; /**< Fail-safe device arguments. */
char if_name[IF_NAMESIZE]; /**< NetVSC netdevice name. */
unsigned int if_index; /**< NetVSC netdevice index. */
- struct
ether_addr if_addr;
/**< NetVSC MAC address. */
+ struct
rte_ether_addr if_addr;
/**< NetVSC MAC address. */
int pipe[2]; /**< Fail-safe communication pipe. */
char yield[256]; /**< PCI sub-device arguments. */
};
int pipe[2]; /**< Fail-safe communication pipe. */
char yield[256]; /**< PCI sub-device arguments. */
};
@@
-157,7
+157,7
@@
vdev_netvsc_iface_is_netvsc(const struct if_nameindex *iface)
*/
static int
vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
*/
static int
vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
- const struct ether_addr *eth_addr,
+ const struct
rte_
ether_addr *eth_addr,
va_list ap), int is_netvsc, ...)
{
struct if_nameindex *iface = if_nameindex();
va_list ap), int is_netvsc, ...)
{
struct if_nameindex *iface = if_nameindex();
@@
-178,7
+178,7
@@
vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
for (i = 0; iface[i].if_name; ++i) {
int is_netvsc_ret;
struct ifreq req;
for (i = 0; iface[i].if_name; ++i) {
int is_netvsc_ret;
struct ifreq req;
- struct ether_addr eth_addr;
+ struct
rte_
ether_addr eth_addr;
va_list ap;
is_netvsc_ret = vdev_netvsc_iface_is_netvsc(&iface[i]) ? 1 : 0;
va_list ap;
is_netvsc_ret = vdev_netvsc_iface_is_netvsc(&iface[i]) ? 1 : 0;
@@
-191,11
+191,8
@@
vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface,
req.ifr_name, rte_strerror(errno));
continue;
}
req.ifr_name, rte_strerror(errno));
continue;
}
- if (req.ifr_hwaddr.sa_family != ARPHRD_ETHER) {
- DRV_LOG(DEBUG, "interface %s is non-ethernet device",
- req.ifr_name);
+ if (req.ifr_hwaddr.sa_family != ARPHRD_ETHER)
continue;
continue;
- }
memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data,
RTE_DIM(eth_addr.addr_bytes));
va_start(ap, is_netvsc);
memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data,
RTE_DIM(eth_addr.addr_bytes));
va_start(ap, is_netvsc);
@@
-333,7
+330,7
@@
vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
char in[RTE_MAX(sizeof(ctx->yield), 256u)];
int ret;
char in[RTE_MAX(sizeof(ctx->yield), 256u)];
int ret;
- ret = snprintf(in, sizeof(in)
- 1
, "/sys/class/net/%s/%s",
+ ret = snprintf(in, sizeof(in), "/sys/class/net/%s/%s",
if_name, relpath);
if (ret == -1 || (size_t)ret >= sizeof(in))
return -ENOBUFS;
if_name, relpath);
if (ret == -1 || (size_t)ret >= sizeof(in))
return -ENOBUFS;
@@
-371,7
+368,7
@@
vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
*/
static int
vdev_netvsc_device_probe(const struct if_nameindex *iface,
*/
static int
vdev_netvsc_device_probe(const struct if_nameindex *iface,
- const struct ether_addr *eth_addr,
+ const struct
rte_
ether_addr *eth_addr,
va_list ap)
{
struct vdev_netvsc_ctx *ctx = va_arg(ap, struct vdev_netvsc_ctx *);
va_list ap)
{
struct vdev_netvsc_ctx *ctx = va_arg(ap, struct vdev_netvsc_ctx *);
@@
-390,7
+387,7
@@
vdev_netvsc_device_probe(const struct if_nameindex *iface,
strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
return 0;
}
strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
return 0;
}
- if (!is_same_ether_addr(eth_addr, &ctx->if_addr))
+ if (!
rte_
is_same_ether_addr(eth_addr, &ctx->if_addr))
return 0;
/* Look for associated PCI device. */
ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
return 0;
/* Look for associated PCI device. */
ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
@@
-510,7
+507,7
@@
vdev_netvsc_alarm(__rte_unused void *arg)
*/
static int
vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
*/
static int
vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
- const struct ether_addr *eth_addr,
+ const struct
rte_
ether_addr *eth_addr,
va_list ap)
{
const char *name = va_arg(ap, const char *);
va_list ap)
{
const char *name = va_arg(ap, const char *);
@@
-530,7
+527,7
@@
vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
if (!strcmp(pair->value, iface->if_name))
break;
} else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) {
if (!strcmp(pair->value, iface->if_name))
break;
} else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) {
- struct ether_addr tmp;
+ struct
rte_
ether_addr tmp;
if (sscanf(pair->value,
"%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":"
if (sscanf(pair->value,
"%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":"
@@
-547,7
+544,7
@@
vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
pair->value);
return -EINVAL;
}
pair->value);
return -EINVAL;
}
- if (is_same_ether_addr(eth_addr, &tmp))
+ if (
rte_
is_same_ether_addr(eth_addr, &tmp))
break;
}
}
break;
}
}
@@
-789,7
+786,7
@@
RTE_PMD_REGISTER_PARAM_STRING(net_vdev_netvsc,
/** Initialize driver log type. */
RTE_INIT(vdev_netvsc_init_log)
{
/** Initialize driver log type. */
RTE_INIT(vdev_netvsc_init_log)
{
- vdev_netvsc_logtype = rte_log_register("pmd.vdev_netvsc");
+ vdev_netvsc_logtype = rte_log_register("pmd.
net.
vdev_netvsc");
if (vdev_netvsc_logtype >= 0)
rte_log_set_level(vdev_netvsc_logtype, RTE_LOG_NOTICE);
}
if (vdev_netvsc_logtype >= 0)
rte_log_set_level(vdev_netvsc_logtype, RTE_LOG_NOTICE);
}
@@
-811,7
+808,7
@@
vdev_netvsc_cmp_rte_device(const struct rte_device *dev1,
static void
vdev_netvsc_scan_callback(__rte_unused void *arg)
{
static void
vdev_netvsc_scan_callback(__rte_unused void *arg)
{
- struct rte_
vdev_
device *dev;
+ struct rte_device *dev;
struct rte_devargs *devargs;
struct rte_bus *vbus = rte_bus_find_by_name("vdev");
struct rte_devargs *devargs;
struct rte_bus *vbus = rte_bus_find_by_name("vdev");
@@
-819,8
+816,9
@@
vdev_netvsc_scan_callback(__rte_unused void *arg)
if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
VDEV_NETVSC_DRIVER_NAME_LEN))
return;
if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
VDEV_NETVSC_DRIVER_NAME_LEN))
return;
- dev = (struct rte_vdev_device *)vbus->find_device(NULL,
- vdev_netvsc_cmp_rte_device, VDEV_NETVSC_DRIVER_NAME);
+
+ dev = vbus->find_device(NULL, vdev_netvsc_cmp_rte_device,
+ VDEV_NETVSC_DRIVER_NAME);
if (dev)
return;
if (rte_devargs_add(RTE_DEVTYPE_VIRTUAL, VDEV_NETVSC_DRIVER_NAME))
if (dev)
return;
if (rte_devargs_add(RTE_DEVTYPE_VIRTUAL, VDEV_NETVSC_DRIVER_NAME))