]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
cxgb4i: fix credit check for tx_data_wr
authorKaren Xie <kxie@chelsio.com>
Fri, 12 Dec 2014 03:13:32 +0000 (19:13 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Dec 2014 16:22:29 +0000 (11:22 -0500)
make sure any tx credit related checking is done before adding the wr header.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c

index 8abe8a303386a43bad1a62e38f9e59cbf0235d0d..197d7de189fb74e2c270bd89132a5b3f0b132b22 100644 (file)
@@ -549,10 +549,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, val;
+       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_V(FW_OFLD_TX_DATA_WR) |
                                        FW_WR_COMPL_F |
                                        FW_WR_IMMDLEN_V(dlen));