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. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4870
This commit is contained in:
parent
ad8a32cb5d
commit
cc62e811f9
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -165,7 +165,7 @@ efx_mcdi_fini_txq(
|
||||
}
|
||||
|
||||
__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 @@ hunt_tx_qcreate(
|
||||
}
|
||||
|
||||
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 @@ hunt_tx_qpio_enable(
|
||||
}
|
||||
|
||||
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 @@ hunt_tx_qpio_write(
|
||||
}
|
||||
|
||||
__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 @@ hunt_tx_qpio_post(
|
||||
}
|
||||
|
||||
__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 @@ hunt_tx_qpost(
|
||||
* 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 @@ hunt_tx_qdesc_post(
|
||||
}
|
||||
|
||||
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 @@ hunt_tx_qpace(
|
||||
}
|
||||
|
||||
__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 @@ hunt_tx_qflush(
|
||||
}
|
||||
|
||||
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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user