From: aestrin Date: Mon, 26 Jan 2009 18:45:57 +0000 (+0000) Subject: [ipoib cm] Get send descriptors from preallocated pool. Update. added missing file. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=37ec75e2f33a22253b2d010c17ab8f0e6eb906ff;p=~shefty%2Frdma-win.git [ipoib cm] Get send descriptors from preallocated pool. Update. added missing file. git-svn-id: svn://openib.tc.cornell.edu/gen1@1885 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/ipoib_cm/kernel/ipoib_port.h b/branches/ipoib_cm/kernel/ipoib_port.h index b439cf11..38480bf5 100644 --- a/branches/ipoib_cm/kernel/ipoib_port.h +++ b/branches/ipoib_cm/kernel/ipoib_port.h @@ -72,7 +72,7 @@ #define IPOIB_RECV_FROM_PACKET( P ) \ (((void **)P->MiniportReservedEx)[1]) #define IPOIB_SEND_FROM_PACKET( P ) \ - (((send_buf_t**)P->MiniportReservedEx)[2]) + (((void **)P->MiniportReservedEx)[2]) #define IPOIB_PACKET_FROM_LIST_ITEM( I ) \ (PARENT_STRUCT( I, NDIS_PACKET, MiniportReservedEx )) #define IPOIB_LIST_ITEM_FROM_PACKET( P ) \ @@ -401,6 +401,7 @@ typedef enum __send_dir typedef struct _ipoib_send_desc { + cl_pool_item_t pool_item; NDIS_PACKET *p_pkt; ipoib_endpt_t *p_endpt; send_buf_t *p_buf; @@ -469,6 +470,9 @@ typedef struct _ipoib_send_mgr { atomic32_t depth; cl_qlist_t pending_list; + cl_spinlock_t desc_lock; + cl_qpool_t desc_pool; + } ipoib_send_mgr_t; /* @@ -792,4 +796,19 @@ __port_attr_to_mtu_size(uint32_t value) return 256; } } + +inline ipoib_send_desc_t* +ipoib_send_desc_mgr_get( + IN ipoib_port_t* const p_port ); + +void +ipoib_send_desc_mgr_put( + IN ipoib_port_t* const p_port, + IN ipoib_send_desc_t* const p_desc ); + +void +ipoib_send_desc_mgr_put_list( + IN ipoib_port_t* const p_port, + IN cl_qlist_t* const p_list ); + #endif /* _IPOIB_PORT_H_ */