> -----Original Message----- > From: Jakub Kicinski <k...@kernel.org> > Sent: Friday, June 26, 2020 12:15 PM > To: Kirsher, Jeffrey T <jeffrey.t.kirs...@intel.com> > Cc: da...@davemloft.net; Michael, Alice <alice.mich...@intel.com>; > netdev@vger.kernel.org; nhor...@redhat.com; sassm...@redhat.com; > Brady, Alan <alan.br...@intel.com>; Burra, Phani R <phani.r.bu...@intel.com>; > Hay, Joshua A <joshua.a....@intel.com>; Chittim, Madhu > <madhu.chit...@intel.com>; Linga, Pavan Kumar > <pavan.kumar.li...@intel.com>; Skidmore, Donald C > <donald.c.skidm...@intel.com>; Brandeburg, Jesse > <jesse.brandeb...@intel.com>; Samudrala, Sridhar > <sridhar.samudr...@intel.com> > Subject: Re: [net-next v3 13/15] iecm: Add ethtool > > On Thu, 25 Jun 2020 19:07:35 -0700 Jeff Kirsher wrote: > > diff --git a/drivers/net/ethernet/intel/iecm/iecm_lib.c > > b/drivers/net/ethernet/intel/iecm/iecm_lib.c > > index d34834422049..a55151495e18 100644 > > --- a/drivers/net/ethernet/intel/iecm/iecm_lib.c > > +++ b/drivers/net/ethernet/intel/iecm/iecm_lib.c > > @@ -765,7 +765,37 @@ static void iecm_deinit_task(struct iecm_adapter > > *adapter) static enum iecm_status iecm_init_hard_reset(struct > > iecm_adapter *adapter) { > > - /* stub */ > > + enum iecm_status err; > > + > > + /* Prepare for reset */ > > + if (test_bit(__IECM_HR_FUNC_RESET, adapter->flags)) { > > + iecm_deinit_task(adapter); > > + adapter->dev_ops.reg_ops.trigger_reset(adapter, > > + > __IECM_HR_FUNC_RESET); > > + set_bit(__IECM_UP_REQUESTED, adapter->flags); > > + clear_bit(__IECM_HR_FUNC_RESET, adapter->flags); > > + } else if (test_bit(__IECM_HR_CORE_RESET, adapter->flags)) { > > + if (adapter->state == __IECM_UP) > > + set_bit(__IECM_UP_REQUESTED, adapter->flags); > > + iecm_deinit_task(adapter); > > + clear_bit(__IECM_HR_CORE_RESET, adapter->flags); > > + } else if (test_and_clear_bit(__IECM_HR_DRV_LOAD, adapter->flags)) { > > + /* Trigger reset */ > > + } else { > > + dev_err(&adapter->pdev->dev, "Unhandled hard reset > cause\n"); > > + err = IECM_ERR_PARAM; > > + goto handle_err; > > + } > > + > > + /* Reset is complete and so start building the driver resources again */ > > + err = iecm_init_dflt_mbx(adapter); > > + if (err) { > > + dev_err(&adapter->pdev->dev, "Failed to initialize default > mailbox: %d\n", > > + err); > > + } > > +handle_err: > > + mutex_unlock(&adapter->reset_lock); > > + return err; > > } > > Please limit the use of iecm_status to the absolute necessary minimum. > > If FW reports those back, they should be converted to normal Linux errors in > the > handler of FW communication and not leak all over the driver like that. > > Having had to modify i40e recently - I find it very frustrating to not be > able to > propagate normal errors throughout the driver. The driver- -specific codes > are a > real PITA for people doing re-factoring work.
We understand how those can makes things difficult. We will do our best to rework and limit the use of the iecm_status enum. I think we do need a chunk of them in conrolq related things, but we can definitely do better to limit pollution. Alan