Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2016 11:23:43 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r310941 - stable/11/sys/dev/sfxge/common
Message-ID:  <201612311123.uBVBNhAZ050212@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Sat Dec 31 11:23:43 2016
New Revision: 310941
URL: https://svnweb.freebsd.org/changeset/base/310941

Log:
  MFC r310715
  
  sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford
  
  On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end
  padding setting is in the ADMIN group, and so fails for
  unprivileged functions. In that case, assume the largest size
  supported by Medford hardware (256bytes) to prevent overrun.
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/medford_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/medford_nic.c
==============================================================================
--- stable/11/sys/dev/sfxge/common/medford_nic.c	Sat Dec 31 11:23:03 2016	(r310940)
+++ stable/11/sys/dev/sfxge/common/medford_nic.c	Sat Dec 31 11:23:43 2016	(r310941)
@@ -289,8 +289,13 @@ medford_board_cfg(
 	encp->enc_rx_buf_align_start = 1;
 
 	/* Get the RX DMA end padding alignment configuration */
-	if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0)
-		goto fail11;
+	if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) {
+		if (rc != EACCES)
+			goto fail11;
+
+		/* Assume largest tail padding size supported by hardware */
+		end_padding = 256;
+	}
 	encp->enc_rx_buf_align_end = end_padding;
 
 	/* Alignment for WPTR updates */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612311123.uBVBNhAZ050212>