jme: Let the software to check hardware supplied hash
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 22 Aug 2012 01:23:09 +0000 (09:23 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 22 Aug 2012 01:27:32 +0000 (09:27 +0800)
As far as I have tested, these chips could generate wrong hash under
certain situation.

sys/dev/netif/jme/if_jme.c

index acf872d..06b43bf 100644 (file)
@@ -2290,8 +2290,9 @@ jme_rxpkt(struct jme_rxdata *rdata)
                                pi = NULL;
 
                        if (pi != NULL &&
                                pi = NULL;
 
                        if (pi != NULL &&
-                           (hashinfo & JME_RD_HASH_FN_MASK) != 0) {
-                               m->m_flags |= M_HASH;
+                           (hashinfo & JME_RD_HASH_FN_MASK) ==
+                           JME_RD_HASH_FN_TOEPLITZ) {
+                               m->m_flags |= (M_HASH | M_CKHASH);
                                m->m_pkthdr.hash = toeplitz_hash(hash);
                        }
 
                                m->m_pkthdr.hash = toeplitz_hash(hash);
                        }