[dpdk-dev] usvhost interface dropping packets
Srinivasreddy R
srinivasreddy4390 at gmail.com
Thu Mar 26 16:01:05 CET 2015
hi,
I am using usvhost interfaces for VM to VM communication with ovdk Version
1.2 .
when i am sending packets form one VM to another using PacketGen , i
observed packet drop .
the reason for this is , when packets are send in burst on vhost interface
it checks for the free entries in vhost_virtqueue .if the free enteries are
not available it retries and waits for some time . then the ovdk drops the
packets .
my question is :
How can i avoid packet drop .
i tried increasing retries and delay . it helped in reducing the loss but
not completely .
is there any solution for avoiding the drop . i have observed drop even at
a very less traffic .
am i missing any thing .
how can i proceed further .
the code part is :
FILE : *rte_port_vhost.c*
static inline uint32_t __attribute__((always_inline))
pf_vhost_enqueue_burst(struct virtio_net *dev, struct rte_mbuf **pkts,
unsigned count)
{
struct vhost_virtqueue *vq;
struct vring_desc *desc;
MODULE_DBG_LOG( "(%"PRIu64") virtio_dev_rx()\n", dev->device_fh);
vq = dev->virtqueue[VIRTIO_RXQ];
count = (count > PKT_BURST_SIZE) ? PKT_BURST_SIZE : count;
/* As many data cores may want access to available buffers, they need
to be reserved. */
do {
res_base_idx = vq->last_used_idx_res;
avail_idx = *((volatile uint16_t *)&vq->avail->idx);
free_entries = (avail_idx - res_base_idx);
/* If retry is enabled and the queue is full then we wait and retry
to avoid packet loss. */
if (unlikely(count > free_entries)) {
for (retry = 0; retry < g_burst_tx_retry_num; retry++) {
rte_delay_us(g_burst_tx_delay_time);
avail_idx =
*((volatile uint16_t *)&vq->avail->idx);
free_entries = (avail_idx - res_base_idx);
if (count <= free_entries)
break;
}
}
----------
thanks
srinivas.
More information about the dev
mailing list