diff options
author | arybchik <arybchik@FreeBSD.org> | 2016-12-31 11:23:43 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2016-12-31 11:23:43 +0000 |
commit | f825fdc934af30b99c067c8e83ea88b4f24e7ea0 (patch) | |
tree | 319584ffc7f4ada8e7a1f180198d2ce5b75e5f74 /sys/dev/sfxge | |
parent | a47ce7f1d2decf095b19f452032ffadead3ca104 (diff) | |
download | FreeBSD-src-f825fdc934af30b99c067c8e83ea88b4f24e7ea0.zip FreeBSD-src-f825fdc934af30b99c067c8e83ea88b4f24e7ea0.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.
Diffstat (limited to 'sys/dev/sfxge')
-rw-r--r-- | sys/dev/sfxge/common/medford_nic.c | 9 |
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 */ |