[dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash

Van Haaren, Harry harry.van.haaren at intel.com
Thu Jan 11 16:02:10 CET 2018


> From: David Harton (dharton) [mailto:dharton at cisco.com]
> Sent: Thursday, January 11, 2018 2:59 PM
> To: Van Haaren, Harry <harry.van.haaren at intel.com>; Wu, Jingjing
> <jingjing.wu at intel.com>; Xing, Beilei <beilei.xing at intel.com>
> Cc: dev at dpdk.org; Zhao1, Wei <wei.zhao1 at intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash
> 
> 
> > -----Original Message-----
> > From: Van Haaren, Harry [mailto:harry.van.haaren at intel.com]
> >
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of David C Harton
> > >
> > > Calling i40evf_dev_xstats_reset can sometimes crash.
> > >
> > > Fixed issue by adding a pstats NULL check.
> >
> > Perhaps add a note here, that the root cause of (pstats == NULL) is a
> > valid error return from i40evf_query_stats(), if the vf command fails to
> > execute.
> >
> > Hence, we are not hiding symptoms of a different issue here, this NULL
> > check is required to validate the returned values.
> >
> 
> NULL is returned if the call fails.
> If desired I can capture the return code and base the check off the rc
> instead.
> That's the pattern used in a couple other places.

If you prefer that implementation of the check, you can keep my Ack, I don't mind much.

I reviewed as in my experience a NULL pointer can often be detected earlier, but that wasn't the case here.

PS: Apologies I didn't reply to v2, was reading "up" and didn't check for newer..


More information about the dev mailing list