On Wed, Jun 10, 2015 at 03:13:21PM +0000, Daniele Di Proietto wrote:
> 
> 
> On 10/06/2015 12:48, "Gray, Mark D" <mark.d.g...@intel.com> wrote:
> >
> >The vhost port won't generate an RSS hash because it is a virtual NIC.
> >
> >> 
> >
> >> It doesn't cause a problem, just make the pkt fall into a slow path,
> >>should we
> >
> >> fix it?
> 
> Thanks for investigating this.  We should definitely fix it.
> 
> >
> >> The flag ol_flags may be useful for OVS or let DPDK fix this in vhost
> >>rcv.
> >
> >
> >
> >How do you propose that this would work? The RSS would still have to be
> >
> >generated in software.
> >
> >> 
> 
> A simple solution would be to reset the RSS hash inside
> netdev_dpdk_vhost_rxq_recv().  Other netdev providers that do not support
> reading the RSS hash (netdev-linux, netdev-bsd) call
> dp_packet_set_rss_hash(pkt, 0) on every received packet.
> 
> This would probably have a small impact on performance, but it's better
> than trashing the exact match cache.
> 
> I don't believe there's anything that DPDK can do here (like resetting the
> hash when the packet is freed), but please correct me if I'm wrong.
> 
> Thoughts?

I think Dongjun is right and we should use ol_flags.
Something like this:

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index e4c2593..ad315d1 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -518,7 +518,12 @@ static inline uint32_t
 dp_packet_get_rss_hash(struct dp_packet *p)
 {
 #ifdef DPDK_NETDEV
-    return p->mbuf.hash.rss;
+    if (p->mbuf.ol_flags & PKT_RX_RSS_HASH) {
+        return p->mbuf.hash.rss;
+    }
+    else {
+        return 0;
+    }
 #else
     return p->rss_hash;
 #endif


I haven't tested that but rte_vhost_dequeue_burst() does
ol_flags = 0, so this would be a generic solution for all
dpdk devices.

Thoughts?

fbl

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to