IB/hfi1: Right size user_sdma sequence numbers and related variables
[linux-2.6-microblaze.git] / drivers / infiniband / hw / hfi1 / user_sdma.h
index d2bc77f..14dfd75 100644 (file)
@@ -105,9 +105,10 @@ static inline int ahg_header_set(u32 *arr, int idx, size_t array_size,
 #define TXREQ_FLAGS_REQ_ACK   BIT(0)      /* Set the ACK bit in the header */
 #define TXREQ_FLAGS_REQ_DISABLE_SH BIT(1) /* Disable header suppression */
 
-#define SDMA_PKT_Q_INACTIVE BIT(0)
-#define SDMA_PKT_Q_ACTIVE   BIT(1)
-#define SDMA_PKT_Q_DEFERRED BIT(2)
+enum pkt_q_sdma_state {
+       SDMA_PKT_Q_ACTIVE,
+       SDMA_PKT_Q_DEFERRED,
+};
 
 /*
  * Maximum retry attempts to submit a TX request
@@ -133,7 +134,7 @@ struct hfi1_user_sdma_pkt_q {
        struct user_sdma_request *reqs;
        unsigned long *req_in_use;
        struct iowait busy;
-       unsigned state;
+       enum pkt_q_sdma_state state;
        wait_queue_head_t wait;
        unsigned long unpinned;
        struct mmu_rb_handler *handler;
@@ -203,14 +204,12 @@ struct user_sdma_request {
        s8 ahg_idx;
 
        /* Writeable fields shared with interrupt */
-       u64 seqcomp ____cacheline_aligned_in_smp;
-       u64 seqsubmitted;
-       /* status of the last txreq completed */
-       int status;
+       u16 seqcomp ____cacheline_aligned_in_smp;
+       u16 seqsubmitted;
 
        /* Send side fields */
        struct list_head txps ____cacheline_aligned_in_smp;
-       u64 seqnum;
+       u16 seqnum;
        /*
         * KDETH.OFFSET (TID) field
         * The offset can cover multiple packets, depending on the
@@ -228,7 +227,6 @@ struct user_sdma_request {
        u16 tididx;
        /* progress index moving along the iovs array */
        u8 iov_idx;
-       u8 done;
        u8 has_error;
 
        struct user_sdma_iovec iovs[MAX_VECTORS_PER_REQ];
@@ -248,7 +246,7 @@ struct user_sdma_txreq {
        struct user_sdma_request *req;
        u16 flags;
        unsigned int busycount;
-       u64 seqnum;
+       u16 seqnum;
 };
 
 int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt,