summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorItay Gazit2011-02-07 08:39:59 +0100
committerMichael Brown2011-02-17 02:25:09 +0100
commit1b84a8044224906def9dd50f711e9b3ca4c5da6a (patch)
tree202137cf10494606d5bf39e7c045dc2da002bd3e /src
parent[hermon] Update PRM file with latest changes (diff)
downloadipxe-1b84a8044224906def9dd50f711e9b3ca4c5da6a.tar.gz
ipxe-1b84a8044224906def9dd50f711e9b3ca4c5da6a.tar.xz
ipxe-1b84a8044224906def9dd50f711e9b3ca4c5da6a.zip
[hermon] Use circular event queue
Avoid memory leak of untreated events by having circular event queue operation. Signed-off-by: Itay Gazit <itaygazit@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/infiniband/hermon.c12
-rw-r--r--src/drivers/infiniband/hermon.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index cba92cefe..6a1ca8e50 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -1778,7 +1778,9 @@ static int hermon_create_eq ( struct hermon *hermon ) {
/* Hand queue over to hardware */
memset ( &eqctx, 0, sizeof ( eqctx ) );
- MLX_FILL_1 ( &eqctx, 0, st, 0xa /* "Fired" */ );
+ MLX_FILL_2 ( &eqctx, 0,
+ st, 0xa /* "Fired" */,
+ oi, 1 );
MLX_FILL_1 ( &eqctx, 2,
page_offset, ( hermon_eq->mtt.page_offset >> 5 ) );
MLX_FILL_1 ( &eqctx, 3, log_eq_size, fls ( HERMON_NUM_EQES - 1 ) );
@@ -1831,8 +1833,7 @@ static void hermon_destroy_eq ( struct hermon *hermon ) {
int rc;
/* Unmap events from event queue */
- memset ( &mask, 0, sizeof ( mask ) );
- MLX_FILL_1 ( &mask, 1, port_state_change, 1 );
+ memset ( &mask, 0xff, sizeof ( mask ) );
if ( ( rc = hermon_cmd_map_eq ( hermon,
( HERMON_UNMAP_EQ | hermon_eq->eqn ),
&mask ) ) != 0 ) {
@@ -2879,6 +2880,11 @@ static int hermon_get_cap ( struct hermon *hermon ) {
( 1 << MLX_GET ( &dev_cap, log2_rsvd_cqs ) );
hermon->cap.cqc_entry_size = MLX_GET ( &dev_cap, cqc_entry_sz );
hermon->cap.reserved_eqs = MLX_GET ( &dev_cap, num_rsvd_eqs );
+ if ( hermon->cap.reserved_eqs == 0 ) {
+ /* Backward compatibility */
+ hermon->cap.reserved_eqs =
+ ( 1 << MLX_GET ( &dev_cap, log2_rsvd_eqs ) );
+ }
hermon->cap.eqc_entry_size = MLX_GET ( &dev_cap, eqc_entry_sz );
hermon->cap.reserved_mtts =
( 1 << MLX_GET ( &dev_cap, log2_rsvd_mtts ) );
diff --git a/src/drivers/infiniband/hermon.h b/src/drivers/infiniband/hermon.h
index 28ab34afa..865539365 100644
--- a/src/drivers/infiniband/hermon.h
+++ b/src/drivers/infiniband/hermon.h
@@ -724,7 +724,7 @@ struct hermon_event_queue {
*
* This is a policy decision.
*/
-#define HERMON_NUM_EQES 4
+#define HERMON_NUM_EQES 8
/** A Hermon resource bitmask */
typedef uint32_t hermon_bitmask_t;