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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170629081519.GD29453@vergenet.net>
Date:   Thu, 29 Jun 2017 10:15:21 +0200
From:   Simon Horman <simon.horman@...ronome.com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        oss-drivers@...ronome.com,
        Pieter Jansen van Vuuren 
        <pieter.jansenvanvuuren@...ronome.com>
Subject: Re: [oss-drivers] Re: [PATCH net-next v2 8/9] nfp: add a stats
 handler for flower offloads

On Wed, Jun 28, 2017 at 07:55:18PM -0700, Jakub Kicinski wrote:
> On Wed, 28 Jun 2017 22:30:01 +0200, Simon Horman wrote:
> > From: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@...ronome.com>
> > 
> > Previously there was no way of updating flow rule stats after they
> > have been offloaded to hardware. This is solved by keeping track of
> > stats received from hardware and providing this to the TC handler
> > on request.
> > 
> > Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@...ronome.com>
> > Signed-off-by: Simon Horman <simon.horman@...ronome.com>
> 
> > @@ -334,7 +441,10 @@ int nfp_modify_flow_metadata(struct nfp_app *app,
> >  	/* Update flow payload with mask ids. */
> >  	nfp_flow->unmasked_data[NFP_FL_MASK_ID_LOCATION] = new_mask_id;
> >  
> > -	return 0;
> > +	/* Release the stats ctx id. */
> > +	temp_ctx_id = be32_to_cpu(nfp_flow->meta.host_ctx_id);
> > +
> > +	return nfp_release_stats_entry(app, temp_ctx_id);
> >  }
> >  
> >  int nfp_flower_metadata_init(struct nfp_app *app)
> > @@ -362,6 +472,15 @@ int nfp_flower_metadata_init(struct nfp_app *app)
> >  		return -ENOMEM;
> >  	}
> >  
> > +	/* Init ring buffer and unallocated stats_ids. */
> > +	priv->stats_ids.free_list.buf =
> > +		vmalloc(NFP_FL_STATS_ENTRY_RS * NFP_FL_STATS_ELEM_RS);
> > +	if (!priv->stats_ids.free_list.buf) {
> > +		vfree(priv->mask_ids.mask_id_free_list.buf);
> > +		return -ENOMEM;
> 
> This is hiding a leak, I think.  There were 2 things allocate above.
> Please add a proper unwind path with goto's - it makes catching bugs
> like this much easier.

Sure, will do.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