Received: by 10.223.185.116 with SMTP id b49csp6179319wrg; Thu, 8 Mar 2018 03:13:23 -0800 (PST) X-Google-Smtp-Source: AG47ELuCvsT9w99haktKdJannuuOw6SLH6XenhYCVPwxHUX4nPwI82gI8j+mE+nUCB9+70XOFCN5 X-Received: by 10.99.173.3 with SMTP id g3mr21467516pgf.213.1520507603258; Thu, 08 Mar 2018 03:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520507603; cv=none; d=google.com; s=arc-20160816; b=PCU9uw9vNyubP0VA77LaLvrzBa4rGeF9zDg+p5cMJJHRVvoJZn0OBGtyh9GPGSqL51 eTGY/qi0vomkd8iuWrxlh4pQ4cXw0OL/3FYg5SodjnVknlh6zpYCxe1bocPjVl4M+i7M 5mA6RI6B6N4WRole4oetzdNGesGwTpKSIDP3vivxVgv96xPKZFE6kWFFz2XED/Zd2it+ OfmEXP/p3TPy5ZGBpBvjPySVis75eMkitebx+3qR/HuEDWy65r7V7QFE20Xou8mHMKp0 kbe5rQndMqCTNHtqcNbYP5ogzUCqE0UEznFO4hd4AbCZXpRuxMinVwgiXmS6Z+hOKjQI fcig== 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=zY+n2ocSTcbMAobrWftNPBnMW6J6iHTLV45SZRbUxQQ=; b=pN09wfZ9Lo07Tw5U2kV43eiayRlx9Rh3mSvjjkTh4X3ywKqIDh04NYy+cBjPMTu+Xf VHjuUXKrJzALBhOONGtXOXFjdwrGSwZO4frW/z/SNiqmmRvsO+Z3TYJS32A7jV/FSQH2 k0+xAsPMtFugY/iYv3JBx9qpkboYHBJ0avs/R6TOG6n5d4YZsisw/NPYb3IuRe/GP9kS C/OEraORVH/Z1cJmnRIE+zAIOr1Lc7jDG6FJclCWsVxkrEC4Mj8bV76MmkBIS3YhWIbZ Og2SsqnB7AtS9d2s9iJiI06UxEKjAxBH0NZOuG2lKpwz7Ezsjqy87Wo9fuW8StotBNrQ 9cGQ== 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 m12si12782894pgu.590.2018.03.08.03.13.09; Thu, 08 Mar 2018 03:13:23 -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 S1755907AbeCHLL2 (ORCPT + 99 others); Thu, 8 Mar 2018 06:11:28 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6203 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755818AbeCHLKW (ORCPT ); Thu, 8 Mar 2018 06:10:22 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 57BE88C182C53; Thu, 8 Mar 2018 19:10:03 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Thu, 8 Mar 2018 19:09:54 +0800 From: Peng Li To: CC: , , , , Subject: [Patch net-next 3/6] net: hns3: fix endian issue when PF get mbx message flag Date: Thu, 8 Mar 2018 19:41:52 +0800 Message-ID: <1520509315-40895-4-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520509315-40895-1-git-send-email-lipeng321@huawei.com> References: <1520509315-40895-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 6d48ebf..f332de6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -333,11 +333,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; @@ -412,6 +412,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