Partial MFC r281838:

For igb(4), when we are doing multiqueue, we are all setup to have full 32bit
RSS hash from the card. Expose that so others like lagg(4) can use that and
avoid hashing the traffic by themselves. Setting hashtype as OPAQUE because
FreeBSD 10 doesn't have RSS support.

Sponsored by:	Limelight Networks
This commit is contained in:
hiren 2015-05-13 07:39:16 +00:00
parent 4215c2f123
commit 1db2d82647

View File

@ -4970,10 +4970,27 @@ igb_rxeof(struct igb_queue *que, int count, int *done)
rxr->fmp->m_pkthdr.ether_vtag = vtag;
rxr->fmp->m_flags |= M_VLANTAG;
}
/*
* In case of multiqueue, we have RXCSUM.PCSD bit set
* and never cleared. This means we have RSS hash
* available to be used.
*/
if (adapter->num_queues > 1) {
rxr->fmp->m_pkthdr.flowid =
le32toh(cur->wb.lower.hi_dword.rss);
/*
* Full RSS support is not avilable in
* FreeBSD 10 so setting the hash type to
* OPAQUE.
*/
M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_OPAQUE);
} else {
#ifndef IGB_LEGACY_TX
rxr->fmp->m_pkthdr.flowid = que->msix;
M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_OPAQUE);
rxr->fmp->m_pkthdr.flowid = que->msix;
M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_OPAQUE);
#endif
}
sendmp = rxr->fmp;
/* Make sure to set M_PKTHDR. */
sendmp->m_flags |= M_PKTHDR;