[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <942d3782-16af-4b20-9480-9bdf2d6a1222@lunn.ch>
Date: Tue, 22 Jul 2025 15:50:01 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Yibo Dong <dong100@...se.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
corbet@....net, gur.stavi@...wei.com, maddy@...ux.ibm.com,
mpe@...erman.id.au, danishanwar@...com, lee@...ger.us,
gongfan1@...wei.com, lorenzo@...nel.org, geert+renesas@...der.be,
Parthiban.Veerasooran@...rochip.com, lukas.bulwahn@...hat.com,
alexanderduyck@...com, richardcochran@...il.com,
netdev@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 03/15] net: rnpgbe: Add basic mbx ops support
On Tue, Jul 22, 2025 at 02:45:30PM +0800, Yibo Dong wrote:
> On Mon, Jul 21, 2025 at 05:43:41PM +0200, Andrew Lunn wrote:
> > > #define MAX_VF_NUM (8)
> >
> > > + hw->max_vfs = 7;
> >
> > ???
>
> This is mistake, max vfs is 7. 8 is '7 vfs + 1 pf'.
So it seems like you need to add a new #define for MAX_FUNCS_NUM, and
set MAX_VF_NUM to 7. And then actually use MAX_VP_NUM. When reviewing
your own code, seeing the number 7, not a define, should of been a
warning, something is wrong....
> > > +static int mucse_obtain_mbx_lock_pf(struct mucse_hw *hw, enum MBX_ID mbx_id)
> > > +{
> > > + struct mucse_mbx_info *mbx = &hw->mbx;
> > > + int try_cnt = 5000, ret;
> > > + u32 reg;
> > > +
> > > + reg = (mbx_id == MBX_FW) ? PF2FW_MBOX_CTRL(mbx) :
> > > + PF2VF_MBOX_CTRL(mbx, mbx_id);
> > > + while (try_cnt-- > 0) {
> > > + /* Take ownership of the buffer */
> > > + mbx_wr32(hw, reg, MBOX_PF_HOLD);
> > > + /* force write back before check */
> > > + wmb();
> > > + if (mbx_rd32(hw, reg) & MBOX_PF_HOLD)
> > > + return 0;
> > > + udelay(100);
> > > + }
> > > + return ret;
> >
> > I've not compiled this, but isn't ret uninitialized here? I would also
> > expect it to return -ETIMEDOUT?
> >
> > Andrew
> >
>
> Yes, ret is uninitialized. I will fix this.
Did the compiler give a warning? Code should be warning free. We also
expect networking code to be W=1 warning free.
Andrew
Powered by blists - more mailing lists