Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2016 07:51:23 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r294381 - stable/10/sys/dev/sfxge/common
Message-ID:  <201601200751.u0K7pNKq024691@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Wed Jan 20 07:51:23 2016
New Revision: 294381
URL: https://svnweb.freebsd.org/changeset/base/294381

Log:
  MFC r293891
  
  sfxge: support FATSOv2 in common code
  
  Reviewed by:    gnn
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/hunt_impl.h
  stable/10/sys/dev/sfxge/common/hunt_nic.c
  stable/10/sys/dev/sfxge/common/hunt_tx.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx.h	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/efx.h	Wed Jan 20 07:51:23 2016	(r294381)
@@ -1071,6 +1071,7 @@ efx_bist_stop(
 #define	EFX_FEATURE_TX_SRC_FILTERS	0x00000400
 #define	EFX_FEATURE_PIO_BUFFERS		0x00000800
 #define	EFX_FEATURE_FW_ASSISTED_TSO	0x00001000
+#define	EFX_FEATURE_FW_ASSISTED_TSO_V2	0x00002000
 
 typedef struct efx_nic_cfg_s {
 	uint32_t		enc_board_type;
@@ -1152,6 +1153,7 @@ typedef struct efx_nic_cfg_s {
 	 */
 	uint32_t                enc_tx_tso_tcp_header_offset_limit;
 	boolean_t               enc_fw_assisted_tso_enabled;
+	boolean_t               enc_fw_assisted_tso_v2_enabled;
 	boolean_t               enc_hw_tx_insert_vlan_enabled;
 	/* Datapath firmware vadapter/vport/vswitch support */
 	boolean_t		enc_datapath_cap_evb;
@@ -2002,6 +2004,7 @@ efx_tx_fini(
 
 #define	EFX_TXQ_CKSUM_IPV4	0x0001
 #define	EFX_TXQ_CKSUM_TCPUDP	0x0002
+#define	EFX_TXQ_FATSOV2		0x0004
 
 extern	__checkReturn	efx_rc_t
 efx_tx_qcreate(
@@ -2089,6 +2092,21 @@ efx_tx_qdesc_tso_create(
 	__in	uint8_t  tcp_flags,
 	__out	efx_desc_t *edp);
 
+/* Number of FATSOv2 option descriptors */
+#define	EFX_TX_FATSOV2_OPT_NDESCS		2
+
+/* Maximum number of DMA segments per TSO packet (not superframe) */
+#define	EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX	24
+
+extern	void
+efx_tx_qdesc_tso2_create(
+	__in			efx_txq_t *etp,
+	__in			uint16_t ipv4_id,
+	__in			uint32_t tcp_seq,
+	__in			uint16_t tcp_mss,
+	__out_ecount(count)	efx_desc_t *edp,
+	__in			int count);
+
 extern	void
 efx_tx_qdesc_vlantci_create(
 	__in	efx_txq_t *etp,

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_impl.h	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h	Wed Jan 20 07:51:23 2016	(r294381)
@@ -146,6 +146,9 @@ typedef struct efx_tx_ops_s {
 	void		(*etxo_qdesc_tso_create)(efx_txq_t *, uint16_t,
 						uint32_t, uint8_t,
 						efx_desc_t *);
+	void		(*etxo_qdesc_tso2_create)(efx_txq_t *, uint16_t,
+						uint32_t, uint16_t,
+						efx_desc_t *, int);
 	void		(*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
 						efx_desc_t *);
 #if EFSYS_OPT_QSTATS

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_nic.c	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/efx_nic.c	Wed Jan 20 07:51:23 2016	(r294381)
@@ -381,7 +381,8 @@ efx_nic_create(
 		    EFX_FEATURE_MAC_HEADER_FILTERS |
 		    EFX_FEATURE_MCDI_DMA |
 		    EFX_FEATURE_PIO_BUFFERS |
-		    EFX_FEATURE_FW_ASSISTED_TSO;
+		    EFX_FEATURE_FW_ASSISTED_TSO |
+		    EFX_FEATURE_FW_ASSISTED_TSO_V2;
 		break;
 #endif	/* EFSYS_OPT_HUNTINGTON */
 

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_tx.c	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c	Wed Jan 20 07:51:23 2016	(r294381)
@@ -142,6 +142,7 @@ static efx_tx_ops_t	__efx_tx_falcon_ops 
 	falconsiena_tx_qdesc_post,		/* etxo_qdesc_post */
 	falconsiena_tx_qdesc_dma_create,	/* etxo_qdesc_dma_create */
 	NULL,					/* etxo_qdesc_tso_create */
+	NULL,					/* etxo_qdesc_tso2_create */
 	NULL,					/* etxo_qdesc_vlantci_create */
 #if EFSYS_OPT_QSTATS
 	falconsiena_tx_qstats_update,		/* etxo_qstats_update */
@@ -167,6 +168,7 @@ static efx_tx_ops_t	__efx_tx_siena_ops =
 	falconsiena_tx_qdesc_post,		/* etxo_qdesc_post */
 	falconsiena_tx_qdesc_dma_create,	/* etxo_qdesc_dma_create */
 	NULL,					/* etxo_qdesc_tso_create */
+	NULL,					/* etxo_qdesc_tso2_create */
 	NULL,					/* etxo_qdesc_vlantci_create */
 #if EFSYS_OPT_QSTATS
 	falconsiena_tx_qstats_update,		/* etxo_qstats_update */
@@ -192,6 +194,7 @@ static efx_tx_ops_t	__efx_tx_hunt_ops = 
 	ef10_tx_qdesc_post,			/* etxo_qdesc_post */
 	ef10_tx_qdesc_dma_create,		/* etxo_qdesc_dma_create */
 	hunt_tx_qdesc_tso_create,		/* etxo_qdesc_tso_create */
+	ef10_tx_qdesc_tso2_create,		/* etxo_qdesc_tso2_create */
 	ef10_tx_qdesc_vlantci_create,		/* etxo_qdesc_vlantci_create */
 #if EFSYS_OPT_QSTATS
 	ef10_tx_qstats_update,			/* etxo_qstats_update */
@@ -217,6 +220,7 @@ static efx_tx_ops_t	__efx_tx_medford_ops
 	ef10_tx_qdesc_post,			/* etxo_qdesc_post */
 	ef10_tx_qdesc_dma_create,		/* etxo_qdesc_dma_create */
 	NULL,					/* etxo_qdesc_tso_create */
+	ef10_tx_qdesc_tso2_create,		/* etxo_qdesc_tso2_create */
 	ef10_tx_qdesc_vlantci_create,		/* etxo_qdesc_vlantci_create */
 #if EFSYS_OPT_QSTATS
 	ef10_tx_qstats_update,			/* etxo_qstats_update */
@@ -641,6 +645,24 @@ efx_tx_qdesc_tso_create(
 }
 
 	void
+efx_tx_qdesc_tso2_create(
+	__in			efx_txq_t *etp,
+	__in			uint16_t ipv4_id,
+	__in			uint32_t tcp_seq,
+	__in			uint16_t mss,
+	__out_ecount(count)	efx_desc_t *edp,
+	__in			int count)
+{
+	efx_nic_t *enp = etp->et_enp;
+	efx_tx_ops_t *etxop = enp->en_etxop;
+
+	EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+	EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL);
+
+	etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count);
+}
+
+	void
 efx_tx_qdesc_vlantci_create(
 	__in	efx_txq_t *etp,
 	__in	uint16_t tci,

Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_impl.h	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/hunt_impl.h	Wed Jan 20 07:51:23 2016	(r294381)
@@ -674,6 +674,15 @@ hunt_tx_qdesc_tso_create(
 	__out	efx_desc_t *edp);
 
 extern	void
+ef10_tx_qdesc_tso2_create(
+	__in			efx_txq_t *etp,
+	__in			uint16_t ipv4_id,
+	__in			uint32_t tcp_seq,
+	__in			uint16_t tcp_mss,
+	__out_ecount(count)	efx_desc_t *edp,
+	__in			int count);
+
+extern	void
 ef10_tx_qdesc_vlantci_create(
 	__in	efx_txq_t *etp,
 	__in	uint16_t vlan_tci,

Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_nic.c	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/hunt_nic.c	Wed Jan 20 07:51:23 2016	(r294381)
@@ -920,6 +920,13 @@ ef10_get_datapath_caps(
 	else
 		encp->enc_fw_assisted_tso_enabled = B_FALSE;
 
+	/* Check if the firmware supports FATSOv2 */
+	if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities_v2,
+				GET_CAPABILITIES_V2_OUT_TX_TSO_V2) == 1)
+		encp->enc_fw_assisted_tso_v2_enabled = B_TRUE;
+	else
+		encp->enc_fw_assisted_tso_v2_enabled = B_FALSE;
+
 	/* Check if the firmware has vadapter/vport/vswitch support */
 	if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
 				GET_CAPABILITIES_OUT_EVB) == 1)

Modified: stable/10/sys/dev/sfxge/common/hunt_tx.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_tx.c	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/hunt_tx.c	Wed Jan 20 07:51:23 2016	(r294381)
@@ -87,12 +87,13 @@ efx_mcdi_init_txq(
 	MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
 	MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
 
-	MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS,
+	MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS,
 	    INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
 	    INIT_TXQ_IN_FLAG_IP_CSUM_DIS,
 	    (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1,
 	    INIT_TXQ_IN_FLAG_TCP_CSUM_DIS,
 	    (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1,
+	    INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0,
 	    INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
 	    INIT_TXQ_IN_CRC_MODE, 0,
 	    INIT_TXQ_IN_FLAG_TIMESTAMP, 0);
@@ -589,6 +590,38 @@ hunt_tx_qdesc_tso_create(
 }
 
 	void
+ef10_tx_qdesc_tso2_create(
+	__in			efx_txq_t *etp,
+	__in			uint16_t ipv4_id,
+	__in			uint32_t tcp_seq,
+	__in			uint16_t tcp_mss,
+	__out_ecount(count)	efx_desc_t *edp,
+	__in			int count)
+{
+	EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index,
+		    uint16_t, ipv4_id, uint32_t, tcp_seq,
+		    uint16_t, tcp_mss);
+
+	EFSYS_ASSERT(count >= EFX_TX_FATSOV2_OPT_NDESCS);
+
+	EFX_POPULATE_QWORD_5(edp[0].ed_eq,
+			    ESF_DZ_TX_DESC_IS_OPT, 1,
+			    ESF_DZ_TX_OPTION_TYPE,
+			    ESE_DZ_TX_OPTION_DESC_TSO,
+			    ESF_DZ_TX_TSO_OPTION_TYPE,
+			    ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A,
+			    ESF_DZ_TX_TSO_IP_ID, ipv4_id,
+			    ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq);
+	EFX_POPULATE_QWORD_4(edp[1].ed_eq,
+			    ESF_DZ_TX_DESC_IS_OPT, 1,
+			    ESF_DZ_TX_OPTION_TYPE,
+			    ESE_DZ_TX_OPTION_DESC_TSO,
+			    ESF_DZ_TX_TSO_OPTION_TYPE,
+			    ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B,
+			    ESF_DZ_TX_TSO_TCP_MSS, tcp_mss);
+}
+
+	void
 ef10_tx_qdesc_vlantci_create(
 	__in	efx_txq_t *etp,
 	__in	uint16_t  tci,

Modified: stable/10/sys/dev/sfxge/common/siena_nic.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/siena_nic.c	Wed Jan 20 07:50:00 2016	(r294380)
+++ stable/10/sys/dev/sfxge/common/siena_nic.c	Wed Jan 20 07:51:23 2016	(r294381)
@@ -169,6 +169,7 @@ siena_board_cfg(
 
 	encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
 	encp->enc_fw_assisted_tso_enabled = B_FALSE;
+	encp->enc_fw_assisted_tso_v2_enabled = B_FALSE;
 	encp->enc_allow_set_mac_with_installed_filters = B_TRUE;
 
 	return (0);



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