summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2017-01-02 09:24:19 +0000
committerarybchik <arybchik@FreeBSD.org>2017-01-02 09:24:19 +0000
commitbeaa24a1adc5e0fcea5f715133917ec94cb66ae4 (patch)
tree06133866f88a3318e35de5a75a50e35d2b53c439
parentee33487d5892c8877b110c6c2edda02825bd1d0e (diff)
downloadFreeBSD-src-beaa24a1adc5e0fcea5f715133917ec94cb66ae4.zip
FreeBSD-src-beaa24a1adc5e0fcea5f715133917ec94cb66ae4.tar.gz
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.
-rw-r--r--sys/dev/sfxge/common/medford_nic.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/sfxge/common/medford_nic.c b/sys/dev/sfxge/common/medford_nic.c
index dbcd99e..ea937e4 100644
--- a/sys/dev/sfxge/common/medford_nic.c
+++ b/sys/dev/sfxge/common/medford_nic.c
@@ -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 */
OpenPOWER on IntegriCloud