lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 14 Apr 2023 11:58:58 +0000
From:   Sai Krishna Gajula <saikrishnag@...vell.com>
To:     Simon Horman <simon.horman@...igine.com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Sunil Kovvuri Goutham <sgoutham@...vell.com>,
        Geethasowjanya Akula <gakula@...vell.com>,
        "richardcochran@...il.com" <richardcochran@...il.com>,
        Linu Cherian <lcherian@...vell.com>,
        Jerin Jacob Kollanukkaran <jerinj@...vell.com>,
        Hariprasad Kelam <hkelam@...vell.com>,
        Subbaraya Sundeep Bhatta <sbhatta@...vell.com>,
        Ratheesh Kannoth <rkannoth@...vell.com>
Subject: Re: [net PATCH v2 6/7] octeontx2-af: Skip PFs if not enabled

Please see inline,

> -----Original Message-----
> From: Simon Horman <simon.horman@...igine.com>
> Sent: Saturday, April 8, 2023 8:26 PM
> To: Sai Krishna Gajula <saikrishnag@...vell.com>
> Cc: davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org;
> pabeni@...hat.com; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; Sunil Kovvuri Goutham <sgoutham@...vell.com>;
> Geethasowjanya Akula <gakula@...vell.com>; richardcochran@...il.com;
> Linu Cherian <lcherian@...vell.com>; Jerin Jacob Kollanukkaran
> <jerinj@...vell.com>; Hariprasad Kelam <hkelam@...vell.com>;
> Subbaraya Sundeep Bhatta <sbhatta@...vell.com>; Ratheesh Kannoth
> <rkannoth@...vell.com>
> Subject: Re: [net PATCH v2 6/7] octeontx2-af: Skip PFs if not enabled
> 
> On Fri, Apr 07, 2023 at 05:53:43PM +0530, Sai Krishna wrote:
> > From: Ratheesh Kannoth <rkannoth@...vell.com>
> >
> > Skip mbox initialization of disabled PFs. Firmware configures PFs and
> > allocate mbox resources etc. Linux should configure particular PFs,
> > which ever are enabled by firmware.
> >
> > Fixes: 9bdc47a6e328 ("octeontx2-af: Mbox communication support btw AF
> > and it's VFs")
> > Signed-off-by: Ratheesh Kannoth <rkannoth@...vell.com>
> > Signed-off-by: Sunil Kovvuri Goutham <sgoutham@...vell.com>
> > Signed-off-by: Sai Krishna <saikrishnag@...vell.com>
> 
> ...
> 
> > @@ -2343,8 +2349,27 @@ static int rvu_mbox_init(struct rvu *rvu, struct
> mbox_wq_info *mw,
> >  	int err = -EINVAL, i, dir, dir_up;
> >  	void __iomem *reg_base;
> >  	struct rvu_work *mwork;
> > +	unsigned long *pf_bmap;
> >  	void **mbox_regions;
> >  	const char *name;
> > +	u64 cfg;
> > +
> > +	pf_bmap = devm_kcalloc(rvu->dev, BITS_TO_LONGS(num),
> sizeof(long),
> > +GFP_KERNEL);
> 
> Hi Sai and Ratheesh,
> 
> I am a little confused about the lifecycle of pf_bmap.
> It is a local variable of this function.
> But it is allocated using devm_kcalloc(), so it will persist for the life of the
> device.
> 
> Also, I note that rvu_mbox_init() has too call sites.
> So is there a situation where a pf_bmap is allocated more than once for the
> same rvu->dev instance?
> 
> It seems to me it would be more appropriate to allocate bf_bmap using
> kcalloc() take clear to free it before leaving rvu_mbox_init(), as is already
> done for mbox_regions.
> 

We will prepare v3 patch according to the suggested changes using kcalloc().

> > +	if (!pf_bmap)
> > +		return -ENOMEM;
> 
> ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