Browse Source

i40iw: Remove unnecessary check for moving CQ head

In i40iw_cq_poll_completion, we always move the tail. So there is
no reason to check for overflow everytime we move the head.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Mustafa Ismail 9 years ago
parent
commit
c5d057d32b
2 changed files with 4 additions and 5 deletions
  1. 3 0
      drivers/infiniband/hw/i40iw/i40iw_d.h
  2. 1 5
      drivers/infiniband/hw/i40iw/i40iw_uk.c

+ 3 - 0
drivers/infiniband/hw/i40iw/i40iw_d.h

@@ -1557,6 +1557,9 @@ enum i40iw_alignment {
 #define I40IW_RING_MOVE_TAIL(_ring) \
 #define I40IW_RING_MOVE_TAIL(_ring) \
 	(_ring).tail = ((_ring).tail + 1) % (_ring).size
 	(_ring).tail = ((_ring).tail + 1) % (_ring).size
 
 
+#define I40IW_RING_MOVE_HEAD_NOCHECK(_ring) \
+	(_ring).head = ((_ring).head + 1) % (_ring).size
+
 #define I40IW_RING_MOVE_TAIL_BY_COUNT(_ring, _count) \
 #define I40IW_RING_MOVE_TAIL_BY_COUNT(_ring, _count) \
 	(_ring).tail = ((_ring).tail + (_count)) % (_ring).size
 	(_ring).tail = ((_ring).tail + (_count)) % (_ring).size
 
 

+ 1 - 5
drivers/infiniband/hw/i40iw/i40iw_uk.c

@@ -761,7 +761,6 @@ static enum i40iw_status_code i40iw_cq_poll_completion(struct i40iw_cq_uk *cq,
 	struct i40iw_ring *pring = NULL;
 	struct i40iw_ring *pring = NULL;
 	u32 wqe_idx, q_type, array_idx = 0;
 	u32 wqe_idx, q_type, array_idx = 0;
 	enum i40iw_status_code ret_code = 0;
 	enum i40iw_status_code ret_code = 0;
-	enum i40iw_status_code ret_code2 = 0;
 	bool move_cq_head = true;
 	bool move_cq_head = true;
 	u8 polarity;
 	u8 polarity;
 	u8 addl_wqes = 0;
 	u8 addl_wqes = 0;
@@ -869,10 +868,7 @@ exit:
 			move_cq_head = false;
 			move_cq_head = false;
 
 
 	if (move_cq_head) {
 	if (move_cq_head) {
-		I40IW_RING_MOVE_HEAD(cq->cq_ring, ret_code2);
-
-		if (ret_code2 && !ret_code)
-			ret_code = ret_code2;
+		I40IW_RING_MOVE_HEAD_NOCHECK(cq->cq_ring);
 
 
 		if (I40IW_RING_GETCURRENT_HEAD(cq->cq_ring) == 0)
 		if (I40IW_RING_GETCURRENT_HEAD(cq->cq_ring) == 0)
 			cq->polarity ^= 1;
 			cq->polarity ^= 1;