From patchwork Tue Aug 14 16:13:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 144189 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4550972ljj; Tue, 14 Aug 2018 09:14:18 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzClCFqsQkSCxAGJu7yr/IiVzNGuTE4NCkigY1stuqgi9n7BJ3NpbF8QUzEw6hcQG4cZkf2 X-Received: by 2002:a17:902:262:: with SMTP id 89-v6mr20819647plc.221.1534263257969; Tue, 14 Aug 2018 09:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534263257; cv=none; d=google.com; s=arc-20160816; b=AaOuqpffcEW3n4MhDGh94tMrV+DXe5FRhiZ3/6bWsPFUKZQjR3PeaptfnUDYxEt9j1 bFxQb6dY8d3cF60kn/rTKsrDqHCfAnWGkmZBVUwi5KrjiWYNrjSBFf3eEpWM2H+cEhNh R6maCVyjBcI5iWbEgUex4lGPsmOrTSnunR/F3Jg0k5SAquNgRFaA7Y00ncpYNlrUqirX LRRSvOdqf78Ta1gP96X8nupCLpMxAUHzofc5OenUbCZpolXCHPm4BFkFpcBkvjADPPTr X7vOMIUKYvNd5iSMa+3oVE8Ggo9l2AbdvwPAe3tzqHb0uV8CgTyZ8sIuWGBcArX6n7tj x9Bg== 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=BCN2FHbfMuwYAfPukV+tUnWLaoLT2sRycOfykelZ/Zo=; b=wbjmxQO/WezaJ7lAFnzwGiOSkmGzknuzqnkNyLnonXK28ia3uayPVrvUX28qONUuUU VayCGoUBKm6Oi0mZOPAiBhfXZT7HAei3XdX6dgIgMNN5KKet3Vq/wuAgA0bSdIWPI/LD pZuOKYbvgUdjtJPZnYSgBTaqk1ytxloMcWAtBWtbRKB2H6lT/BXxZc9UWm7bYi4yANOB J4gPbL+h3hypPP8UD6ipcjexSo8bgEH4ygDTy+FCgsyJlCVxV5qzmRrgahbUXx5NpMR4 Pp+NEmBE/QlG401VlQsTmCI+U/n8qCqkGH5xTW7Vx/WEOv1Kc69TuMbY6DT9QAjMBone jlbA== 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 g12-v6si18813436pfh.346.2018.08.14.09.14.17; Tue, 14 Aug 2018 09:14:17 -0700 (PDT) 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 S1733000AbeHNTCD (ORCPT + 32 others); Tue, 14 Aug 2018 15:02:03 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10722 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732817AbeHNTCC (ORCPT ); Tue, 14 Aug 2018 15:02:02 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7065F6634A7DA; Wed, 15 Aug 2018 00:14:11 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.399.0; Wed, 15 Aug 2018 00:14:02 +0800 From: Salil Mehta To: CC: , , , , , , , Xi Wang Subject: [PATCH V2 net-next 2/8] net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero Date: Tue, 14 Aug 2018 17:13:13 +0100 Message-ID: <20180814161319.16392-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180814161319.16392-1-salil.mehta@huawei.com> References: <20180814161319.16392-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xi Wang According to the functional specification of hardware, the first descriptor of response from command 'lookup vlan talbe' is not valid. Currently, the first descriptor is parsed as normal value, which will cause an expected error. This patch fixes this problem by skipping the first descriptor. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 9209122..5f30ea4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3930,7 +3930,7 @@ static bool hclge_is_all_function_id_zero(struct hclge_desc *desc) #define HCLGE_FUNC_NUMBER_PER_DESC 6 int i, j; - for (i = 0; i < HCLGE_DESC_NUMBER; i++) + for (i = 1; i < HCLGE_DESC_NUMBER; i++) for (j = 0; j < HCLGE_FUNC_NUMBER_PER_DESC; j++) if (desc[i].data[j]) return false;