net: hns3: set the cmdq out_vld bit to 0 after used
authorPeng Li <lipeng321@huawei.com>
Thu, 8 Mar 2018 11:41:51 +0000 (19:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Mar 2018 16:23:36 +0000 (11:23 -0500)
Driver check the out_vld bit when get a new cmdq BD, if the bit is 1,
the BD is valid. driver Should set the bit 0 after used and hw will
set the bit 1 if get a valid BD.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c

index 31383a6..6d48ebf 100644 (file)
@@ -410,6 +410,7 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
                                req->msg[0]);
                        break;
                }
+               crq->desc[crq->next_to_use].flag = 0;
                hclge_mbx_ring_ptr_move_crq(crq);
        }
 
index e39cad2..18283ef 100644 (file)
@@ -171,6 +171,7 @@ void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
                                req->msg[0]);
                        break;
                }
+               crq->desc[crq->next_to_use].flag = 0;
                hclge_mbx_ring_ptr_move_crq(crq);
                flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
        }