[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C01D5678EB05D185+20250723102757.GA672677@nic-Precision-5820-Tower>
Date: Wed, 23 Jul 2025 18:27:57 +0800
From: Yibo Dong <dong100@...se.com>
To: Andrew Lunn <andrew@...n.ch>
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 03:50:01PM +0200, Andrew Lunn wrote:
> 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....
>
Got it, I'll update this.
> > > > +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
>
I can get this warning with 'make CC=clang-16 W=1' now.
I did't make with clang before, I'll add this step for future patches.
Thanks for your feedback.
Powered by blists - more mailing lists