MCPcopy Create free account
hub / github.com/F-Stack/f-stack / efx_nic_reset

Function efx_nic_reset

dpdk/drivers/common/sfc_efx/base/efx_nic.c:689–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687}
688
689 __checkReturn efx_rc_t
690efx_nic_reset(
691 __in efx_nic_t *enp)
692{
693 const efx_nic_ops_t *enop = enp->en_enop;
694 unsigned int mod_flags;
695 efx_rc_t rc;
696
697 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
698 EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE);
699 /*
700 * All modules except the MCDI, PROBE, NVRAM, VPD, MON, TUNNEL
701 * (which we do not reset here) must have been shut down or never
702 * initialized.
703 *
704 * A rule of thumb here is: If the controller or MC reboots, is *any*
705 * state lost. If it's lost and needs reapplying, then the module
706 * *must* not be initialised during the reset.
707 */
708 mod_flags = enp->en_mod_flags;
709 mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM |
710 EFX_MOD_VPD | EFX_MOD_MON);
711#if EFSYS_OPT_TUNNEL
712 mod_flags &= ~EFX_MOD_TUNNEL;
713#endif /* EFSYS_OPT_TUNNEL */
714 EFSYS_ASSERT3U(mod_flags, ==, 0);
715 if (mod_flags != 0) {
716 rc = EINVAL;
717 goto fail1;
718 }
719
720 if ((rc = enop->eno_reset(enp)) != 0)
721 goto fail2;
722
723 return (0);
724
725fail2:
726 EFSYS_PROBE(fail2);
727fail1:
728 EFSYS_PROBE1(fail1, efx_rc_t, rc);
729
730 return (rc);
731}
732
733 const efx_nic_cfg_t *
734efx_nic_cfg_get(

Callers 2

sfc_attachFunction · 0.85
sfc_vdpa_hw_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected