From ab72be51e224d764d60aea8f42d7c58fa7e73270 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:50:48 +0000 Subject: [PATCH] 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 Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8933 --- sys/dev/sfxge/common/medford_nic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/sfxge/common/medford_nic.c b/sys/dev/sfxge/common/medford_nic.c index dbcd99e611a..ea937e47a10 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 */