sfxge(4): cleanup: make VPD lookups quieter

A lookup on a VPD entry which is missing reports several failure
messages as it propagates through wrapper functions. Restructured
the wrappers to treat this gracefully as an expected case.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6366
This commit is contained in:
arybchik 2016-05-16 06:26:18 +00:00
parent c6df178a61
commit f5dfe729db
3 changed files with 14 additions and 3 deletions

View File

@ -332,8 +332,11 @@ ef10_vpd_get(
/* And then from the provided data buffer */
if ((rc = efx_vpd_hunk_get(data, size, evvp->evv_tag,
evvp->evv_keyword, &offset, &length)) != 0)
evvp->evv_keyword, &offset, &length)) != 0) {
if (rc == ENOENT)
return (rc);
goto fail2;
}
evvp->evv_length = length;
memcpy(evvp->evv_value, data + offset, length);

View File

@ -253,8 +253,12 @@ efx_vpd_get(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
if ((rc = evpdop->evpdo_get(enp, data, size, evvp)) != 0)
if ((rc = evpdop->evpdo_get(enp, data, size, evvp)) != 0) {
if (rc == ENOENT)
return (rc);
goto fail1;
}
return (0);

View File

@ -436,8 +436,12 @@ siena_vpd_get(
/* And then from the provided data buffer */
if ((rc = efx_vpd_hunk_get(data, size, evvp->evv_tag,
evvp->evv_keyword, &offset, &length)) != 0)
evvp->evv_keyword, &offset, &length)) != 0) {
if (rc == ENOENT)
return (rc);
goto fail2;
}
evvp->evv_length = length;
memcpy(evvp->evv_value, data + offset, length);