Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 15:59:08 +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: r293987 - stable/10/sys/dev/sfxge/common
Message-ID:  <201601141559.u0EFx8cI053436@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Thu Jan 14 15:59:08 2016
New Revision: 293987
URL: https://svnweb.freebsd.org/changeset/base/293987

Log:
  MFC r293753
  
  sfxge: rename hunt TX methods to ef10 and use for Medford
  
  Rename all except hunt_tx_qdesc_tso_create(), which creates a
  fw-assisted TSO v1 descriptor which isn't supported on Medford.
  
  Submitted by:   Mark Spender <mspender at solarflare.com>
  Reviewed by:    gnn
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  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_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_tx.c	Thu Jan 14 15:58:30 2016	(r293986)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c	Thu Jan 14 15:59:08 2016	(r293987)
@@ -179,29 +179,54 @@ static efx_tx_ops_t	__efx_tx_siena_ops =
 
 #if EFSYS_OPT_HUNTINGTON
 static efx_tx_ops_t	__efx_tx_hunt_ops = {
-	hunt_tx_init,				/* etxo_init */
-	hunt_tx_fini,				/* etxo_fini */
-	hunt_tx_qcreate,			/* etxo_qcreate */
-	hunt_tx_qdestroy,			/* etxo_qdestroy */
-	hunt_tx_qpost,				/* etxo_qpost */
-	hunt_tx_qpush,				/* etxo_qpush */
-	hunt_tx_qpace,				/* etxo_qpace */
-	hunt_tx_qflush,				/* etxo_qflush */
-	hunt_tx_qenable,			/* etxo_qenable */
-	hunt_tx_qpio_enable,			/* etxo_qpio_enable */
-	hunt_tx_qpio_disable,			/* etxo_qpio_disable */
-	hunt_tx_qpio_write,			/* etxo_qpio_write */
-	hunt_tx_qpio_post,			/* etxo_qpio_post */
-	hunt_tx_qdesc_post,			/* etxo_qdesc_post */
-	hunt_tx_qdesc_dma_create,		/* etxo_qdesc_dma_create */
+	ef10_tx_init,				/* etxo_init */
+	ef10_tx_fini,				/* etxo_fini */
+	ef10_tx_qcreate,			/* etxo_qcreate */
+	ef10_tx_qdestroy,			/* etxo_qdestroy */
+	ef10_tx_qpost,				/* etxo_qpost */
+	ef10_tx_qpush,				/* etxo_qpush */
+	ef10_tx_qpace,				/* etxo_qpace */
+	ef10_tx_qflush,				/* etxo_qflush */
+	ef10_tx_qenable,			/* etxo_qenable */
+	ef10_tx_qpio_enable,			/* etxo_qpio_enable */
+	ef10_tx_qpio_disable,			/* etxo_qpio_disable */
+	ef10_tx_qpio_write,			/* etxo_qpio_write */
+	ef10_tx_qpio_post,			/* etxo_qpio_post */
+	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 */
-	hunt_tx_qdesc_vlantci_create,		/* etxo_qdesc_vlantci_create */
+	ef10_tx_qdesc_vlantci_create,		/* etxo_qdesc_vlantci_create */
 #if EFSYS_OPT_QSTATS
-	hunt_tx_qstats_update,			/* etxo_qstats_update */
+	ef10_tx_qstats_update,			/* etxo_qstats_update */
 #endif
 };
 #endif /* EFSYS_OPT_HUNTINGTON */
 
