Received: by 10.223.185.116 with SMTP id b49csp5789870wrg; Wed, 7 Mar 2018 18:44:08 -0800 (PST) X-Google-Smtp-Source: AG47ELthf/qpOn5k2ae4Mhk0Vv4NivIOT7MJGyHlE1ASTs50ZzkJPoQaL4SiJDA3HKg5ogW7n4rv X-Received: by 2002:a17:902:51e9:: with SMTP id y96-v6mr22587501plh.344.1520477048545; Wed, 07 Mar 2018 18:44:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520477048; cv=none; d=google.com; s=arc-20160816; b=iaZ9sMhEh63kOX4kmSPe+2KRtVOsT1YhLnFOkSso6sec1Ix91WGTsIKP1qsZ7B+t15 ZzcqtfsNys+OxpiePHDP0PqYKEElyVJkTeeTFf/fdWe2puwQ1kHETCHMcDkIEL9qmeID AG3jI4Rnn/fmHaRNMI98xE3MunCDkJ6d6RZ3Hess3en+0JU4TNIy7G/d49UbN1SOPmBw VIgdk0jOPleswKsrxxkf0QtrH9WslZUyJUPmb5/gIy1gCOaZkeaje6AsC8B3ddXI5Wqv 9IZn1A8/DQI1sAe2NDVNiFAEU/pw1wJoZnXcEJevuSEocKx0OdtX0Y7T9hlu7n73Cj9X Gqsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ymA2aKaZfb2h2RH/k+1g3Ne5OUCHHqPv3b/4/RllBxE=; b=nzVD29s/a7lbXw5NqEiIJSEo7ISZKUGUzR7xO0q8a3ECZvK7ppzsZAKMZ7AFjSwPOt iC2bOlxBaMX8avsuqlwjp06D5AKagaEHtQ3Av4TenDkiAdO0IRhfOW66yNaEXxVglDJj Gxb9wshIwhB7RxmLIprfSrVa3DJGtOEtbOcVDNV/jr7XUStczqtuzTz2DSBG93XBEF2O ++oob8tMEJqLRjh6JOagExCKWAVRjuD41BIeGuwJnZ6nD8AZ1Ne20zJzVmn1LIdDBwdC fVf6DGpeuZRIwI2r7j1DEesSc4ogsl9FgjByOQGvYwjSkgafXUdD1hofVbM3/1PECuT0 a/ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si10268806pfk.308.2018.03.07.18.43.54; Wed, 07 Mar 2018 18:44:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934856AbeCHCfA (ORCPT + 99 others); Wed, 7 Mar 2018 21:35:00 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5744 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934775AbeCHCe6 (ORCPT ); Wed, 7 Mar 2018 21:34:58 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7F6338E619962; Thu, 8 Mar 2018 10:34:43 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 8 Mar 2018 10:34:36 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 04/23] {topost} net: hns3: fix endian issue when PF get mbx message flag Date: Thu, 8 Mar 2018 11:06:29 +0800 Message-ID: <1520478408-116992-5-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520478408-116992-1-git-send-email-lipeng321@huawei.com> References: <1520478408-116992-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes the endian issue when PF get mbx message flag. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index 3a2c174..ed34ca3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -335,11 +335,11 @@ void hclge_mbx_handler(struct hclge_dev *hdev) struct hclge_mbx_vf_to_pf_cmd *req; struct hclge_vport *vport; struct hclge_desc *desc; - int ret; + int ret, flag; + flag = le16_to_cpu(crq->desc[crq->next_to_use].flag); /* handle all the mailbox requests in the queue */ - while (hnae_get_bit(crq->desc[crq->next_to_use].flag, - HCLGE_CMDQ_RX_OUTVLD_B)) { + while (hnae_get_bit(flag, HCLGE_CMDQ_RX_OUTVLD_B)) { desc = &crq->desc[crq->next_to_use]; req = (struct hclge_mbx_vf_to_pf_cmd *)desc->data; @@ -414,6 +414,7 @@ void hclge_mbx_handler(struct hclge_dev *hdev) } 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); } /* Write back CMDQ_RQ header pointer, M7 need this pointer */ -- 2.9.3