A vhost device, being a virtual interface, doesn't provide a valid RSS
hash. As a workaround we set the value to 0, which suggests the
datapath to recompute the hash in software.
Reported-by: Dongjun <dongj@dtdream.com>
CC: Traynor, Kevin <kevin.traynor@intel.com>
CC: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
struct virtio_net *virtio_dev = netdev_dpdk_get_virtio(vhost_dev);
int qid = 1;
uint16_t nb_rx = 0;
+ uint16_t i;
if (OVS_UNLIKELY(!is_vhost_running(virtio_dev))) {
return EAGAIN;
return EAGAIN;
}
+ /* Vhost doesn't provide a valid RSS hash. We tell the datapath to
+ * compute the hash in software by setting the field to 0. This is
+ * a temporary workaround until we can rely on mbuf ol_flags
+ * PKT_RX_RSS_HASH. */
+ for (i = 0; i < nb_rx; i++) {
+ dp_packet_set_rss_hash(packets[i], 0);
+ }
+
rte_spinlock_lock(&vhost_dev->stats_lock);
vhost_dev->stats.rx_packets += (uint64_t)nb_rx;
rte_spinlock_unlock(&vhost_dev->stats_lock);