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
remove extra parentheses in return statement
[dpdk.git]
/
examples
/
vhost
/
main.c
diff --git
a/examples/vhost/main.c
b/examples/vhost/main.c
index
dc3a012
..
73564f0
100644
(file)
--- a/
examples/vhost/main.c
+++ b/
examples/vhost/main.c
@@
-1,7
+1,7
@@
/*-
* BSD LICENSE
*
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-201
4
Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-201
5
Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@
-53,7
+53,9
@@
#include "main.h"
#include "main.h"
-#define MAX_QUEUES 512
+#ifndef MAX_QUEUES
+#define MAX_QUEUES 128
+#endif
/* the maximum number of external ports supported */
#define MAX_SUP_PORTS 1
/* the maximum number of external ports supported */
#define MAX_SUP_PORTS 1
@@
-909,7
+911,7
@@
gpa_to_hpa(struct vhost_dev *vdev, uint64_t guest_pa,
static inline int __attribute__((always_inline))
ether_addr_cmp(struct ether_addr *ea, struct ether_addr *eb)
{
static inline int __attribute__((always_inline))
ether_addr_cmp(struct ether_addr *ea, struct ether_addr *eb)
{
- return ((
(*(uint64_t *)ea ^ *(uint64_t *)eb) & MAC_ADDR_CMP) == 0)
;
+ return ((
*(uint64_t *)ea ^ *(uint64_t *)eb) & MAC_ADDR_CMP) == 0
;
}
/*
}
/*
@@
-1449,7
+1451,8
@@
attach_rxmbuf_zcp(struct virtio_net *dev)
uint64_t buff_addr, phys_addr;
struct vhost_virtqueue *vq;
struct vring_desc *desc;
uint64_t buff_addr, phys_addr;
struct vhost_virtqueue *vq;
struct vring_desc *desc;
- struct rte_mbuf *mbuf = NULL;
+ void *obj = NULL;
+ struct rte_mbuf *mbuf;
struct vpool *vpool;
hpa_type addr_type;
struct vhost_dev *vdev = (struct vhost_dev *)dev->priv;
struct vpool *vpool;
hpa_type addr_type;
struct vhost_dev *vdev = (struct vhost_dev *)dev->priv;
@@
-1500,7
+1503,8
@@
attach_rxmbuf_zcp(struct virtio_net *dev)
}
} while (unlikely(phys_addr == 0));
}
} while (unlikely(phys_addr == 0));
- rte_ring_sc_dequeue(vpool->ring, (void **)&mbuf);
+ rte_ring_sc_dequeue(vpool->ring, &obj);
+ mbuf = obj;
if (unlikely(mbuf == NULL)) {
LOG_DEBUG(VHOST_DATA,
"(%"PRIu64") in attach_rxmbuf_zcp: "
if (unlikely(mbuf == NULL)) {
LOG_DEBUG(VHOST_DATA,
"(%"PRIu64") in attach_rxmbuf_zcp: "
@@
-1517,7
+1521,7
@@
attach_rxmbuf_zcp(struct virtio_net *dev)
"size required: %d\n",
dev->device_fh, desc->len, desc_idx, vpool->buf_size);
put_desc_to_used_list_zcp(vq, desc_idx);
"size required: %d\n",
dev->device_fh, desc->len, desc_idx, vpool->buf_size);
put_desc_to_used_list_zcp(vq, desc_idx);
- rte_ring_sp_enqueue(vpool->ring,
(void *)mbuf
);
+ rte_ring_sp_enqueue(vpool->ring,
obj
);
return;
}
return;
}
@@
-1789,7
+1793,8
@@
virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,
{
struct mbuf_table *tx_q;
struct rte_mbuf **m_table;
{
struct mbuf_table *tx_q;
struct rte_mbuf **m_table;
- struct rte_mbuf *mbuf = NULL;
+ void *obj = NULL;
+ struct rte_mbuf *mbuf;
unsigned len, ret, offset = 0;
struct vpool *vpool;
uint16_t vlan_tag = (uint16_t)vlan_tags[(uint16_t)dev->device_fh];
unsigned len, ret, offset = 0;
struct vpool *vpool;
uint16_t vlan_tag = (uint16_t)vlan_tags[(uint16_t)dev->device_fh];
@@
-1801,7
+1806,8
@@
virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,
/* Allocate an mbuf and populate the structure. */
vpool = &vpool_array[MAX_QUEUES + vmdq_rx_q];
/* Allocate an mbuf and populate the structure. */
vpool = &vpool_array[MAX_QUEUES + vmdq_rx_q];
- rte_ring_sc_dequeue(vpool->ring, (void **)&mbuf);
+ rte_ring_sc_dequeue(vpool->ring, &obj);
+ mbuf = obj;
if (unlikely(mbuf == NULL)) {
struct vhost_virtqueue *vq = dev->virtqueue[VIRTIO_TXQ];
RTE_LOG(ERR, VHOST_DATA,
if (unlikely(mbuf == NULL)) {
struct vhost_virtqueue *vq = dev->virtqueue[VIRTIO_TXQ];
RTE_LOG(ERR, VHOST_DATA,
@@
-2275,7
+2281,7
@@
alloc_data_ll(uint32_t size)
}
ll_new[i].next = NULL;
}
ll_new[i].next = NULL;
- return
(ll_new)
;
+ return
ll_new
;
}
/*
}
/*