Author: np
Date: Thu Mar 26 18:45:51 2015
New Revision: 280706
URL: https://svnweb.freebsd.org/changeset/base/280706

Log:
  cxgbe(4): provide the exact RSS hash type instead of a catch-all value
  to the upper layers.

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c Thu Mar 26 18:44:59 2015        (r280705)
+++ head/sys/dev/cxgbe/t4_sge.c Thu Mar 26 18:45:51 2015        (r280706)
@@ -1736,6 +1736,12 @@ t4_eth_rx(struct sge_iq *iq, const struc
 #if defined(INET) || defined(INET6)
        struct lro_ctrl *lro = &rxq->lro;
 #endif
+       static const int sw_hashtype[4][2] = {
+               {M_HASHTYPE_NONE, M_HASHTYPE_NONE},
+               {M_HASHTYPE_RSS_IPV4, M_HASHTYPE_RSS_IPV6},
+               {M_HASHTYPE_RSS_TCP_IPV4, M_HASHTYPE_RSS_TCP_IPV6},
+               {M_HASHTYPE_RSS_UDP_IPV4, M_HASHTYPE_RSS_UDP_IPV6},
+       };
 
        KASSERT(m0 != NULL, ("%s: no payload with opcode %02x", __func__,
            rss->opcode));
@@ -1745,7 +1751,7 @@ t4_eth_rx(struct sge_iq *iq, const struc
        m0->m_data += fl_pktshift;
 
        m0->m_pkthdr.rcvif = ifp;
-       M_HASHTYPE_SET(m0, M_HASHTYPE_OPAQUE);
+       M_HASHTYPE_SET(m0, sw_hashtype[rss->hash_type][rss->ipv6]);
        m0->m_pkthdr.flowid = be32toh(rss->hash_val);
 
        if (cpl->csum_calc && !cpl->err_vec) {
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to