Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Imported Upstream version 16.11
[deb_dpdk.git]
/
drivers
/
net
/
xenvirt
/
rte_eth_xenvirt.c
diff --git
a/drivers/net/xenvirt/rte_eth_xenvirt.c
b/drivers/net/xenvirt/rte_eth_xenvirt.c
index
b9638d9
..
c08a056
100644
(file)
--- a/
drivers/net/xenvirt/rte_eth_xenvirt.c
+++ b/
drivers/net/xenvirt/rte_eth_xenvirt.c
@@
-39,6
+39,9
@@
#include <sys/mman.h>
#include <errno.h>
#include <sys/user.h>
#include <sys/mman.h>
#include <errno.h>
#include <sys/user.h>
+#ifndef PAGE_SIZE
+#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
+#endif
#include <linux/binfmts.h>
#include <xen/xen-compat.h>
#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00040200
#include <linux/binfmts.h>
#include <xen/xen-compat.h>
#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00040200
@@
-53,7
+56,7
@@
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
-#include <rte_dev.h>
+#include <rte_
v
dev.h>
#include <cmdline_parse.h>
#include <cmdline_parse_etheraddr.h>
#include <cmdline_parse.h>
#include <cmdline_parse_etheraddr.h>
@@
-79,18
+82,6
@@
static struct rte_eth_link pmd_link = {
static void
eth_xenvirt_free_queues(struct rte_eth_dev *dev);
static void
eth_xenvirt_free_queues(struct rte_eth_dev *dev);
-static inline struct rte_mbuf *
-rte_rxmbuf_alloc(struct rte_mempool *mp)
-{
- struct rte_mbuf *m;
-
- m = __rte_mbuf_raw_alloc(mp);
- __rte_mbuf_sanity_check_raw(m, 0);
-
- return m;
-}
-
-
static uint16_t
eth_xenvirt_rx(void *q, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
{
static uint16_t
eth_xenvirt_rx(void *q, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
{
@@
-122,7
+113,7
@@
eth_xenvirt_rx(void *q, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
}
/* allocate new mbuf for the used descriptor */
while (likely(!virtqueue_full(rxvq))) {
}
/* allocate new mbuf for the used descriptor */
while (likely(!virtqueue_full(rxvq))) {
- new_mbuf = rte_
rxmbuf
_alloc(rxvq->mpool);
+ new_mbuf = rte_
mbuf_raw
_alloc(rxvq->mpool);
if (unlikely(new_mbuf == NULL)) {
break;
}
if (unlikely(new_mbuf == NULL)) {
break;
}
@@
-293,7
+284,7
@@
eth_dev_start(struct rte_eth_dev *dev)
dev->data->dev_link.link_status = ETH_LINK_UP;
while (!virtqueue_full(rxvq)) {
dev->data->dev_link.link_status = ETH_LINK_UP;
while (!virtqueue_full(rxvq)) {
- m = rte_
rxmbuf
_alloc(rxvq->mpool);
+ m = rte_
mbuf_raw
_alloc(rxvq->mpool);
if (m == NULL)
break;
/* Enqueue allocated buffers. */
if (m == NULL)
break;
/* Enqueue allocated buffers. */
@@
-663,7
+654,7
@@
eth_dev_xenvirt_create(const char *name, const char *params,
goto err;
/* reserve an ethdev entry */
goto err;
/* reserve an ethdev entry */
- eth_dev = rte_eth_dev_allocate(name
, RTE_ETH_DEV_VIRTUAL
);
+ eth_dev = rte_eth_dev_allocate(name);
if (eth_dev == NULL)
goto err;
if (eth_dev == NULL)
goto err;
@@
-738,7
+729,7
@@
eth_dev_xenvirt_free(const char *name, const unsigned numa_node)
/*TODO: Support multiple process model */
static int
/*TODO: Support multiple process model */
static int
-rte_pmd_xenvirt_
devinit
(const char *name, const char *params)
+rte_pmd_xenvirt_
probe
(const char *name, const char *params)
{
if (virtio_idx == 0) {
if (xenstore_init() != 0) {
{
if (virtio_idx == 0) {
if (xenstore_init() != 0) {
@@
-755,7
+746,7
@@
rte_pmd_xenvirt_devinit(const char *name, const char *params)
}
static int
}
static int
-rte_pmd_xenvirt_
devuninit
(const char *name)
+rte_pmd_xenvirt_
remove
(const char *name)
{
eth_dev_xenvirt_free(name, rte_socket_id());
{
eth_dev_xenvirt_free(name, rte_socket_id());
@@
-768,11
+759,12
@@
rte_pmd_xenvirt_devuninit(const char *name)
return 0;
}
return 0;
}
-static struct rte_driver pmd_xenvirt_drv = {
- .name = "eth_xenvirt",
- .type = PMD_VDEV,
- .init = rte_pmd_xenvirt_devinit,
- .uninit = rte_pmd_xenvirt_devuninit,
+static struct rte_vdev_driver pmd_xenvirt_drv = {
+ .probe = rte_pmd_xenvirt_probe,
+ .remove = rte_pmd_xenvirt_remove,
};
};
-PMD_REGISTER_DRIVER(pmd_xenvirt_drv);
+RTE_PMD_REGISTER_VDEV(net_xenvirt, pmd_xenvirt_drv);
+RTE_PMD_REGISTER_ALIAS(net_xenvirt, eth_xenvirt);
+RTE_PMD_REGISTER_PARAM_STRING(net_xenvirt,
+ "mac=<mac addr>");