> -----Original Message-----
> From: Jakub Kicinski <[email protected]>
> Sent: Tuesday, July 21, 2020 11:01 AM
> To: Nguyen, Anthony L <[email protected]>
> Cc: [email protected]; Michael, Alice <[email protected]>;
> [email protected]; [email protected]; [email protected];
> Kirsher, Jeffrey T <[email protected]>; Brady, Alan
> <[email protected]>; Burra, Phani R <[email protected]>; Hay,
> Joshua A <[email protected]>; Chittim, Madhu
> <[email protected]>; Linga, Pavan Kumar
> <[email protected]>; Skidmore, Donald C
> <[email protected]>; Brandeburg, Jesse
> <[email protected]>; Samudrala, Sridhar
> <[email protected]>
> 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