Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
Re: fix ix(4) debug print macros
To:
tech@openbsd.org
Date:
Wed, 15 Apr 2026 14:11:07 +0200

Download raw body.

Thread
On Wed, Apr 15, 2026 at 11:24:52AM +0200, Stefan Sperling wrote:
> There is a compile-time "DBG" flag in ix(4) which currently breaks
> the kernel build when used.  This patch makes the driver compile and
> write debug prints to the console when DBG is set to 1 in ixgbe.h.
> 
> ok?
 
OK claudio@, please double check with deraadt@ if it is OK to land this
now.
  
> M  sys/dev/pci/ixgbe.h       |  7+  6-
> 
> 2 files changed, 15 insertions(+), 6 deletions(-)
> 
> commit - ab946df6cb598e553bc071f22fc89cf8e91816b5
> commit + 0a476a6204f89355668286102f028bdbed203b21
> blob - c6d7df95c9b232c66be8f1d2a1dfc02a8c54c178
> blob + 47752c7756cd132f308b8832782ed8f4d72894cb
> --- sys/dev/pci/ixgbe.h
> +++ sys/dev/pci/ixgbe.h
> @@ -94,9 +94,10 @@ typedef int	boolean_t;
>  	#define DEBUGOUT5(S,A,B,C,D,E)  printf(S "\n",A,B,C,D,E)
>  	#define DEBUGOUT6(S,A,B,C,D,E,F)  printf(S "\n",A,B,C,D,E,F)
>  	#define DEBUGOUT7(S,A,B,C,D,E,F,G)  printf(S "\n",A,B,C,D,E,F,G)
> -	#define ERROR_REPORT1(S,A)      printf(S "\n",A)
> -	#define ERROR_REPORT2(S,A,B)    printf(S "\n",A,B)
> -	#define ERROR_REPORT3(S,A,B,C)  printf(S "\n",A,B,C)
> +	/* Error reports use an error category code C, which we ignore. */
> +	#define ERROR_REPORT1(C,S)         printf(S "\n")
> +	#define ERROR_REPORT2(C,S,A...)    printf(S "\n",A)
> +	#define ERROR_REPORT3(C,S,A,B...)  printf(S "\n",A,B)
>  #else
>  	#define DEBUGOUT(S)
>  	#define DEBUGOUT1(S,A)
> @@ -107,9 +108,9 @@ typedef int	boolean_t;
>  	#define DEBUGOUT6(S,A,B,C,D,E,F)
>  	#define DEBUGOUT7(S,A,B,C,D,E,F,G)
>  
> -	#define ERROR_REPORT1(S,A)
> -	#define ERROR_REPORT2(S,A,B)
> -	#define ERROR_REPORT3(S,A,B,C)
> +	#define ERROR_REPORT1(C,S)
> +	#define ERROR_REPORT2(C,S,A)
> +	#define ERROR_REPORT3(C,S,A,B)
>  #endif
>  
>  #define FALSE		    		0
> blob - 2817be783c13a0f867e03c8bd061f3ff5c6d1ee7
> blob + d3bb0972f846cabba47c325534f487f0584a865f
> --- sys/dev/pci/ixgbe_type.h
> +++ sys/dev/pci/ixgbe_type.h
> @@ -77,6 +77,14 @@
>   * invalid argument, but for when something has occurred that is unsupported
>   * (Ex: Flow control autonegotiation or an unsupported SFP+ module.)
>   */
> +enum {
> +	IXGBE_ERROR_SOFTWARE,
> +	IXGBE_ERROR_POLLING,
> +	IXGBE_ERROR_INVALID_STATE,
> +	IXGBE_ERROR_UNSUPPORTED,
> +	IXGBE_ERROR_ARGUMENT,
> +	IXGBE_ERROR_CAUTION,
> +};
>  
>  /* Vendor ID */
>  #define IXGBE_INTEL_VENDOR_ID			0x8086
> 

-- 
:wq Claudio