From nobody Fri Sep 22 21:57:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RsmMr5H1sz4tVDd; Fri, 22 Sep 2023 21:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RsmMr3KM3z3THS; Fri, 22 Sep 2023 21:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695419848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c13p2FSSICbr51yeBkcCfCu4KTbFuz2WwUkyIjRuKFw=; b=iFbli1RHbJaOq6edH//eN0X7gJp6dKPQGyDF/hbGSY7isF5I0Gd37GQynx0eG6nXRId3rr DwV2+rSYIMpXok6yDsTWVBGQpa/za2k2DiC4HF+TA6xDNo154qGAQ0t81tDFSkA1Qc/tRu 44Vm73xwk/L3nwQ2PB7hU53M9CAZLXfOK6x6PGOAeQ2P71rcX6KMAcyvCMWFkqIDuoSANa lYZSsa8Kme6yhGuXAfojMCw1jMRoavjqbLREYfvGbRVzKLf+itzXCqCdlN9uYdNRYYOMAi F3+dWbFMuyt5IC0N16r2s9r0LdaemrLs3bjsb8vyJXNWbSENMIM2unhxYh9TpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695419848; a=rsa-sha256; cv=none; b=KKdbIzBlDum2JNytNK61rhBPIg0iucOzakPI7Y8H8zCpU6pryoROjT51bvWS/PjV9oWTXd dBqqujP0Db2LWNS4jwD0EP21oMYecH7Y50IrMGYUO6RfGpIW9UQClg/ZuRSNYI5nP08Kiu 6GzyLrvWpfc7qmJzndfVvQAVSmgtj01XHM42+zz+mmD5VO5+8qj05E6qkKObT+q5Q5uR2X PCs6Cjz3TEtyovkunM0ElyswVzW9wdCBH9vt2WEkED7ZyOWA7Yh9gD+BERb//dndHBYYCV XqUXPkdwf2TbuDvvxELCtiDIie0VjMrWJX55cl5MiPTfOMEsSxlBO1sVayupaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695419848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c13p2FSSICbr51yeBkcCfCu4KTbFuz2WwUkyIjRuKFw=; b=pE0dvDNyHG6UX3Yjq7ktzTBViCOA6RndEwq0YK+XsWEV88fdAqJfIUsZ0UvIoYv0r3dRiA tbY6xsbKkrBr1aN22DCdl0bUyksk6QWtOKt5GLzb6xOnHK1qx0FtNMVQ56Uk9JtGl+UA49 HCUUR3rRVpMACyZKtCJFOrFuUImnGPKZ8m1MRMICVcJ+k78oU1Y4KRO6qIkXiXPnAQNsgn hBubG08k9u9PdpFWhMKKygaDOFxy9aHKtRJmqVcFIAGHMA3s/d7plyzK5dy/3eiToHIMHT mUVvTt86GPQ1wtYD/3xQXjhELzN3kC8fiE1V2YsjUghm5Pbdu707ZTC+aAW3Vw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RsmMr2QPnzf1c; Fri, 22 Sep 2023 21:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38MLvSk5047804; Fri, 22 Sep 2023 21:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38MLvS2C047801; Fri, 22 Sep 2023 21:57:28 GMT (envelope-from git) Date: Fri, 22 Sep 2023 21:57:28 GMT Message-Id: <202309222157.38MLvS2C047801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 1002fd41e1b9 - stable/13 - ice(4): Match irdma interface changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1002fd41e1b91d1acc8df9a2b06a4e163721e5e8 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=1002fd41e1b91d1acc8df9a2b06a4e163721e5e8 commit 1002fd41e1b91d1acc8df9a2b06a4e163721e5e8 Author: Bartosz Sobczak AuthorDate: 2023-07-24 15:46:31 +0000 Commit: Eric Joyner CommitDate: 2023-09-22 21:55:02 +0000 ice(4): Match irdma interface changes (This is a direct commit to stable/13) Signed-off-by: Bartosz Sobczak Signed-off-by: Eric Joyner Sponsored by: Intel Corporation --- sys/dev/ice/ice_rdma.c | 59 +++++++++++++++++++++++++++++++++++++---- sys/dev/ice/ice_rdma.h | 11 ++++---- sys/dev/ice/ice_rdma_internal.h | 2 ++ sys/dev/ice/if_ice_iflib.c | 15 +++++------ sys/dev/irdma/icrdma.c | 4 --- 5 files changed, 69 insertions(+), 22 deletions(-) diff --git a/sys/dev/ice/ice_rdma.c b/sys/dev/ice/ice_rdma.c index 8443cab1e98e..411bfb41dcec 100644 --- a/sys/dev/ice/ice_rdma.c +++ b/sys/dev/ice/ice_rdma.c @@ -121,11 +121,10 @@ ice_rdma_pf_reset(struct ice_rdma_peer *peer) { struct ice_softc *sc = ice_rdma_peer_to_sc(peer); - /* - * Request that the driver re-initialize by bringing the interface - * down and up. - */ - ice_request_stack_reinit(sc); + /* Tell the base driver that RDMA is requesting a PFR */ + ice_set_state(&sc->state, ICE_STATE_RESET_PFR_REQ); + + /* XXX: Base driver will notify RDMA when it's done */ return (0); } @@ -331,6 +330,7 @@ ice_rdma_request_handler(struct ice_rdma_peer *peer, switch(req->type) { case ICE_RDMA_EVENT_RESET: + ice_rdma_pf_reset(peer); break; case ICE_RDMA_EVENT_QSET_REGISTER: ice_rdma_qset_register_request(peer, &req->res); @@ -865,3 +865,52 @@ ice_rdma_dcb_qos_update(struct ice_softc *sc, struct ice_port_info *pi) IRDMA_EVENT_HANDLER(peer, &event); sx_xunlock(&ice_rdma.mtx); } + +/** + * ice_rdma_notify_pe_intr - notify irdma on incoming interrupts regarding PE + * @sc: the ice driver softc + * @oicr: interrupt cause + * + * Pass the information about received interrupt to RDMA driver if it was + * relating to PE. Specifically PE_CRITERR and HMC_ERR. + * The irdma driver shall decide what should be done upon these interrupts. + */ +void +ice_rdma_notify_pe_intr(struct ice_softc *sc, uint32_t oicr) +{ + struct ice_rdma_peer *peer = &sc->rdma_entry.peer; + struct ice_rdma_event event; + + memset(&event, 0, sizeof(struct ice_rdma_event)); + event.type = ICE_RDMA_EVENT_CRIT_ERR; + event.oicr_reg = oicr; + + sx_xlock(&ice_rdma.mtx); + if (sc->rdma_entry.attached && ice_rdma.registered) + IRDMA_EVENT_HANDLER(peer, &event); + sx_xunlock(&ice_rdma.mtx); +} + +/** + * ice_rdma_notify_reset - notify irdma on incoming pf-reset + * @sc: the ice driver softc + * + * Inform irdma driver of an incoming PF reset. + * The irdma driver shall set its state to reset, and avoid using CQP + * anymore. Next step should be to call ice_rdma_pf_stop in order to + * remove resources. + */ +void +ice_rdma_notify_reset(struct ice_softc *sc) +{ + struct ice_rdma_peer *peer = &sc->rdma_entry.peer; + struct ice_rdma_event event; + + memset(&event, 0, sizeof(struct ice_rdma_event)); + event.type = ICE_RDMA_EVENT_RESET; + + sx_xlock(&ice_rdma.mtx); + if (sc->rdma_entry.attached && ice_rdma.registered) + IRDMA_EVENT_HANDLER(peer, &event); + sx_xunlock(&ice_rdma.mtx); +} diff --git a/sys/dev/ice/ice_rdma.h b/sys/dev/ice/ice_rdma.h index f83c30b33f6c..38e2ef491e8e 100644 --- a/sys/dev/ice/ice_rdma.h +++ b/sys/dev/ice/ice_rdma.h @@ -64,7 +64,7 @@ * considered stable. */ #define ICE_RDMA_MAJOR_VERSION 1 -#define ICE_RDMA_MINOR_VERSION 0 +#define ICE_RDMA_MINOR_VERSION 1 #define ICE_RDMA_PATCH_VERSION 0 /** @@ -273,18 +273,19 @@ struct ice_rdma_event { uint64_t baudrate; }; /* MTU change event */ - struct { - int mtu; - }; + int mtu; /* * TC/QoS/DCB change event - * RESET event use prep variable only * prep: if true, this is a pre-event, post-event otherwise */ struct { struct ice_qos_params port_qos; bool prep; }; + /* + * CRIT_ERR event + */ + uint32_t oicr_reg; }; }; diff --git a/sys/dev/ice/ice_rdma_internal.h b/sys/dev/ice/ice_rdma_internal.h index c80d4540194a..b36544609f45 100644 --- a/sys/dev/ice/ice_rdma_internal.h +++ b/sys/dev/ice/ice_rdma_internal.h @@ -98,4 +98,6 @@ int ice_rdma_pf_stop(struct ice_softc *sc); void ice_rdma_link_change(struct ice_softc *sc, int linkstate, uint64_t baudrate); void ice_rdma_notify_dcb_qos_change(struct ice_softc *sc); void ice_rdma_dcb_qos_update(struct ice_softc *sc, struct ice_port_info *pi); +void ice_rdma_notify_pe_intr(struct ice_softc *sc, uint32_t oicr); +void ice_rdma_notify_reset(struct ice_softc *sc); #endif diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index be1aa86234c7..d8542e383564 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -1287,9 +1287,11 @@ ice_msix_admin(void *arg) ice_set_state(&sc->state, ICE_STATE_RESET_PFR_REQ); } - if (oicr & PFINT_OICR_PE_CRITERR_M) { - device_printf(dev, "Critical Protocol Engine Error detected!\n"); - ice_set_state(&sc->state, ICE_STATE_RESET_PFR_REQ); + if (oicr & (PFINT_OICR_PE_CRITERR_M | PFINT_OICR_HMC_ERR_M)) { + if (oicr & PFINT_OICR_HMC_ERR_M) + /* Log the HMC errors */ + ice_log_hmc_error(hw, dev); + ice_rdma_notify_pe_intr(sc, oicr); } if (oicr & PFINT_OICR_PCI_EXCEPTION_M) { @@ -1297,11 +1299,6 @@ ice_msix_admin(void *arg) ice_set_state(&sc->state, ICE_STATE_RESET_PFR_REQ); } - if (oicr & PFINT_OICR_HMC_ERR_M) { - /* Log the HMC errors, but don't disable the interrupt cause */ - ice_log_hmc_error(hw, dev); - } - return (FILTER_SCHEDULE_THREAD); } @@ -2307,6 +2304,8 @@ ice_prepare_for_reset(struct ice_softc *sc) if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE)) return; + /* inform the RDMA client */ + ice_rdma_notify_reset(sc); /* stop the RDMA client */ ice_rdma_pf_stop(sc); diff --git a/sys/dev/irdma/icrdma.c b/sys/dev/irdma/icrdma.c index 848f8126e57c..8efd9d5c6034 100644 --- a/sys/dev/irdma/icrdma.c +++ b/sys/dev/irdma/icrdma.c @@ -350,7 +350,6 @@ irdma_event_handler(struct ice_rdma_peer *peer, struct ice_rdma_event *event) atomic_dec(&iwdev->rf->dev_ctx.event_rfcnt); break; case ICE_RDMA_EVENT_CRIT_ERR: -#ifdef EVNT_HNDLR_CRITERR if (event->oicr_reg & IRDMAPFINT_OICR_PE_CRITERR_M) { u32 pe_criterr; @@ -371,9 +370,6 @@ irdma_event_handler(struct ice_rdma_peer *peer, struct ice_rdma_event *event) } if (iwdev->rf->reset) iwdev->rf->gen_ops.request_reset(iwdev->rf); -#else - printf("%s:%d event type received: %d\n", __func__, __LINE__, event->type); -#endif break; case ICE_RDMA_EVENT_RESET: iwdev->rf->reset = true;