Netdev List
 help / color / mirror / Atom feed
From: Lipeng <lipeng321@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,
	<salil.mehta@huawei.com>, <lipeng321@huawei.com>
Subject: [PATCH net-next 1/7] net: hns3: fix a bug when alloc new buffer
Date: Mon, 23 Oct 2017 19:51:01 +0800	[thread overview]
Message-ID: <1508759467-18397-2-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1508759467-18397-1-git-send-email-lipeng321@huawei.com>

When alloce new buffer to HW, should unmap the old buffer first.
This old code map the old buffer but not unmap the old buffer,
this patch fixes it.

Fixes: 76ad4f0 (net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC)

Signed-off-by: Lipeng <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
index 8383d67..3ddcd47 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
@@ -1595,7 +1595,7 @@ static int hns3_alloc_ring_buffers(struct hns3_enet_ring *ring)
 static void hns3_replace_buffer(struct hns3_enet_ring *ring, int i,
 				struct hns3_desc_cb *res_cb)
 {
-	hns3_map_buffer(ring, &ring->desc_cb[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);
 }
-- 
1.9.1

  reply	other threads:[~2017-10-23 11:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 11:51 [PATCH net-next 0/7] net: hns3: bug fixes & code improvements Lipeng
2017-10-23 11:51 ` Lipeng [this message]
2017-10-23 11:51 ` [PATCH net-next 2/7] net: hns3: fix the bug when map buffer fail Lipeng
2017-10-23 11:51 ` [PATCH net-next 3/7] net: hns3: fix the ops check in hns3_get_rxnfc Lipeng
2017-10-23 11:51 ` [PATCH net-next 4/7] net: hns3: get vf count by pci_sriov_get_totalvfs Lipeng
2017-10-23 11:51 ` [PATCH net-next 5/7] net: hns3: fix the TX/RX ring.queue_index in hns3_ring_get_cfg Lipeng
2017-10-23 11:51 ` [PATCH net-next 6/7] net: hns3: remove redundant memset when alloc buffer Lipeng
2017-10-23 11:51 ` [PATCH net-next 7/7] net: hns3: fix a bug about hns3_clean_tx_ring Lipeng
2017-10-24  0:17 ` [PATCH net-next 0/7] net: hns3: bug fixes & code improvements David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1508759467-18397-2-git-send-email-lipeng321@huawei.com \
    --to=lipeng321@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox