Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2015 18:45:52 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280706 - head/sys/dev/cxgbe
Message-ID:  <201503261845.t2QIjqvw024172@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503261845.t2QIjqvw024172>