Author: arybchik
Date: Sat Jun  4 16:25:18 2016
New Revision: 301363
URL: https://svnweb.freebsd.org/changeset/base/301363

Log:
  MFC r299901
  
  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.

Modified:
  stable/10/sys/dev/sfxge/common/ef10_vpd.c
  stable/10/sys/dev/sfxge/common/efx_vpd.c
  stable/10/sys/dev/sfxge/common/siena_vpd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_vpd.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/ef10_vpd.c   Sat Jun  4 16:24:14 2016        
(r301362)
+++ stable/10/sys/dev/sfxge/common/ef10_vpd.c   Sat Jun  4 16:25:18 2016        
(r301363)
@@ -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);

Modified: stable/10/sys/dev/sfxge/common/efx_vpd.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_vpd.c    Sat Jun  4 16:24:14 2016        
(r301362)
+++ stable/10/sys/dev/sfxge/common/efx_vpd.c    Sat Jun  4 16:25:18 2016        
(r301363)
@@ -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);
 

Modified: stable/10/sys/dev/sfxge/common/siena_vpd.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/siena_vpd.c  Sat Jun  4 16:24:14 2016        
(r301362)
+++ stable/10/sys/dev/sfxge/common/siena_vpd.c  Sat Jun  4 16:25:18 2016        
(r301363)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to