From: Wei li Date: Thu, 25 Jun 2015 09:45:08 +0000 (-0700) Subject: netdev-dpdk: Do not flush tx queue which is shared among CPUs since it is always... X-Git-Tag: v2.4.0~66 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=4062928f7efcc6d0d3bc27b434a34503f084c63a netdev-dpdk: Do not flush tx queue which is shared among CPUs since it is always flushed When tx queue is shared among CPUS,the pkts always be flush in 'netdev_dpdk_eth_send'. So it is unnecessarily for flushing in netdev_dpdk_rxq_recv Otherwise tx will be accessed without locking. Signed-off-by: Wei li Acked-by: Daniele Di Proietto Acked-by: Pravin B Shelar --- diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 3af1ee788..97689dd3d 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -928,8 +928,11 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets, int nb_rx; /* There is only one tx queue for this core. Do not flush other - * queueus. */ - if (rxq_->queue_id == rte_lcore_id()) { + * queues. + * Do not flush tx queue which is shared among CPUs + * since it is always flushed */ + if (rxq_->queue_id == rte_lcore_id() && + OVS_LIKELY(!dev->txq_needs_locking)) { dpdk_queue_flush(dev, rxq_->queue_id); }