Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2018 17:18:34 +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-12@freebsd.org
Subject:   svn commit: r342348 - stable/12/sys/dev/sfxge/common
Message-ID:  <201812211718.wBLHIYa9007537@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Fri Dec 21 17:18:33 2018
New Revision: 342348
URL: https://svnweb.freebsd.org/changeset/base/342348

Log:
  MFC r341038
  
  sfxge(4): add method to make checksum option descriptors
  
  Submitted by:   Mark Spender <mspender at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18160

Modified:
  stable/12/sys/dev/sfxge/common/ef10_impl.h
  stable/12/sys/dev/sfxge/common/ef10_tx.c
  stable/12/sys/dev/sfxge/common/efx.h
  stable/12/sys/dev/sfxge/common/efx_impl.h
  stable/12/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sfxge/common/ef10_impl.h
==============================================================================
--- stable/12/sys/dev/sfxge/common/ef10_impl.h	Fri Dec 21 17:12:05 2018	(r342347)
+++ stable/12/sys/dev/sfxge/common/ef10_impl.h	Fri Dec 21 17:18:33 2018	(r342348)
@@ -759,6 +759,11 @@ ef10_tx_qdesc_vlantci_create(
 	__in	uint16_t vlan_tci,
 	__out	efx_desc_t *edp);
 
