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

Andrew Rybchenko arybchik at FreeBSD.org
Sat Nov 24 18:13:36 UTC 2018


Author: arybchik
Date: Sat Nov 24 18:13:34 2018
New Revision: 340908
URL: https://svnweb.freebsd.org/changeset/base/340908

Log:
  sfxge(4): allow to request inner classes for Rx packets
  
  If HW/FW supports tunnel encapsulations, Rx event may contain
  either inner or outer packet classes. By default outer classes
  are requested. Make it possible to request inner classes to
  have more information about packet type and allow to interpret
  inner frame checksum validation results correctly.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18133

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	Sat Nov 24 18:13:21 2018	(r340907)
+++ head/sys/dev/sfxge/common/ef10_rx.c	Sat Nov 24 18:13:34 2018	(r340908)
@@ -47,6 +47,7 @@ efx_mcdi_init_rxq(
 	__in		uint32_t instance,
 	__in		efsys_mem_t *esmp,
 	__in		boolean_t disable_scatter,
+	__in		boolean_t want_inner_classes,
 	__in		uint32_t ps_bufsize)
 {
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
@@ -68,7 +69,8 @@ efx_mcdi_init_rxq(
 	else
 		dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET;
 
-	if (encp->enc_tunnel_encapsulations_supported != 0) {
+	if (encp->enc_tunnel_encapsulations_supported != 0 &&
+	    !want_inner_classes) {
 		/*
 		 * WANT_OUTER_CLASSES can only be specified on hardware which
 		 * supports tunnel encapsulation offloads, even though it is
@@ -962,6 +964,7 @@ ef10_rx_qcreate(
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_rc_t rc;
 	boolean_t disable_scatter;
+	boolean_t want_inner_classes;
 	unsigned int ps_buf_size;
 
 	_NOTE(ARGUNUSED(id, erp, type_data))
@@ -1040,8 +1043,14 @@ ef10_rx_qcreate(
 	else
 		disable_scatter = encp->enc_rx_disable_scatter_supported;
 
+	if (flags & EFX_RXQ_FLAG_INNER_CLASSES)
+		want_inner_classes = B_TRUE;
+	else
+		want_inner_classes = B_FALSE;
+
 	if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index,
-		    esmp, disable_scatter, ps_buf_size)) != 0)
+		    esmp, disable_scatter, want_inner_classes,
+		    ps_buf_size)) != 0)
 		goto fail7;
 
 	erp->er_eep = eep;

Modified: head/sys/dev/sfxge/common/efx.h
==============================================================================
--- head/sys/dev/sfxge/common/efx.h	Sat Nov 24 18:13:21 2018	(r340907)
+++ head/sys/dev/sfxge/common/efx.h	Sat Nov 24 18:13:34 2018	(r340908)
@@ -2016,6 +2016,15 @@ typedef enum efx_rxq_type_e {
  */
 #define	EFX_RXQ_FLAG_NONE		0x0
 #define	EFX_RXQ_FLAG_SCATTER		0x1
+/*
+ * If tunnels are supported and Rx event can provide information about
+ * either outer or inner packet classes (e.g. SFN8xxx adapters with
+ * full-feature firmware variant running), outer classes are requested by
+ * default. However, if the driver supports tunnels, the flag allows to
+ * request inner classes which are required to be able to interpret inner
+ * Rx checksum offload results.
+ */
+#define	EFX_RXQ_FLAG_INNER_CLASSES	0x2
 
 extern	__checkReturn	efx_rc_t
 efx_rx_qcreate(


More information about the svn-src-all mailing list