Netdev List
 help / color / mirror / Atom feed
From: Yuval Mintz <Yuval.Mintz@cavium.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>,
	Yuval Mintz <Yuval.Mintz@cavium.com>
Subject: [PATCH net-next 03/10] qede: Add missing Status-block free
Date: Sun, 21 May 2017 12:10:54 +0300	[thread overview]
Message-ID: <1495357860-28280-4-git-send-email-Yuval.Mintz@cavium.com> (raw)
In-Reply-To: <1495357860-28280-1-git-send-email-Yuval.Mintz@cavium.com>

From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>

When destroying the datapath channels, qede doesn't notify qed of the
released status blocks which were acquired during the initialization.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
 drivers/net/ethernet/qlogic/qede/qede_main.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 766bd37..aea9dcf 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -1072,12 +1072,15 @@ static int qede_set_num_queues(struct qede_dev *edev)
 	return rc;
 }
 
-static void qede_free_mem_sb(struct qede_dev *edev,
-			     struct qed_sb_info *sb_info)
+static void qede_free_mem_sb(struct qede_dev *edev, struct qed_sb_info *sb_info,
+			     u16 sb_id)
 {
-	if (sb_info->sb_virt)
+	if (sb_info->sb_virt) {
+		edev->ops->common->sb_release(edev->cdev, sb_info, sb_id);
 		dma_free_coherent(&edev->pdev->dev, sizeof(*sb_info->sb_virt),
 				  (void *)sb_info->sb_virt, sb_info->sb_phys);
+		memset(sb_info, 0, sizeof(*sb_info));
+	}
 }
 
 /* This function allocates fast-path status block memory */
@@ -1334,7 +1337,7 @@ static int qede_alloc_mem_txq(struct qede_dev *edev, struct qede_tx_queue *txq)
 /* This function frees all memory of a single fp */
 static void qede_free_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp)
 {
-	qede_free_mem_sb(edev, fp->sb_info);
+	qede_free_mem_sb(edev, fp->sb_info, fp->id);
 
 	if (fp->type & QEDE_FASTPATH_RX)
 		qede_free_mem_rxq(edev, fp->rxq);
-- 
1.9.3

  parent reply	other threads:[~2017-05-21  9:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21  9:10 [PATCH net-next 00/10] qed/qede updates Yuval Mintz
2017-05-21  9:10 ` [PATCH net-next 01/10] qede: Allow WoL to activate by default Yuval Mintz
2017-05-21  9:10 ` [PATCH net-next 02/10] qede: Honor user request for Tx buffers Yuval Mintz
2017-05-21  9:10 ` Yuval Mintz [this message]
2017-05-21  9:10 ` [PATCH net-next 04/10] qede: Don't use an internal MAC field Yuval Mintz
2017-05-21  9:10 ` [PATCH net-next 05/10] qed: Revise alloc/setup/free flow Yuval Mintz
2017-05-21  9:10 ` [PATCH net-next 06/10] qed: Correct print in iscsi error-flow Yuval Mintz
2017-05-21  9:10 ` [PATCH net-next 07/10] qede: qedr closure after setting state Yuval Mintz
2017-05-21  9:10 ` [PATCH net-next 08/10] qed: Fix setting of Management bitfields Yuval Mintz
2017-05-21  9:11 ` [PATCH net-next 09/10] qede: Support 1G advertisment Yuval Mintz
2017-05-21 17:01 ` [PATCH net-next 00/10] qed/qede updates David Miller
2017-05-23  6:46   ` Mintz, Yuval

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=1495357860-28280-4-git-send-email-Yuval.Mintz@cavium.com \
    --to=yuval.mintz@cavium.com \
    --cc=Sudarsana.Kalluru@cavium.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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