+extern	void
+ef10_tx_qdesc_checksum_create(
+	__in	efx_txq_t *etp,
+	__in	uint16_t flags,
+	__out	efx_desc_t *edp);
 
 #if EFSYS_OPT_QSTATS
 

Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/ef10_tx.c	Fri Dec 21 17:12:05 2018	(r342347)
+++ stable/12/sys/dev/sfxge/common/ef10_tx.c	Fri Dec 21 17:18:33 2018	(r342348)
@@ -201,7 +201,7 @@ ef10_tx_qcreate(
 {
 	efx_nic_cfg_t *encp = &enp->en_nic_cfg;
 	uint16_t inner_csum;
-	efx_qword_t desc;
+	efx_desc_t desc;
 	efx_rc_t rc;
 
 	_NOTE(ARGUNUSED(id))
@@ -226,19 +226,9 @@ ef10_tx_qcreate(
 	 * a no-op TX option descriptor. See bug29981 for details.
 	 */
 	*addedp = 1;
-	EFX_POPULATE_QWORD_6(desc,
-	    ESF_DZ_TX_DESC_IS_OPT, 1,
-	    ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
-	    ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
-	    (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
-	    ESF_DZ_TX_OPTION_IP_CSUM,
-	    (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
-	    ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
-	    (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
-	    ESF_DZ_TX_OPTION_INNER_IP_CSUM,
-	    (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
+	ef10_tx_qdesc_checksum_create(etp, flags, &desc);
 
-	EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
+	EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc.ed_eq);
 	ef10_tx_qpush(etp, *addedp, 0);
 
 	return (0);
@@ -700,6 +690,30 @@ ef10_tx_qdesc_vlantci_create(
 			    ESE_DZ_TX_OPTION_DESC_VLAN,
 			    ESF_DZ_TX_VLAN_OP, tci ? 1 : 0,
 			    ESF_DZ_TX_VLAN_TAG1, tci);
+}
+
+	void
+ef10_tx_qdesc_checksum_create(
+	__in	efx_txq_t *etp,
+	__in	uint16_t flags,
+	__out	efx_desc_t *edp)
+{
+	_NOTE(ARGUNUSED(etp));
+
+	EFSYS_PROBE2(tx_desc_checksum_create, unsigned int, etp->et_index,
+		    uint32_t, flags);
+
+	EFX_POPULATE_QWORD_6(edp->ed_eq,
+	    ESF_DZ_TX_DESC_IS_OPT, 1,
+	    ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
+	    ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
+	    (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
+	    ESF_DZ_TX_OPTION_IP_CSUM,
+	    (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
+	    ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
+	    (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
+	    ESF_DZ_TX_OPTION_INNER_IP_CSUM,
+	    (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
 }
 
 

Modified: stable/12/sys/dev/sfxge/common/efx.h
==============================================================================
--- stable/12/sys/dev/sfxge/common/efx.h	Fri Dec 21 17:12:05 2018	(r342347)
+++ stable/12/sys/dev/sfxge/common/efx.h	Fri Dec 21 17:18:33 2018	(r342348)
@@ -2112,6 +2112,12 @@ efx_tx_qdesc_vlantci_create(
 	__in	uint16_t tci,
 	__out	efx_desc_t *edp);
 
+extern	void
+efx_tx_qdesc_checksum_create(
+	__in	efx_txq_t *etp,
+	__in	uint16_t flags,
+	__out	efx_desc_t *edp);
+
 #if EFSYS_OPT_QSTATS
 
 #if EFSYS_OPT_NAMES

Modified: stable/12/sys/dev/sfxge/common/efx_impl.h
==============================================================================
--- stable/12/sys/dev/sfxge/common/efx_impl.h	Fri Dec 21 17:12:05 2018	(r342347)
+++ stable/12/sys/dev/sfxge/common/efx_impl.h	Fri Dec 21 17:18:33 2018	(r342348)
@@ -143,6 +143,8 @@ typedef struct efx_tx_ops_s {
 						efx_desc_t *, int);
 	void		(*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
 						efx_desc_t *);
+	void		(*etxo_qdesc_checksum_create)(efx_txq_t *, uint16_t,
+						efx_desc_t *);
 #if EFSYS_OPT_QSTATS
 	void		(*etxo_qstats_update)(efx_txq_t *,
 					      efsys_stat_t *);

Modified: stable/12/sys/dev/sfxge/common/efx_tx.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/efx_tx.c	Fri Dec 21 17:12:05 2018	(r342347)
+++ stable/12/sys/dev/sfxge/common/efx_tx.c	Fri Dec 21 17:18:33 2018	(r342348)
@@ -146,6 +146,7 @@ static const efx_tx_ops_t	__efx_tx_siena_ops = {
 	NULL,					/* etxo_qdesc_tso_create */
 	NULL,					/* etxo_qdesc_tso2_create */
 	NULL,					/* etxo_qdesc_vlantci_create */
+	NULL,					/* etxo_qdesc_checksum_create */
 #if EFSYS_OPT_QSTATS
 	siena_tx_qstats_update,			/* etxo_qstats_update */
 #endif
@@ -172,6 +173,7 @@ static const efx_tx_ops_t	__efx_tx_hunt_ops = {
 	ef10_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 */
+	ef10_tx_qdesc_checksum_create,		/* etxo_qdesc_checksum_create */
 #if EFSYS_OPT_QSTATS
 	ef10_tx_qstats_update,			/* etxo_qstats_update */
 #endif
@@ -198,6 +200,7 @@ static const efx_tx_ops_t	__efx_tx_medford_ops = {
 	NULL,					/* etxo_qdesc_tso_create */
 	ef10_tx_qdesc_tso2_create,		/* etxo_qdesc_tso2_create */
 	ef10_tx_qdesc_vlantci_create,		/* etxo_qdesc_vlantci_create */
+	ef10_tx_qdesc_checksum_create,		/* etxo_qdesc_checksum_create */
 #if EFSYS_OPT_QSTATS
 	ef10_tx_qstats_update,			/* etxo_qstats_update */
 #endif
@@ -645,6 +648,21 @@ efx_tx_qdesc_vlantci_create(
 	EFSYS_ASSERT(etxop->etxo_qdesc_vlantci_create != NULL);
 
 	etxop->etxo_qdesc_vlantci_create(etp, tci, edp);
+}
+
+	void
+efx_tx_qdesc_checksum_create(
+	__in	efx_txq_t *etp,
+	__in	uint16_t flags,
+	__out	efx_desc_t *edp)
+{
+	efx_nic_t *enp = etp->et_enp;
+	const efx_tx_ops_t *etxop = enp->en_etxop;
+
+	EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+	EFSYS_ASSERT(etxop->etxo_qdesc_checksum_create != NULL);
+
+	etxop->etxo_qdesc_checksum_create(etp, flags, edp);
 }
 
 



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