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 B0313A04AA; Tue, 8 Sep 2020 11:17:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5DBE1C136; Tue, 8 Sep 2020 11:15:55 +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 577E41C11D for ; Tue, 8 Sep 2020 11:15:51 +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 E5593200C6 for ; Tue, 8 Sep 2020 09:15:50 +0000 (UTC) Received: from us4-mdac16-24.at1.mdlocal (unknown [10.110.49.206]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2E388800D9 for ; Tue, 8 Sep 2020 09:15:50 +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 B7F0710010E for ; Tue, 8 Sep 2020 09:14:56 +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 7FC774006D for ; Tue, 8 Sep 2020 09:14:56 +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, 8 Sep 2020 10:14:49 +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, 8 Sep 2020 10:14:49 +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 0889En1S032438 for ; Tue, 8 Sep 2020 10:14:49 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id AD7A51613A9 for ; Tue, 8 Sep 2020 10:14:49 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 8 Sep 2020 10:14:32 +0100 Message-ID: <1599556475-27820-13-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1599556475-27820-1-git-send-email-arybchenko@solarflare.com> References: <1599556475-27820-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-25652.003 X-TM-AS-Result: No-6.498100-8.000000-10 X-TMASE-MatchedRID: fo0Y+APoFtkkVMQcdgU2qS2416nc3bQleouvej40T4gd0WOKRkwsh3Io zGa69omdrdoLblq9S5otr+iyiysSKDzCn0Lg6DUs+CjwEqX1p7lfAXPuWnqbj8d4gWcpDnUc3xf zp7pithHjq8Vr7gTGbixPati2bMiYFUPnz5fE4uOeAiCmPx4NwBnUJ0Ek6yhjxEHRux+uk8h+IC quNi0WJNBOAmY2z/6ZMog+FR5SfDBZVmWRTt7mqqoNmuMHFxc9ftwZ3X11IV0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.498100-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25652.003 X-MDID: 1599556550-LtBxT8fjKZew Subject: [dpdk-dev] [PATCH 11/14] net/sfc: add MCDI callback to schedule restart 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" MC reboot handling is driver specific. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_mcdi.c | 15 +++++++++++++-- drivers/net/sfc/sfc_mcdi.h | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c index 5077fcddd6..73dbd8194b 100644 --- a/drivers/net/sfc/sfc_mcdi.c +++ b/drivers/net/sfc/sfc_mcdi.c @@ -195,7 +195,7 @@ sfc_efx_mcdi_exception(void *arg, efx_mcdi_exception_t eme) (eme == EFX_MCDI_EXCEPTION_MC_REBOOT) ? "REBOOT" : (eme == EFX_MCDI_EXCEPTION_MC_BADASSERT) ? "BADASSERT" : "UNKNOWN"); - sfc_schedule_restart(sa); + mcdi->ops->sched_restart(mcdi->ops_cookie); } #define SFC_MCDI_LOG_BUF_SIZE 128 @@ -285,7 +285,8 @@ sfc_efx_mcdi_init(struct sfc_adapter *sa, struct sfc_efx_mcdi *mcdi, efx_mcdi_transport_t *emtp; int rc; - if (ops->dma_alloc == NULL || ops->dma_free == NULL) + if (ops->dma_alloc == NULL || ops->dma_free == NULL || + ops->sched_restart == NULL) return EINVAL; SFC_ASSERT(mcdi->state == SFC_EFX_MCDI_UNINITIALIZED); @@ -372,9 +373,19 @@ sfc_mcdi_dma_free(void *cookie, efsys_mem_t *esmp) sfc_dma_free(sa, esmp); } +static sfc_efx_mcdi_sched_restart_cb sfc_mcdi_sched_restart; +static void +sfc_mcdi_sched_restart(void *cookie) +{ + struct sfc_adapter *sa = cookie; + + sfc_schedule_restart(sa); +} + static const struct sfc_efx_mcdi_ops sfc_mcdi_ops = { .dma_alloc = sfc_mcdi_dma_alloc, .dma_free = sfc_mcdi_dma_free, + .sched_restart = sfc_mcdi_sched_restart, }; int diff --git a/drivers/net/sfc/sfc_mcdi.h b/drivers/net/sfc/sfc_mcdi.h index ef24a8bc67..8f9b1991be 100644 --- a/drivers/net/sfc/sfc_mcdi.h +++ b/drivers/net/sfc/sfc_mcdi.h @@ -37,9 +37,12 @@ typedef int (sfc_efx_mcdi_dma_alloc_cb)(void *cookie, const char *name, typedef void (sfc_efx_mcdi_dma_free_cb)(void *cookie, efsys_mem_t *esmp); +typedef void (sfc_efx_mcdi_sched_restart_cb)(void *cookie); + struct sfc_efx_mcdi_ops { sfc_efx_mcdi_dma_alloc_cb *dma_alloc; sfc_efx_mcdi_dma_free_cb *dma_free; + sfc_efx_mcdi_sched_restart_cb *sched_restart; }; struct sfc_efx_mcdi { -- 2.17.1