From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1C215A04E1; Tue, 22 Sep 2020 10:53:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 961E21DB08; Tue, 22 Sep 2020 10:50:53 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 7704B1D710 for ; Tue, 22 Sep 2020 10:50:19 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.150]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2385E2005F for ; Tue, 22 Sep 2020 08:50:19 +0000 (UTC) Received: from us4-mdac16-60.at1.mdlocal (unknown [10.110.50.153]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2184F800A3 for ; Tue, 22 Sep 2020 08:50:19 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.12]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id BBABC100052 for ; Tue, 22 Sep 2020 08:50:18 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 84C4E4005B for ; Tue, 22 Sep 2020 08:50:18 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 09:50:10 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 09:50:10 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 08M8oAVx004687 for ; Tue, 22 Sep 2020 09:50:10 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 559701613A9 for ; Tue, 22 Sep 2020 09:50:10 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 22 Sep 2020 09:49:19 +0100 Message-ID: <1600764594-14752-26-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> References: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25674.003 X-TM-AS-Result: No-8.800500-8.000000-10 X-TMASE-MatchedRID: AVQ9v9IjTRVf4BpTN+neE7BZAi3nrnzbaeMaKzvXUpljLp8Cm8vwF7KB pljvKsfOfGzuoVn0Vs6PQi9XuOWoOC4MnFER4ZGiGjzBgnFZvQ5Wva+n/kCpr5GPHiE2kiT4sFm zNLPWp6JK9ns3X9uF5v1RnTJXuwcgiA9C6oekWISEsxw9kf3dvEpFpc3bJiMe27KSseGDg91JzE eCSYAQ+va+1VWhPfX7S/i41cQ7DTPvshHUAhiu675k9lVEXoZafS0Ip2eEHnz3IzXlXlpamPoLR 4+zsDTtw38dXReMtXe5orEYxUJD/ZLqTqUSl0NHYWfcTB2t7wI3wwcosd/AClZca9RSYo/b X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--8.800500-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25674.003 X-MDID: 1600764619-8d5xaXail2Wb Subject: [dpdk-dev] [PATCH 25/60] common/sfc_efx/base: handle MCDI events on Riverhead X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 fa74e408ae..0205769e70 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.17.1