Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3797158imm; Fri, 25 May 2018 11:49:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpy5k36p6qIxIjWYUIAdBECJFocdEHW2/ATMrbObu2Md2zt8iFZn+C35hT3YAnXh4lT5iCd X-Received: by 2002:a17:902:8647:: with SMTP id y7-v6mr3733404plt.86.1527274143746; Fri, 25 May 2018 11:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527274143; cv=none; d=google.com; s=arc-20160816; b=qj4Jx1Nmd0wOwYU63kE3s4QeXi9wnp6l3dU+xQkihA1sRDkxVZWmJDIUs0YaM3WSTh EtjtY4BGLiX8/XVFw5HdnCCO2lJMDQeJE8Yd/9Qi7Z7mh/ahXyJnzd8yA7Luy4sIIOxm 8VtkAav7emZJeI5Bgf+ILRRYY69ux1mRUo5n1EsLU1DtgyMzPmvz0nK03ywo7XLwNLeD HMXVPfsc8thZji57eXO9KfVSA1UUB8o7GgrS8/tRW5aPn7cUJnU/mGSWL4sN3HITMk7K oYc84pg1FKcmkt9FC47RDdfmEoSwjoNxUoh3TY/y0F3CYEVVuSljlUllMzmV7aXetjaz K1Vw== 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 j11-v6si23624050plt.325.2018.05.25.11.48.49; Fri, 25 May 2018 11:49:03 -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 S968037AbeEYSo6 (ORCPT + 99 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 Content-Type: text/plain 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(+) 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, -- 2.7.4