> -----Original Message-----
> From: Jakub Kicinski <k...@kernel.org>
> Sent: Tuesday, July 21, 2020 11:01 AM
> To: Nguyen, Anthony L <anthony.l.ngu...@intel.com>
> Cc: da...@davemloft.net; Michael, Alice <alice.mich...@intel.com>;
> netdev@vger.kernel.org; nhor...@redhat.com; sassm...@redhat.com;
> Kirsher, Jeffrey T <jeffrey.t.kirs...@intel.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 v4 06/15] iecm: Implement mailbox functionality
> 
> On Mon, 20 Jul 2020 17:38:01 -0700 Tony Nguyen wrote:
> > @@ -30,7 +38,32 @@ static enum iecm_status iecm_ctlq_init_regs(struct
> iecm_hw *hw,
> >                                         struct iecm_ctlq_info *cq,
> >                                         bool is_rxq)
> >  {
> > -   /* stub */
> > +   u32 reg = 0;
> > +
> > +   if (is_rxq)
> > +           /* Update tail to post pre-allocated buffers for Rx queues */
> > +           wr32(hw, cq->reg.tail, (u32)(cq->ring_size - 1));
> > +   else
> > +           wr32(hw, cq->reg.tail, 0);
> > +
> > +   /* For non-Mailbox control queues only TAIL need to be set */
> > +   if (cq->q_id != -1)
> > +           return 0;
> > +
> > +   /* Clear Head for both send or receive */
> > +   wr32(hw, cq->reg.head, 0);
> > +
> > +   /* set starting point */
> > +   wr32(hw, cq->reg.bal, IECM_LO_DWORD(cq->desc_ring.pa));
> > +   wr32(hw, cq->reg.bah, IECM_HI_DWORD(cq->desc_ring.pa));
> > +   wr32(hw, cq->reg.len, (cq->ring_size | cq->reg.len_ena_mask));
> > +
> > +   /* Check one register to verify that config was applied */
> > +   reg = rd32(hw, cq->reg.bah);
> > +   if (reg != IECM_HI_DWORD(cq->desc_ring.pa))
> > +           return IECM_ERR_CTLQ_ERROR;
> 
> Please stop using your own error codes.
> 

We did drastically reduce the amount enum idpf_status usage, but if still not 
quite satisfactory, we will try and go further with it.

Alan

Reply via email to