svn commit: r277088 - head/sys/dev/ixl

Jack F Vogel jfv at FreeBSD.org
Mon Jan 12 20:59:08 UTC 2015


Author: jfv
Date: Mon Jan 12 20:59:07 2015
New Revision: 277088
URL: https://svnweb.freebsd.org/changeset/base/277088

Log:
  Missing RSS support added, this fixes the build, but the code
  in the RX side was complicated by recent changes and will need
  some further tweaking.

Modified:
  head/sys/dev/ixl/ixl_txrx.c

Modified: head/sys/dev/ixl/ixl_txrx.c
==============================================================================
--- head/sys/dev/ixl/ixl_txrx.c	Mon Jan 12 20:27:06 2015	(r277087)
+++ head/sys/dev/ixl/ixl_txrx.c	Mon Jan 12 20:59:07 2015	(r277088)
@@ -65,14 +65,33 @@ ixl_mq_start(struct ifnet *ifp, struct m
 	struct ixl_queue	*que;
 	struct tx_ring		*txr;
 	int 			err, i;
+#ifdef RSS
+	u32			bucket_id;
+#endif
 
-	/* Which queue to use */
-	if ((m->m_flags & M_FLOWID) != 0)
-		i = m->m_pkthdr.flowid % vsi->num_queues;
-	else
+	/*
+	** Which queue to use:
+	**
+	** When doing RSS, map it to the same outbound
+	** queue as the incoming flow would be mapped to.
+	** If everything is setup correctly, it should be
+	** the same bucket that the current CPU we're on is.
+	*/
+	if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
+#ifdef  RSS
+		if (rss_hash2bucket(m->m_pkthdr.flowid,
+		    M_HASHTYPE_GET(m), &bucket_id) == 0) {
+			i = bucket_id % vsi->num_queues;
+                } else
+#endif
+                        i = m->m_pkthdr.flowid % vsi->num_queues;
+        } else
 		i = curcpu % vsi->num_queues;
-
-	/* Check for a hung queue and pick alternative */
+	/*
+	** This may not be perfect, but until something
+	** better comes along it will keep from scheduling
+	** on stalled queues.
+	*/
 	if (((1 << i) & vsi->active_queues) == 0)
 		i = ffsl(vsi->active_queues);
 
@@ -1542,8 +1561,11 @@ ixl_rxeof(struct ixl_queue *que, int cou
 			rxr->bytes += sendmp->m_pkthdr.len;
 			if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
 				ixl_rx_checksum(sendmp, status, error, ptype);
+#ifdef RSS
+		/* XXX Work in Progress, fix the build for now */
+#endif
 			sendmp->m_pkthdr.flowid = que->msix;
-			sendmp->m_flags |= M_FLOWID;
+			M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE);
 		}
 next_desc:
 		bus_dmamap_sync(rxr->dma.tag, rxr->dma.map,


More information about the svn-src-all mailing list