+#if EFSYS_OPT_MEDFORD
+static efx_tx_ops_t	__efx_tx_medford_ops = {
+	ef10_tx_init,				/* etxo_init */
+	ef10_tx_fini,				/* etxo_fini */
+	ef10_tx_qcreate,			/* etxo_qcreate */
+	ef10_tx_qdestroy,			/* etxo_qdestroy */
+	ef10_tx_qpost,				/* etxo_qpost */
+	ef10_tx_qpush,				/* etxo_qpush */
+	ef10_tx_qpace,				/* etxo_qpace */
+	ef10_tx_qflush,				/* etxo_qflush */
+	ef10_tx_qenable,			/* etxo_qenable */
+	ef10_tx_qpio_enable,			/* etxo_qpio_enable */
+	ef10_tx_qpio_disable,			/* etxo_qpio_disable */
+	ef10_tx_qpio_write,			/* etxo_qpio_write */
+	ef10_tx_qpio_post,			/* etxo_qpio_post */
+	ef10_tx_qdesc_post,			/* etxo_qdesc_post */
+	ef10_tx_qdesc_dma_create,		/* etxo_qdesc_dma_create */
+	NULL,					/* etxo_qdesc_tso_create */
+	ef10_tx_qdesc_vlantci_create,		/* etxo_qdesc_vlantci_create */
+#if EFSYS_OPT_QSTATS
+	ef10_tx_qstats_update,			/* etxo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_MEDFORD */
+
 	__checkReturn	efx_rc_t
 efx_tx_init(
 	__in		efx_nic_t *enp)
@@ -241,6 +266,12 @@ efx_tx_init(
 		break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
+#if EFSYS_OPT_MEDFORD
+	case EFX_FAMILY_MEDFORD:
+		etxop = (efx_tx_ops_t *)&__efx_tx_medford_ops;
+		break;
+#endif /* EFSYS_OPT_MEDFORD */
+
 	default:
 		EFSYS_ASSERT(0);
 		rc = ENOTSUP;

Modified: stable/10/sys/dev/sfxge/common/hunt_impl.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_impl.h	Thu Jan 14 15:58:30 2016	(r293986)
+++ stable/10/sys/dev/sfxge/common/hunt_impl.h	Thu Jan 14 15:59:08 2016	(r293987)
@@ -572,15 +572,15 @@ ef10_sram_test(
 /* TX */
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_init(
+ef10_tx_init(
 	__in		efx_nic_t *enp);
 
 extern			void
-hunt_tx_fini(
+ef10_tx_fini(
 	__in		efx_nic_t *enp);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qcreate(
+ef10_tx_qcreate(
 	__in		efx_nic_t *enp,
 	__in		unsigned int index,
 	__in		unsigned int label,
@@ -593,11 +593,11 @@ hunt_tx_qcreate(
 	__out		unsigned int *addedp);
 
 extern		void
-hunt_tx_qdestroy(
+ef10_tx_qdestroy(
 	__in		efx_txq_t *etp);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qpost(
+ef10_tx_qpost(
 	__in		efx_txq_t *etp,
 	__in_ecount(n)	efx_buffer_t *eb,
 	__in		unsigned int n,
@@ -605,48 +605,48 @@ hunt_tx_qpost(
 	__inout		unsigned int *addedp);
 
 extern			void
-hunt_tx_qpush(
+ef10_tx_qpush(
 	__in		efx_txq_t *etp,
 	__in		unsigned int added,
 	__in		unsigned int pushed);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qpace(
+ef10_tx_qpace(
 	__in		efx_txq_t *etp,
 	__in		unsigned int ns);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qflush(
+ef10_tx_qflush(
 	__in		efx_txq_t *etp);
 
 extern			void
-hunt_tx_qenable(
+ef10_tx_qenable(
 	__in		efx_txq_t *etp);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qpio_enable(
+ef10_tx_qpio_enable(
 	__in		efx_txq_t *etp);
 
 extern			void
-hunt_tx_qpio_disable(
+ef10_tx_qpio_disable(
 	__in		efx_txq_t *etp);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qpio_write(
+ef10_tx_qpio_write(
 	__in			efx_txq_t *etp,
 	__in_ecount(buf_length)	uint8_t *buffer,
 	__in			size_t buf_length,
 	__in                    size_t pio_buf_offset);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qpio_post(
+ef10_tx_qpio_post(
 	__in			efx_txq_t *etp,
 	__in			size_t pkt_length,
 	__in			unsigned int completed,
 	__inout			unsigned int *addedp);
 
 extern	__checkReturn	efx_rc_t
-hunt_tx_qdesc_post(
+ef10_tx_qdesc_post(
 	__in		efx_txq_t *etp,
 	__in_ecount(n)	efx_desc_t *ed,
 	__in		unsigned int n,
@@ -654,7 +654,7 @@ hunt_tx_qdesc_post(
 	__inout		unsigned int *addedp);
 
 extern	void
-hunt_tx_qdesc_dma_create(
+ef10_tx_qdesc_dma_create(
 	__in	efx_txq_t *etp,
 	__in	efsys_dma_addr_t addr,
 	__in	size_t size,
@@ -670,7 +670,7 @@ hunt_tx_qdesc_tso_create(
 	__out	efx_desc_t *edp);
 
 extern	void
-hunt_tx_qdesc_vlantci_create(
+ef10_tx_qdesc_vlantci_create(
 	__in	efx_txq_t *etp,
 	__in	uint16_t vlan_tci,
 	__out	efx_desc_t *edp);
@@ -679,7 +679,7 @@ hunt_tx_qdesc_vlantci_create(
 #if EFSYS_OPT_QSTATS
 
 extern			void
-hunt_tx_qstats_update(
+ef10_tx_qstats_update(
 	__in				efx_txq_t *etp,
 	__inout_ecount(TX_NQSTATS)	efsys_stat_t *stat);
 

Modified: stable/10/sys/dev/sfxge/common/hunt_tx.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_tx.c	Thu Jan 14 15:58:30 2016	(r293986)
+++ stable/10/sys/dev/sfxge/common/hunt_tx.c	Thu Jan 14 15:59:08 2016	(r293987)
@@ -165,7 +165,7 @@ fail1:
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_init(
+ef10_tx_init(
 	__in		efx_nic_t *enp)
 {
 	_NOTE(ARGUNUSED(enp))
@@ -173,14 +173,14 @@ hunt_tx_init(
 }
 
 			void
-hunt_tx_fini(
+ef10_tx_fini(
 	__in		efx_nic_t *enp)
 {
 	_NOTE(ARGUNUSED(enp))
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qcreate(
+ef10_tx_qcreate(
 	__in		efx_nic_t *enp,
 	__in		unsigned int index,
 	__in		unsigned int label,
@@ -218,7 +218,7 @@ hunt_tx_qcreate(
 	    (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0);
 
 	EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
-	hunt_tx_qpush(etp, *addedp, 0);
+	ef10_tx_qpush(etp, *addedp, 0);
 
 	return (0);
 
@@ -229,7 +229,7 @@ fail1:
 }
 
 		void
-hunt_tx_qdestroy(
+ef10_tx_qdestroy(
 	__in	efx_txq_t *etp)
 {
 	/* FIXME */
@@ -238,7 +238,7 @@ hunt_tx_qdestroy(
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qpio_enable(
+ef10_tx_qpio_enable(
 	__in		efx_txq_t *etp)
 {
 	efx_nic_t *enp = etp->et_enp;
@@ -294,7 +294,7 @@ fail1:
 }
 
 			void
-hunt_tx_qpio_disable(
+ef10_tx_qpio_disable(
 	__in		efx_txq_t *etp)
 {
 	efx_nic_t *enp = etp->et_enp;
@@ -311,7 +311,7 @@ hunt_tx_qpio_disable(
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qpio_write(
+ef10_tx_qpio_write(
 	__in			efx_txq_t *etp,
 	__in_ecount(length)	uint8_t *buffer,
 	__in			size_t length,
@@ -359,7 +359,7 @@ fail1:
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qpio_post(
+ef10_tx_qpio_post(
 	__in			efx_txq_t *etp,
 	__in			size_t pkt_length,
 	__in			unsigned int completed,
@@ -412,7 +412,7 @@ fail1:
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qpost(
+ef10_tx_qpost(
 	__in		efx_txq_t *etp,
 	__in_ecount(n)	efx_buffer_t *eb,
 	__in		unsigned int n,
@@ -474,7 +474,7 @@ fail1:
  * hardware decides not to use the pushed descriptor.
  */
 			void
-hunt_tx_qpush(
+ef10_tx_qpush(
 	__in		efx_txq_t *etp,
 	__in		unsigned int added,
 	__in		unsigned int pushed)
@@ -504,7 +504,7 @@ hunt_tx_qpush(
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qdesc_post(
+ef10_tx_qdesc_post(
 	__in		efx_txq_t *etp,
 	__in_ecount(n)	efx_desc_t *ed,
 	__in		unsigned int n,
@@ -546,7 +546,7 @@ fail1:
 }
 
 	void
-hunt_tx_qdesc_dma_create(
+ef10_tx_qdesc_dma_create(
 	__in	efx_txq_t *etp,
 	__in	efsys_dma_addr_t addr,
 	__in	size_t size,
@@ -590,7 +590,7 @@ hunt_tx_qdesc_tso_create(
 }
 
 	void
-hunt_tx_qdesc_vlantci_create(
+ef10_tx_qdesc_vlantci_create(
 	__in	efx_txq_t *etp,
 	__in	uint16_t  tci,
 	__out	efx_desc_t *edp)
@@ -608,7 +608,7 @@ hunt_tx_qdesc_vlantci_create(
 
 
 	__checkReturn	efx_rc_t
-hunt_tx_qpace(
+ef10_tx_qpace(
 	__in		efx_txq_t *etp,
 	__in		unsigned int ns)
 {
@@ -631,7 +631,7 @@ fail1:
 }
 
 	__checkReturn	efx_rc_t
-hunt_tx_qflush(
+ef10_tx_qflush(
 	__in		efx_txq_t *etp)
 {
 	efx_nic_t *enp = etp->et_enp;
@@ -649,7 +649,7 @@ fail1:
 }
 
 			void
-hunt_tx_qenable(
+ef10_tx_qenable(
 	__in		efx_txq_t *etp)
 {
 	/* FIXME */
@@ -659,15 +659,10 @@ hunt_tx_qenable(
 
 #if EFSYS_OPT_QSTATS
 			void
-hunt_tx_qstats_update(
+ef10_tx_qstats_update(
 	__in				efx_txq_t *etp,
 	__inout_ecount(TX_NQSTATS)	efsys_stat_t *stat)
 {
-	/*
-	 * TBD: Consider a common Siena/Huntington function.  The code is
-	 * essentially identical.
-	 */
-
 	unsigned int id;
 
 	for (id = 0; id < TX_NQSTATS; id++) {



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