[dpdk-dev] net/nfp: initialize stats struct
Checks
Commit Message
Not all struct fields will be written and random data could
confuse readers.
Fixes: 92aa491b881e ("nfp: add statistics")
Coverity: 140755
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
drivers/net/nfp/nfp_net.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On 11/8/2017 3:59 AM, Alejandro Lucero wrote:
> Not all struct fields will be written and random data could
> confuse readers.
>
> Fixes: 92aa491b881e ("nfp: add statistics")
> Coverity: 140755
Hi Alejandro,
Thank you for coverity fixes, but they will be considered for next release,
since trying to limit rc4 only for critical fixes.
Thanks,
ferruh
>
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
On Thu, 9 Nov 2017 17:10:16 -0800
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 11/8/2017 3:59 AM, Alejandro Lucero wrote:
> > Not all struct fields will be written and random data could
> > confuse readers.
> >
> > Fixes: 92aa491b881e ("nfp: add statistics")
> > Coverity: 140755
>
> Hi Alejandro,
>
> Thank you for coverity fixes, but they will be considered for next release,
> since trying to limit rc4 only for critical fixes.
>
> Thanks,
> ferruh
>
> >
> > Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
>
This looks like a bug fix. because the stats are on the stack and will
be garbage.
On 11/9/2017 8:05 PM, Stephen Hemminger wrote:
> On Thu, 9 Nov 2017 17:10:16 -0800
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
>> On 11/8/2017 3:59 AM, Alejandro Lucero wrote:
>>> Not all struct fields will be written and random data could
>>> confuse readers.
>>>
>>> Fixes: 92aa491b881e ("nfp: add statistics")
>>> Coverity: 140755
>>
>> Hi Alejandro,
>>
>> Thank you for coverity fixes, but they will be considered for next release,
>> since trying to limit rc4 only for critical fixes.
>>
>> Thanks,
>> ferruh
>>
>>>
>>> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
>>
>
> This looks like a bug fix. because the stats are on the stack and will
> be garbage.
Yes it is, also other nfp patches are fixes.
This is for an effort to close the release, eventually it needs to stop
somewhere, and technically after rc3 is only for critical bug fixes, so this is
the time for stop getting these kind of patches.
After above said, relying on scope of the patches are PMD only and patches are
sent by driver maintainers, I will get them, reminding Thomas' right to drop
them back if he disagrees.
On 11/8/2017 3:59 AM, Alejandro Lucero wrote:
> Not all struct fields will be written and random data could
> confuse readers.
>
> Fixes: 92aa491b881e ("nfp: add statistics")
> Coverity: 140755
>
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Applied to dpdk/master, thanks.
@@ -1038,6 +1038,8 @@ enum nfp_qcp_ptr {
/* RTE_ETHDEV_QUEUE_STAT_CNTRS default value is 16 */
+ memset(&nfp_dev_stats, 0, sizeof(nfp_dev_stats));
+
/* reading per RX ring stats */
for (i = 0; i < dev->data->nb_rx_queues; i++) {
if (i == RTE_ETHDEV_QUEUE_STAT_CNTRS)