Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Mar 2017 13:54:18 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315243 - head/sys/dev/bnxt
Message-ID:  <201703141354.v2EDsIFu066104@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Tue Mar 14 13:54:18 2017
New Revision: 315243
URL: https://svnweb.freebsd.org/changeset/base/315243

Log:
  Restore changes for RSS routing improvements made in 314369 that were
  reverted in the IFLIB update I made in 315217.
  
  Submitted by:	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

Modified:
  head/sys/dev/bnxt/bnxt_txrx.c

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==============================================================================
--- head/sys/dev/bnxt/bnxt_txrx.c	Tue Mar 14 12:39:19 2017	(r315242)
+++ head/sys/dev/bnxt/bnxt_txrx.c	Tue Mar 14 13:54:18 2017	(r315243)
@@ -426,6 +426,37 @@ cmpl_invalid:
 	return avail;
 }
 
+static void
+bnxt_set_rsstype(if_rxd_info_t ri, uint8_t rss_hash_type)
+{
+	uint8_t rss_profile_id;
+
+	rss_profile_id = BNXT_GET_RSS_PROFILE_ID(rss_hash_type);
+	switch (rss_profile_id) {
+	case BNXT_RSS_HASH_TYPE_TCPV4:
+		ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4;
+		break;
+	case BNXT_RSS_HASH_TYPE_UDPV4:
+		ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV4;
+		break;
+	case BNXT_RSS_HASH_TYPE_IPV4:
+		ri->iri_rsstype = M_HASHTYPE_RSS_IPV4;
+		break;
+	case BNXT_RSS_HASH_TYPE_TCPV6:
+		ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6;
+		break;
+	case BNXT_RSS_HASH_TYPE_UDPV6:
+		ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV6;
+		break;
+	case BNXT_RSS_HASH_TYPE_IPV6:
+		ri->iri_rsstype = M_HASHTYPE_RSS_IPV6;
+		break;
+	default:
+		ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+		break;
+	}
+}
+
 static int
 bnxt_pkt_get_l2(struct bnxt_softc *softc, if_rxd_info_t ri,
     struct bnxt_cp_ring *cpr, uint16_t flags_type)
@@ -443,13 +474,7 @@ bnxt_pkt_get_l2(struct bnxt_softc *softc
 	/* Extract from the first 16-byte BD */
 	if (flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID) {
 		ri->iri_flowid = le32toh(rcp->rss_hash);
-		/*
-		 * TODO: Extract something useful from rcp->rss_hash_type
-		 * (undocumented)
-		 * May be documented in the "LSI ES"
-		 * also check the firmware code.
-		 */
-		ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+		bnxt_set_rsstype(ri, rcp->rss_hash_type);
 	}
 	else {
 		ri->iri_rsstype = M_HASHTYPE_NONE;
@@ -529,13 +554,7 @@ bnxt_pkt_get_tpa(struct bnxt_softc *soft
 	/* Extract from the first 16-byte BD */
 	if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) {
 		ri->iri_flowid = le32toh(tpas->low.rss_hash);
-		/*
-		 * TODO: Extract something useful from tpas->low.rss_hash_type
-		 * (undocumented)
-		 * May be documented in the "LSI ES"
-		 * also check the firmware code.
-		 */
-		ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+		bnxt_set_rsstype(ri, tpas->low.rss_hash_type);
 	}
 	else {
 		ri->iri_rsstype = M_HASHTYPE_NONE;



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