From 9edb8ee3e7ab606baea586d8e9179ec61d971456 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 24 Sep 2020 13:12:00 +0100 Subject: [PATCH] common/sfc_efx/base: handle MCDI events on Riverhead EF100 MCDI event layout is same as on EF10 except added QDMA phase bit which is unused on EF10. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/ef10_ev.c | 17 +++++++------ drivers/common/sfc_efx/base/ef10_impl.h | 8 ++++++ drivers/common/sfc_efx/base/rhead_ev.c | 33 ++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_ev.c b/drivers/common/sfc_efx/base/ef10_ev.c index e2b5c62d5d..aec1c468a4 100644 --- a/drivers/common/sfc_efx/base/ef10_ev.c +++ b/drivers/common/sfc_efx/base/ef10_ev.c @@ -47,13 +47,6 @@ ef10_ev_drv_gen( __in const efx_ev_callbacks_t *eecp, __in_opt void *arg); -static __checkReturn boolean_t -ef10_ev_mcdi( - __in efx_evq_t *eep, - __in efx_qword_t *eqp, - __in const efx_ev_callbacks_t *eecp, - __in_opt void *arg); - static __checkReturn efx_rc_t efx_mcdi_set_evq_tmr( @@ -857,7 +850,11 @@ ef10_ev_drv_gen( return (should_abort); } -static __checkReturn boolean_t +#endif /* EFX_OPTS_EF10() */ + +#if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() + + __checkReturn boolean_t ef10_ev_mcdi( __in efx_evq_t *eep, __in efx_qword_t *eqp, @@ -1064,6 +1061,10 @@ ef10_ev_mcdi( return (should_abort); } +#endif /* EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() */ + +#if EFX_OPTS_EF10() + void ef10_ev_rxlabel_init( __in efx_evq_t *eep, diff --git a/drivers/common/sfc_efx/base/ef10_impl.h b/drivers/common/sfc_efx/base/ef10_impl.h index e933d88135..e77fb4ddea 100644 --- a/drivers/common/sfc_efx/base/ef10_impl.h +++ b/drivers/common/sfc_efx/base/ef10_impl.h @@ -158,6 +158,14 @@ ef10_ev_rxlabel_fini( __in efx_evq_t *eep, __in unsigned int label); +LIBEFX_INTERNAL +extern __checkReturn boolean_t +ef10_ev_mcdi( + __in efx_evq_t *eep, + __in efx_qword_t *eqp, + __in const efx_ev_callbacks_t *eecp, + __in_opt void *arg); + /* INTR */ LIBEFX_INTERNAL diff --git a/drivers/common/sfc_efx/base/rhead_ev.c b/drivers/common/sfc_efx/base/rhead_ev.c index 36e355f209..6113cc9cf3 100644 --- a/drivers/common/sfc_efx/base/rhead_ev.c +++ b/drivers/common/sfc_efx/base/rhead_ev.c @@ -17,6 +17,14 @@ #define EFX_RHEAD_ALWAYS_INTERRUPTING_EVQ_INDEX (0) +static __checkReturn boolean_t +rhead_ev_mcdi( + __in efx_evq_t *eep, + __in efx_qword_t *eqp, + __in const efx_ev_callbacks_t *eecp, + __in_opt void *arg); + + __checkReturn efx_rc_t rhead_ev_init( __in efx_nic_t *enp) @@ -54,7 +62,7 @@ rhead_ev_qcreate( eep->ee_tx = NULL; /* FIXME */ eep->ee_driver = NULL; /* FIXME */ eep->ee_drv_gen = NULL; /* FIXME */ - eep->ee_mcdi = NULL; /* FIXME */ + eep->ee_mcdi = rhead_ev_mcdi; /* Set up the event queue */ /* INIT_EVQ expects function-relative vector number */ @@ -193,6 +201,10 @@ rhead_ev_qpoll( code = EFX_QWORD_FIELD(ev[index], ESF_GZ_E_TYPE); switch (code) { + case ESE_GZ_EF100_EV_MCDI: + should_abort = eep->ee_mcdi(eep, + &(ev[index]), eecp, arg); + break; default: EFSYS_PROBE3(bad_event, unsigned int, eep->ee_index, @@ -262,4 +274,23 @@ rhead_ev_qstats_update( } #endif /* EFSYS_OPT_QSTATS */ +static __checkReturn boolean_t +rhead_ev_mcdi( + __in efx_evq_t *eep, + __in efx_qword_t *eqp, + __in const efx_ev_callbacks_t *eecp, + __in_opt void *arg) +{ + boolean_t ret; + + /* + * Event format was changed post Riverhead R1 and now + * MCDI event layout on EF100 is exactly the same as on EF10 + * except added QDMA phase bit which is unused on EF10. + */ + ret = ef10_ev_mcdi(eep, eqp, eecp, arg); + + return (ret); +} + #endif /* EFSYS_OPT_RIVERHEAD */ -- 2.20.1