svn commit: r293983 - stable/10/sys/dev/sfxge/common
Andrew Rybchenko
arybchik at FreeBSD.org
Thu Jan 14 15:55:56 UTC 2016
Author: arybchik
Date: Thu Jan 14 15:55:54 2016
New Revision: 293983
URL: https://svnweb.freebsd.org/changeset/base/293983
Log:
MFC r293749
sfxge: use NIC config in place of some Huntington specific PIO constants
This should allow these functions to work for Medford as well.
Submitted by: Mark Spender <mspender at solarflare.com>
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
Modified:
stable/10/sys/dev/sfxge/common/efx.h
stable/10/sys/dev/sfxge/common/hunt_nic.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/sfxge/common/efx.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx.h Thu Jan 14 15:55:15 2016 (r293982)
+++ stable/10/sys/dev/sfxge/common/efx.h Thu Jan 14 15:55:54 2016 (r293983)
@@ -1128,6 +1128,7 @@ typedef struct efx_nic_cfg_s {
uint32_t enc_buftbl_limit;
uint32_t enc_piobuf_limit;
uint32_t enc_piobuf_size;
+ uint32_t enc_piobuf_min_alloc_size;
uint32_t enc_evq_timer_quantum_ns;
uint32_t enc_evq_timer_max_us;
uint32_t enc_clk_mult;
Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 15:55:15 2016 (r293982)
+++ stable/10/sys/dev/sfxge/common/hunt_nic.c Thu Jan 14 15:55:54 2016 (r293983)
@@ -768,6 +768,7 @@ hunt_nic_pio_alloc(
__out uint32_t *offsetp,
__out size_t *sizep)
{
+ efx_nic_cfg_t *encp = &enp->en_nic_cfg;
efx_drv_cfg_t *edcp = &enp->en_drv_cfg;
uint32_t blk_per_buf;
uint32_t buf, blk;
@@ -785,7 +786,7 @@ hunt_nic_pio_alloc(
rc = ENOMEM;
goto fail1;
}
- blk_per_buf = HUNT_PIOBUF_SIZE / edcp->edc_pio_alloc_size;
+ blk_per_buf = encp->enc_piobuf_size / edcp->edc_pio_alloc_size;
for (buf = 0; buf < enp->en_arch.ef10.ena_piobuf_count; buf++) {
uint32_t *map = &enp->en_arch.ef10.ena_pio_alloc_map[buf];
@@ -1260,6 +1261,7 @@ hunt_board_cfg(
encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS;
encp->enc_piobuf_size = HUNT_PIOBUF_SIZE;
+ encp->enc_piobuf_min_alloc_size = HUNT_MIN_PIO_ALLOC_SIZE;
/*
* Get the current privilege mask. Note that this may be modified
@@ -1470,7 +1472,8 @@ hunt_nic_set_drv_limits(
uint32_t blk_size, blk_count, blks_per_piobuf;
blk_size =
- MAX(edlp->edl_min_pio_alloc_size, HUNT_MIN_PIO_ALLOC_SIZE);
+ MAX(edlp->edl_min_pio_alloc_size,
+ encp->enc_piobuf_min_alloc_size);
blks_per_piobuf = encp->enc_piobuf_size / blk_size;
EFSYS_ASSERT3U(blks_per_piobuf, <=, 32);
More information about the svn-src-stable
mailing list