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.
This commit is contained in:
arybchik 2016-01-14 15:55:54 +00:00
parent 2b0aa54bc8
commit 66f59d6040
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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);