X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fsfc_efx%2Fbase%2Fefx_ev.c;h=99a7743edbd2d89f9a3048b67464ddd2b64f426f;hb=798672850cfc68615b305a720f3638e643e2de2e;hp=4d11c531ce55469dab7bd6f9deb569b226742030;hpb=2e5819a523281dabb2f893da8e8eb999cd145395;p=dpdk.git diff --git a/drivers/common/sfc_efx/base/efx_ev.c b/drivers/common/sfc_efx/base/efx_ev.c index 4d11c531ce..99a7743edb 100644 --- a/drivers/common/sfc_efx/base/efx_ev.c +++ b/drivers/common/sfc_efx/base/efx_ev.c @@ -109,6 +109,22 @@ static const efx_ev_ops_t __efx_ev_ef10_ops = { }; #endif /* EFX_OPTS_EF10() */ +#if EFSYS_OPT_RIVERHEAD +static const efx_ev_ops_t __efx_ev_rhead_ops = { + rhead_ev_init, /* eevo_init */ + rhead_ev_fini, /* eevo_fini */ + rhead_ev_qcreate, /* eevo_qcreate */ + rhead_ev_qdestroy, /* eevo_qdestroy */ + rhead_ev_qprime, /* eevo_qprime */ + rhead_ev_qpost, /* eevo_qpost */ + rhead_ev_qpoll, /* eevo_qpoll */ + rhead_ev_qmoderate, /* eevo_qmoderate */ +#if EFSYS_OPT_QSTATS + rhead_ev_qstats_update, /* eevo_qstats_update */ +#endif +}; +#endif /* EFSYS_OPT_RIVERHEAD */ + __checkReturn efx_rc_t efx_ev_init( @@ -150,6 +166,12 @@ efx_ev_init( break; #endif /* EFSYS_OPT_MEDFORD2 */ +#if EFSYS_OPT_RIVERHEAD + case EFX_FAMILY_RIVERHEAD: + eevop = &__efx_ev_rhead_ops; + break; +#endif /* EFSYS_OPT_RIVERHEAD */ + default: EFSYS_ASSERT(0); rc = ENOTSUP; @@ -401,6 +423,36 @@ efx_ev_qprefetch( #endif /* EFSYS_OPT_EV_PREFETCH */ +/* + * This method is needed to ensure that eec_initialized callback + * is invoked after queue creation. The callback will be invoked + * on Riverhead boards which have no support for INIT_DONE events + * and will do nothing on other boards. + * + * The client drivers must call this method after calling efx_ev_create(). + * The call must be done with the same locks being held (if any) which are + * normally acquired around efx_ev_qpoll() calls to ensure that + * eec_initialized callback is invoked within the same locking context. + */ + void +efx_ev_qcreate_check_init_done( + __in efx_evq_t *eep, + __in const efx_ev_callbacks_t *eecp, + __in_opt void *arg) +{ + const efx_nic_cfg_t *encp; + + EFSYS_ASSERT(eep != NULL); + EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); + EFSYS_ASSERT(eecp != NULL); + EFSYS_ASSERT(eecp->eec_initialized != NULL); + + encp = efx_nic_cfg_get(eep->ee_enp); + + if (encp->enc_evq_init_done_ev_supported == B_FALSE) + (void) eecp->eec_initialized(arg); +} + void efx_ev_qpoll( __in efx_evq_t *eep,