From patchwork Fri May 25 18:43:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 136986 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3945128lji; Fri, 25 May 2018 11:47:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrvQDMAZTVC1LQEVQWzuMvE+USjAgTMvcm0J7hPGeeFFIok9WF88kj2OUwqP6sFHSE08eAa X-Received: by 2002:a65:6101:: with SMTP id z1-v6mr2919979pgu.23.1527274022943; Fri, 25 May 2018 11:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527274022; cv=none; d=google.com; s=arc-20160816; b=niDk7CGR31CIOuOm/HSs18X/z7OXwP70CoE3q1OIYy1qvlfkZBJSWAuwicZDnLjHTD /sfbN3kmL28RcBUVJRgW2nzCF+eSI+lBZQ1jvK57QCgL3DV0b7WQjWMEySglFtP4Uc+U ZhwEm+JEoj/rfb/oKuufYuUWgcC0wFIDEmqTpjtu3bMsI0peUOC65j1Pq44S4Mz483Cp nRrVMT9jMqxgrEnh5LQ91vuDu2eA/3LN/nCEGMGeH4mcjAAlkW/xh/vzUecmk6kCV0LD 6g7QW0Z0aDG5zYtrpq9JsUBI5H3Qj3Z8jKbRJgc7tsryXMpuhEXVtl33El7t5g2oPor8 6HKg== 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=FEs8LJ/YQSJ4qexuWpSO9vtywiuVuk+EtqtIbtA/AKs=; b=1AorymJ2KL5f8dFPH1Q2Cuntgg0FKNxOafylpLuZKAYdZ+FwQIlLMcJdBwq6un/Cyo bh0ZdhjSnANmdA/gLyAasrFt5CDnqMYYNqZhM+fajEi+/siqDI9G6ZGWy6cXgvUIka5I cRI7LO5q/+OH6QE6OVFBozelae2vK1dWnMYQG74LINPXiaTDsx4r4uLOtJyKB54geg9d Ox6fFL4seD528pz+LMvRTs7F93WaIh5xFZsmv9vht9WritH34SoTlgsS1H3oyeBot06u 36omAd6jPcKVfxJ8SQzrru+GeJX3CVkemh0/wz1a5xsrf6s26exI0F+cnDR8NFxuo1qb OeRw== 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 p16-v6si19149091pgv.255.2018.05.25.11.47.02; Fri, 25 May 2018 11:47:02 -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 S968046AbeEYSo6 (ORCPT + 30 others); Fri, 25 May 2018 14:44:58 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:60913 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S967992AbeEYSoy (ORCPT ); Fri, 25 May 2018 14:44:54 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C146E6DC2FB76; Sat, 26 May 2018 02:44:51 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.382.0; Sat, 26 May 2018 02:44:42 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 07/12] net: hns3: Fixes the init of the VALID BD info in the descriptor Date: Fri, 25 May 2018 19:43:02 +0100 Message-ID: <20180525184307.36288-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180525184307.36288-1-salil.mehta@huawei.com> References: <20180525184307.36288-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang RX Buffer Descriptor contains a VALID bit which indicates if the BD is valid and has some data. This field is set by HNS3 hardware to intimate the driver of some valid data present in the BD. nd should be reset by the driver when BD is being used again. In the existing code this bit was not being (re-)initialized properly and hence was causing problems. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 1bcb676..d1ef104 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1819,6 +1819,7 @@ static void hns3_replace_buffer(struct hns3_enet_ring *ring, int i, hns3_unmap_buffer(ring, &ring->desc_cb[i]); ring->desc_cb[i] = *res_cb; ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma); + ring->desc[i].rx.bd_base_info = 0; } static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i) @@ -1826,6 +1827,7 @@ static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i) ring->desc_cb[i].reuse_flag = 0; ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma + ring->desc_cb[i].page_offset); + ring->desc[i].rx.bd_base_info = 0; } static void hns3_nic_reclaim_one_desc(struct hns3_enet_ring *ring, int *bytes,