diff options
author | Andrew Rybchenko <arybchik@FreeBSD.org> | 2016-01-12 13:27:46 +0000 |
---|---|---|
committer | Andrew Rybchenko <arybchik@FreeBSD.org> | 2016-01-12 13:27:46 +0000 |
commit | b026a4006f9fd0ae15bb446d9daf6ee62ad43989 (patch) | |
tree | 1b0ef301370be17b6ef3cb94ad02b7a40d20b309 /sys | |
parent | e7119ad9ae3df4760e9bc0fac8f8066de65f718e (diff) | |
download | src-b026a4006f9fd0ae15bb446d9daf6ee62ad43989.tar.gz src-b026a4006f9fd0ae15bb446d9daf6ee62ad43989.zip |
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.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D4866
Notes
Notes:
svn path=/head/; revision=293749
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sfxge/common/efx.h | 1 | ||||
-rw-r--r-- | sys/dev/sfxge/common/hunt_nic.c | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h index 96fe401a1df1..d6e55acc79ce 100644 --- a/sys/dev/sfxge/common/efx.h +++ b/sys/dev/sfxge/common/efx.h @@ -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; diff --git a/sys/dev/sfxge/common/hunt_nic.c b/sys/dev/sfxge/common/hunt_nic.c index ba52d76a3327..3f86032918c1 100644 --- a/sys/dev/sfxge/common/hunt_nic.c +++ b/sys/dev/sfxge/common/hunt_nic.c @@ -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); |