Skip to contentSkip to conversation

cxgb4i: fix credit check for tx_data_wr

PATCH Superseded Karen Xie 1 participant 1 message Dec 10, 2014

Subsystems (4)

v6 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Karen Xie

author
#0 lore raw

PATCH v6 2/7 cxgb4i: fix credit check for tx_data_wr

[PATCH net v6 2/7] cxgb4i: fix credit check for tx_data_wr

From: Karen Xie <[email protected]>

make sure any tx credit related checking is done before adding the wr header.

---
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +2 -1
index f119a67..abee611 100644
@@ -547,10 +547,11 @@ static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb,
 	struct fw_ofld_tx_data_wr *req;
 	unsigned int submode = cxgbi_skcb_ulp_mode(skb) & 3;
 	unsigned int wr_ulp_mode = 0;
+	bool imm = is_ofld_imm(skb);
 
 	req = (struct fw_ofld_tx_data_wr *)__skb_push(skb, sizeof(*req));
 
-	if (is_ofld_imm(skb)) {
+	if (imm) {
 		req->op_to_immdlen = htonl(FW_WR_OP(FW_OFLD_TX_DATA_WR) |
 					FW_WR_COMPL(1) |
 					FW_WR_IMMDLEN(dlen));