svn commit: r340830 - head/sys/dev/sfxge/common

Andrew Rybchenko arybchik at FreeBSD.org
Fri Nov 23 11:39:19 UTC 2018


Author: arybchik
Date: Fri Nov 23 11:39:13 2018
New Revision: 340830
URL: https://svnweb.freebsd.org/changeset/base/340830

Log:
  sfxge(4): enforce packed stream fake buffer size
  
  In the case of packed stream real size of the buffer does not fit in
  Rx descriptor byte count. Real size is specified on Rx queue setup.
  Non-zero fake should be used to bypass hardware checks.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18100

Modified:
  head/sys/dev/sfxge/common/ef10_rx.c
  head/sys/dev/sfxge/common/efx.h

Modified: head/sys/dev/sfxge/common/ef10_rx.c
==============================================================================
--- head/sys/dev/sfxge/common/ef10_rx.c	Fri Nov 23 11:39:02 2018	(r340829)
+++ head/sys/dev/sfxge/common/ef10_rx.c	Fri Nov 23 11:39:13 2018	(r340830)
@@ -710,6 +710,14 @@ ef10_rx_prefix_hash(
 }
 #endif /* EFSYS_OPT_RX_SCALE */
 
+#if EFSYS_OPT_RX_PACKED_STREAM
+/*
+ * Fake length for RXQ descriptors in packed stream mode
+ * to make hardware happy
+ */
+#define	EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32
+#endif
+
 			void
 ef10_rx_qpost(
 	__in		efx_rxq_t *erp,
@@ -723,6 +731,15 @@ ef10_rx_qpost(
 	unsigned int i;
 	unsigned int offset;
 	unsigned int id;
+
+#if EFSYS_OPT_RX_PACKED_STREAM
+	/*
+	 * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT
+	 * and equal to 0 after applying mask. Hardware does not like it.
+	 */
+	if (erp->er_ev_qstate->eers_rx_packed_stream)
+		size = EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE;
+#endif
 
 	/* The client driver must not overfill the queue */
 	EFSYS_ASSERT3U(added - completed + n, <=,

Modified: head/sys/dev/sfxge/common/efx.h
==============================================================================
--- head/sys/dev/sfxge/common/efx.h	Fri Nov 23 11:39:02 2018	(r340829)
+++ head/sys/dev/sfxge/common/efx.h	Fri Nov 23 11:39:13 2018	(r340830)
@@ -2050,12 +2050,6 @@ efx_rx_qpush(
 
 #if EFSYS_OPT_RX_PACKED_STREAM
 
-/*
- * Fake length for RXQ descriptors in packed stream mode
- * to make hardware happy
- */
-#define	EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32
-
 extern			void
 efx_rx_qpush_ps_credits(
 	__in		efx_rxq_t *erp);


More information about the svn-src-head mailing list