Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sfxge/common/efx_tx.c
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | falconsiena_tx_qstats_update( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__inout_ecount(TX_NQSTATS) efsys_stat_t *stat); | __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); | ||||
#endif | #endif | ||||
#endif /* EFSYS_OPT_SIENA */ | #endif /* EFSYS_OPT_SIENA */ | ||||
#if EFSYS_OPT_SIENA | #if EFSYS_OPT_SIENA | ||||
static efx_tx_ops_t __efx_tx_siena_ops = { | static const efx_tx_ops_t __efx_tx_siena_ops = { | ||||
falconsiena_tx_init, /* etxo_init */ | falconsiena_tx_init, /* etxo_init */ | ||||
falconsiena_tx_fini, /* etxo_fini */ | falconsiena_tx_fini, /* etxo_fini */ | ||||
falconsiena_tx_qcreate, /* etxo_qcreate */ | falconsiena_tx_qcreate, /* etxo_qcreate */ | ||||
falconsiena_tx_qdestroy, /* etxo_qdestroy */ | falconsiena_tx_qdestroy, /* etxo_qdestroy */ | ||||
falconsiena_tx_qpost, /* etxo_qpost */ | falconsiena_tx_qpost, /* etxo_qpost */ | ||||
falconsiena_tx_qpush, /* etxo_qpush */ | falconsiena_tx_qpush, /* etxo_qpush */ | ||||
falconsiena_tx_qpace, /* etxo_qpace */ | falconsiena_tx_qpace, /* etxo_qpace */ | ||||
falconsiena_tx_qflush, /* etxo_qflush */ | falconsiena_tx_qflush, /* etxo_qflush */ | ||||
Show All 9 Lines | static const efx_tx_ops_t __efx_tx_siena_ops = { | ||||
NULL, /* etxo_qdesc_vlantci_create */ | NULL, /* etxo_qdesc_vlantci_create */ | ||||
#if EFSYS_OPT_QSTATS | #if EFSYS_OPT_QSTATS | ||||
falconsiena_tx_qstats_update, /* etxo_qstats_update */ | falconsiena_tx_qstats_update, /* etxo_qstats_update */ | ||||
#endif | #endif | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_SIENA */ | #endif /* EFSYS_OPT_SIENA */ | ||||
#if EFSYS_OPT_HUNTINGTON | #if EFSYS_OPT_HUNTINGTON | ||||
static efx_tx_ops_t __efx_tx_hunt_ops = { | static const efx_tx_ops_t __efx_tx_hunt_ops = { | ||||
ef10_tx_init, /* etxo_init */ | ef10_tx_init, /* etxo_init */ | ||||
ef10_tx_fini, /* etxo_fini */ | ef10_tx_fini, /* etxo_fini */ | ||||
ef10_tx_qcreate, /* etxo_qcreate */ | ef10_tx_qcreate, /* etxo_qcreate */ | ||||
ef10_tx_qdestroy, /* etxo_qdestroy */ | ef10_tx_qdestroy, /* etxo_qdestroy */ | ||||
ef10_tx_qpost, /* etxo_qpost */ | ef10_tx_qpost, /* etxo_qpost */ | ||||
ef10_tx_qpush, /* etxo_qpush */ | ef10_tx_qpush, /* etxo_qpush */ | ||||
ef10_tx_qpace, /* etxo_qpace */ | ef10_tx_qpace, /* etxo_qpace */ | ||||
ef10_tx_qflush, /* etxo_qflush */ | ef10_tx_qflush, /* etxo_qflush */ | ||||
Show All 9 Lines | static const efx_tx_ops_t __efx_tx_hunt_ops = { | ||||
ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ | ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ | ||||
#if EFSYS_OPT_QSTATS | #if EFSYS_OPT_QSTATS | ||||
ef10_tx_qstats_update, /* etxo_qstats_update */ | ef10_tx_qstats_update, /* etxo_qstats_update */ | ||||
#endif | #endif | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_HUNTINGTON */ | #endif /* EFSYS_OPT_HUNTINGTON */ | ||||
#if EFSYS_OPT_MEDFORD | #if EFSYS_OPT_MEDFORD | ||||
static efx_tx_ops_t __efx_tx_medford_ops = { | static const efx_tx_ops_t __efx_tx_medford_ops = { | ||||
ef10_tx_init, /* etxo_init */ | ef10_tx_init, /* etxo_init */ | ||||
ef10_tx_fini, /* etxo_fini */ | ef10_tx_fini, /* etxo_fini */ | ||||
ef10_tx_qcreate, /* etxo_qcreate */ | ef10_tx_qcreate, /* etxo_qcreate */ | ||||
ef10_tx_qdestroy, /* etxo_qdestroy */ | ef10_tx_qdestroy, /* etxo_qdestroy */ | ||||
ef10_tx_qpost, /* etxo_qpost */ | ef10_tx_qpost, /* etxo_qpost */ | ||||
ef10_tx_qpush, /* etxo_qpush */ | ef10_tx_qpush, /* etxo_qpush */ | ||||
ef10_tx_qpace, /* etxo_qpace */ | ef10_tx_qpace, /* etxo_qpace */ | ||||
ef10_tx_qflush, /* etxo_qflush */ | ef10_tx_qflush, /* etxo_qflush */ | ||||
Show All 12 Lines | |||||
#endif | #endif | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_MEDFORD */ | #endif /* EFSYS_OPT_MEDFORD */ | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_init( | efx_tx_init( | ||||
__in efx_nic_t *enp) | __in efx_nic_t *enp) | ||||
{ | { | ||||
efx_tx_ops_t *etxop; | const efx_tx_ops_t *etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | ||||
if (!(enp->en_mod_flags & EFX_MOD_EV)) { | if (!(enp->en_mod_flags & EFX_MOD_EV)) { | ||||
rc = EINVAL; | rc = EINVAL; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
if (enp->en_mod_flags & EFX_MOD_TX) { | if (enp->en_mod_flags & EFX_MOD_TX) { | ||||
rc = EINVAL; | rc = EINVAL; | ||||
goto fail2; | goto fail2; | ||||
} | } | ||||
switch (enp->en_family) { | switch (enp->en_family) { | ||||
#if EFSYS_OPT_SIENA | #if EFSYS_OPT_SIENA | ||||
case EFX_FAMILY_SIENA: | case EFX_FAMILY_SIENA: | ||||
etxop = (efx_tx_ops_t *)&__efx_tx_siena_ops; | etxop = &__efx_tx_siena_ops; | ||||
break; | break; | ||||
#endif /* EFSYS_OPT_SIENA */ | #endif /* EFSYS_OPT_SIENA */ | ||||
#if EFSYS_OPT_HUNTINGTON | #if EFSYS_OPT_HUNTINGTON | ||||
case EFX_FAMILY_HUNTINGTON: | case EFX_FAMILY_HUNTINGTON: | ||||
etxop = (efx_tx_ops_t *)&__efx_tx_hunt_ops; | etxop = &__efx_tx_hunt_ops; | ||||
break; | break; | ||||
#endif /* EFSYS_OPT_HUNTINGTON */ | #endif /* EFSYS_OPT_HUNTINGTON */ | ||||
#if EFSYS_OPT_MEDFORD | #if EFSYS_OPT_MEDFORD | ||||
case EFX_FAMILY_MEDFORD: | case EFX_FAMILY_MEDFORD: | ||||
etxop = (efx_tx_ops_t *)&__efx_tx_medford_ops; | etxop = &__efx_tx_medford_ops; | ||||
break; | break; | ||||
#endif /* EFSYS_OPT_MEDFORD */ | #endif /* EFSYS_OPT_MEDFORD */ | ||||
default: | default: | ||||
EFSYS_ASSERT(0); | EFSYS_ASSERT(0); | ||||
rc = ENOTSUP; | rc = ENOTSUP; | ||||
goto fail3; | goto fail3; | ||||
} | } | ||||
Show All 20 Lines | fail1: | ||||
enp->en_mod_flags &= ~EFX_MOD_TX; | enp->en_mod_flags &= ~EFX_MOD_TX; | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_tx_fini( | efx_tx_fini( | ||||
__in efx_nic_t *enp) | __in efx_nic_t *enp) | ||||
{ | { | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); | ||||
EFSYS_ASSERT3U(enp->en_tx_qcount, ==, 0); | EFSYS_ASSERT3U(enp->en_tx_qcount, ==, 0); | ||||
etxop->etxo_fini(enp); | etxop->etxo_fini(enp); | ||||
Show All 9 Lines | efx_tx_qcreate( | ||||
__in efsys_mem_t *esmp, | __in efsys_mem_t *esmp, | ||||
__in size_t n, | __in size_t n, | ||||
__in uint32_t id, | __in uint32_t id, | ||||
__in uint16_t flags, | __in uint16_t flags, | ||||
__in efx_evq_t *eep, | __in efx_evq_t *eep, | ||||
__deref_out efx_txq_t **etpp, | __deref_out efx_txq_t **etpp, | ||||
__out unsigned int *addedp) | __out unsigned int *addedp) | ||||
{ | { | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | ||||
efx_txq_t *etp; | efx_txq_t *etp; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); | ||||
EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); | EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); | ||||
Show All 32 Lines | fail1: | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_tx_qdestroy( | efx_tx_qdestroy( | ||||
__in efx_txq_t *etp) | __in efx_txq_t *etp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
EFSYS_ASSERT(enp->en_tx_qcount != 0); | EFSYS_ASSERT(enp->en_tx_qcount != 0); | ||||
--enp->en_tx_qcount; | --enp->en_tx_qcount; | ||||
etxop->etxo_qdestroy(etp); | etxop->etxo_qdestroy(etp); | ||||
/* Free the TXQ object */ | /* Free the TXQ object */ | ||||
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp); | EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp); | ||||
} | } | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_qpost( | efx_tx_qpost( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in_ecount(n) efx_buffer_t *eb, | __in_ecount(n) efx_buffer_t *eb, | ||||
__in unsigned int n, | __in unsigned int n, | ||||
__in unsigned int completed, | __in unsigned int completed, | ||||
__inout unsigned int *addedp) | __inout unsigned int *addedp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if ((rc = etxop->etxo_qpost(etp, eb, | if ((rc = etxop->etxo_qpost(etp, eb, | ||||
n, completed, addedp)) != 0) | n, completed, addedp)) != 0) | ||||
goto fail1; | goto fail1; | ||||
return (0); | return (0); | ||||
fail1: | fail1: | ||||
EFSYS_PROBE1(fail1, efx_rc_t, rc); | EFSYS_PROBE1(fail1, efx_rc_t, rc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_tx_qpush( | efx_tx_qpush( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in unsigned int added, | __in unsigned int added, | ||||
__in unsigned int pushed) | __in unsigned int pushed) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
etxop->etxo_qpush(etp, added, pushed); | etxop->etxo_qpush(etp, added, pushed); | ||||
} | } | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_qpace( | efx_tx_qpace( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in unsigned int ns) | __in unsigned int ns) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if ((rc = etxop->etxo_qpace(etp, ns)) != 0) | if ((rc = etxop->etxo_qpace(etp, ns)) != 0) | ||||
goto fail1; | goto fail1; | ||||
return (0); | return (0); | ||||
fail1: | fail1: | ||||
EFSYS_PROBE1(fail1, efx_rc_t, rc); | EFSYS_PROBE1(fail1, efx_rc_t, rc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_qflush( | efx_tx_qflush( | ||||
__in efx_txq_t *etp) | __in efx_txq_t *etp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if ((rc = etxop->etxo_qflush(etp)) != 0) | if ((rc = etxop->etxo_qflush(etp)) != 0) | ||||
goto fail1; | goto fail1; | ||||
return (0); | return (0); | ||||
fail1: | fail1: | ||||
EFSYS_PROBE1(fail1, efx_rc_t, rc); | EFSYS_PROBE1(fail1, efx_rc_t, rc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_tx_qenable( | efx_tx_qenable( | ||||
__in efx_txq_t *etp) | __in efx_txq_t *etp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
etxop->etxo_qenable(etp); | etxop->etxo_qenable(etp); | ||||
} | } | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_qpio_enable( | efx_tx_qpio_enable( | ||||
__in efx_txq_t *etp) | __in efx_txq_t *etp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if (~enp->en_features & EFX_FEATURE_PIO_BUFFERS) { | if (~enp->en_features & EFX_FEATURE_PIO_BUFFERS) { | ||||
rc = ENOTSUP; | rc = ENOTSUP; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
Show All 15 Lines | fail1: | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_tx_qpio_disable( | efx_tx_qpio_disable( | ||||
__in efx_txq_t *etp) | __in efx_txq_t *etp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if (etxop->etxo_qpio_disable != NULL) | if (etxop->etxo_qpio_disable != NULL) | ||||
etxop->etxo_qpio_disable(etp); | etxop->etxo_qpio_disable(etp); | ||||
} | } | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_qpio_write( | efx_tx_qpio_write( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in_ecount(buf_length) uint8_t *buffer, | __in_ecount(buf_length) uint8_t *buffer, | ||||
__in size_t buf_length, | __in size_t buf_length, | ||||
__in size_t pio_buf_offset) | __in size_t pio_buf_offset) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if (etxop->etxo_qpio_write != NULL) { | if (etxop->etxo_qpio_write != NULL) { | ||||
if ((rc = etxop->etxo_qpio_write(etp, buffer, buf_length, | if ((rc = etxop->etxo_qpio_write(etp, buffer, buf_length, | ||||
pio_buf_offset)) != 0) | pio_buf_offset)) != 0) | ||||
goto fail1; | goto fail1; | ||||
Show All 10 Lines | fail1: | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_tx_qpio_post( | efx_tx_qpio_post( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in size_t pkt_length, | __in size_t pkt_length, | ||||
__in unsigned int completed, | __in unsigned int completed, | ||||
__inout unsigned int *addedp) | __inout unsigned int *addedp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if (etxop->etxo_qpio_post != NULL) { | if (etxop->etxo_qpio_post != NULL) { | ||||
if ((rc = etxop->etxo_qpio_post(etp, pkt_length, completed, | if ((rc = etxop->etxo_qpio_post(etp, pkt_length, completed, | ||||
addedp)) != 0) | addedp)) != 0) | ||||
goto fail1; | goto fail1; | ||||
Show All 11 Lines | |||||
efx_tx_qdesc_post( | efx_tx_qdesc_post( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in_ecount(n) efx_desc_t *ed, | __in_ecount(n) efx_desc_t *ed, | ||||
__in unsigned int n, | __in unsigned int n, | ||||
__in unsigned int completed, | __in unsigned int completed, | ||||
__inout unsigned int *addedp) | __inout unsigned int *addedp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
if ((rc = etxop->etxo_qdesc_post(etp, ed, | if ((rc = etxop->etxo_qdesc_post(etp, ed, | ||||
n, completed, addedp)) != 0) | n, completed, addedp)) != 0) | ||||
goto fail1; | goto fail1; | ||||
return (0); | return (0); | ||||
fail1: | fail1: | ||||
EFSYS_PROBE1(fail1, efx_rc_t, rc); | EFSYS_PROBE1(fail1, efx_rc_t, rc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_tx_qdesc_dma_create( | efx_tx_qdesc_dma_create( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in efsys_dma_addr_t addr, | __in efsys_dma_addr_t addr, | ||||
__in size_t size, | __in size_t size, | ||||
__in boolean_t eop, | __in boolean_t eop, | ||||
__out efx_desc_t *edp) | __out efx_desc_t *edp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
EFSYS_ASSERT(etxop->etxo_qdesc_dma_create != NULL); | EFSYS_ASSERT(etxop->etxo_qdesc_dma_create != NULL); | ||||
etxop->etxo_qdesc_dma_create(etp, addr, size, eop, edp); | etxop->etxo_qdesc_dma_create(etp, addr, size, eop, edp); | ||||
} | } | ||||
void | void | ||||
efx_tx_qdesc_tso_create( | efx_tx_qdesc_tso_create( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in uint16_t ipv4_id, | __in uint16_t ipv4_id, | ||||
__in uint32_t tcp_seq, | __in uint32_t tcp_seq, | ||||
__in uint8_t tcp_flags, | __in uint8_t tcp_flags, | ||||
__out efx_desc_t *edp) | __out efx_desc_t *edp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
EFSYS_ASSERT(etxop->etxo_qdesc_tso_create != NULL); | EFSYS_ASSERT(etxop->etxo_qdesc_tso_create != NULL); | ||||
etxop->etxo_qdesc_tso_create(etp, ipv4_id, tcp_seq, tcp_flags, edp); | etxop->etxo_qdesc_tso_create(etp, ipv4_id, tcp_seq, tcp_flags, edp); | ||||
} | } | ||||
void | void | ||||
efx_tx_qdesc_tso2_create( | efx_tx_qdesc_tso2_create( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in uint16_t ipv4_id, | __in uint16_t ipv4_id, | ||||
__in uint32_t tcp_seq, | __in uint32_t tcp_seq, | ||||
__in uint16_t mss, | __in uint16_t mss, | ||||
__out_ecount(count) efx_desc_t *edp, | __out_ecount(count) efx_desc_t *edp, | ||||
__in int count) | __in int count) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL); | EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL); | ||||
etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count); | etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count); | ||||
} | } | ||||
void | void | ||||
efx_tx_qdesc_vlantci_create( | efx_tx_qdesc_vlantci_create( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__in uint16_t tci, | __in uint16_t tci, | ||||
__out efx_desc_t *edp) | __out efx_desc_t *edp) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
EFSYS_ASSERT(etxop->etxo_qdesc_vlantci_create != NULL); | EFSYS_ASSERT(etxop->etxo_qdesc_vlantci_create != NULL); | ||||
etxop->etxo_qdesc_vlantci_create(etp, tci, edp); | etxop->etxo_qdesc_vlantci_create(etp, tci, edp); | ||||
} | } | ||||
#if EFSYS_OPT_QSTATS | #if EFSYS_OPT_QSTATS | ||||
void | void | ||||
efx_tx_qstats_update( | efx_tx_qstats_update( | ||||
__in efx_txq_t *etp, | __in efx_txq_t *etp, | ||||
__inout_ecount(TX_NQSTATS) efsys_stat_t *stat) | __inout_ecount(TX_NQSTATS) efsys_stat_t *stat) | ||||
{ | { | ||||
efx_nic_t *enp = etp->et_enp; | efx_nic_t *enp = etp->et_enp; | ||||
efx_tx_ops_t *etxop = enp->en_etxop; | const efx_tx_ops_t *etxop = enp->en_etxop; | ||||
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); | ||||
etxop->etxo_qstats_update(etp, stat); | etxop->etxo_qstats_update(etp, stat); | ||||
} | } | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 427 Lines • Show Last 20 Lines |