From owner-svn-src-head@freebsd.org Wed Dec 28 17:50:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CD3C9522A; Wed, 28 Dec 2016 17:50:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0736813A3; Wed, 28 Dec 2016 17:50:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSHomgj020835; Wed, 28 Dec 2016 17:50:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSHomXd020834; Wed, 28 Dec 2016 17:50:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612281750.uBSHomXd020834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 28 Dec 2016 17:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310715 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 17:50:49 -0000 Author: arybchik Date: Wed Dec 28 17:50:48 2016 New Revision: 310715 URL: https://svnweb.freebsd.org/changeset/base/310715 Log: 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 Modified: head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 17:49:33 2016 (r310714) +++ head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 17:50:48 2016 (r310715) @@ -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 */