]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r293895
authorarybchik <arybchik@FreeBSD.org>
Wed, 20 Jan 2016 07:53:26 +0000 (07:53 +0000)
committerarybchik <arybchik@FreeBSD.org>
Wed, 20 Jan 2016 07:53:26 +0000 (07:53 +0000)
commit59fb3e0b1e265bbf4ced042c0e57e00d2994ad67
tree43853d76700f7f7eedd21bc17ee5853ae83ab994
parent9d665fc54fbe8426d089332e9e58dea1a722e4eb
MFC r293895

sfxge: fix common code VPD iterator and duplicate tag verification

Fix efx_vpd_hunk_next() which has -- since its inception -- failed to
correctly iterate over the tags and keywords contained in the VPD data.
Only the first tag or keyword would be returned and the next call with
*contp == 1 would walk to the end of the data and finish.

This was spotted when fixing up errors spotted by Prefast code analysis
(which neglected to set all of the out parameters in all successful cases)

Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of
correctly iterating over all the tags and keywords) was failing as it
detected that both the static VPD and dynamic VPD storage contained an
RV keyword in the VPD-R tag.  This is intentional as the static VPD and
dynamic VPD are stored separately (firmware merges their contents and
computes a new RV keyword checksum for the data readable from the VPD
capability in PCIe configuration space).

Submitted by:   Andrew Lee <alee at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
sys/dev/sfxge/common/efx_vpd.c
sys/dev/sfxge/common/hunt_vpd.c
sys/dev/sfxge/common/siena_vpd.c