Expose full 32bit RSS hash from card regardless of whether RSS is defined or
not. When doing multiqueue, we are all setup to have full 32bit RSS hash from the card. We do not need to hide that under "ifdef RSS" and should expose that by default so others like lagg(4) can use that and avoid hashing the traffic by themselves. While here, delete the FreeBSD version check and use of deprecated M_FLOWID. Reviewed by: adrian, erj MFC after: 1 week Sponsored by: Limelight Networks
This commit is contained in:
parent
c7dbd80213
commit
df7b11fa09
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285528
@ -1910,53 +1910,60 @@ ixgbe_rxeof(struct ix_queue *que)
|
||||
}
|
||||
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
|
||||
ixgbe_rx_checksum(staterr, sendmp, ptype);
|
||||
#if __FreeBSD_version >= 800000
|
||||
#ifdef RSS
|
||||
sendmp->m_pkthdr.flowid =
|
||||
le32toh(cur->wb.lower.hi_dword.rss);
|
||||
#if __FreeBSD_version < 1100054
|
||||
sendmp->m_flags |= M_FLOWID;
|
||||
#endif
|
||||
switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV4);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV4:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV4);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6_EX);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6_EX);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV4_UDP:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV4);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_UDP:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6_EX);
|
||||
break;
|
||||
default:
|
||||
|
||||
/*
|
||||
* 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) {
|
||||
sendmp->m_pkthdr.flowid =
|
||||
le32toh(cur->wb.lower.hi_dword.rss);
|
||||
switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_TCP_IPV4);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV4:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_IPV4);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_TCP_IPV6);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_IPV6_EX);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_IPV6);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_TCP_IPV6_EX);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV4_UDP:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_UDP_IPV4);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_UDP:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_UDP_IPV6);
|
||||
break;
|
||||
case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_RSS_UDP_IPV6_EX);
|
||||
break;
|
||||
default:
|
||||
M_HASHTYPE_SET(sendmp,
|
||||
M_HASHTYPE_OPAQUE);
|
||||
}
|
||||
} else {
|
||||
sendmp->m_pkthdr.flowid = que->msix;
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE);
|
||||
}
|
||||
#else /* RSS */
|
||||
sendmp->m_pkthdr.flowid = que->msix;
|
||||
#if __FreeBSD_version >= 1100054
|
||||
M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE);
|
||||
#else
|
||||
sendmp->m_flags |= M_FLOWID;
|
||||
#endif
|
||||
#endif /* RSS */
|
||||
#endif /* FreeBSD_version */
|
||||
}
|
||||
next_desc:
|
||||
bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
|
||||
|
Loading…
Reference in New Issue
Block a user