Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp538554imm; Wed, 4 Jul 2018 01:23:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeNT+7g5nWNcBDZcP2U/cow5IHnoFH6gdRqz0s7XlYwamwNKHsRyAS1akYtyXu9+jMInflS X-Received: by 2002:a63:383:: with SMTP id 125-v6mr1007718pgd.421.1530692598623; Wed, 04 Jul 2018 01:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530692598; cv=none; d=google.com; s=arc-20160816; b=U5dp7sIaDSsaQLtunioZytOpfROSUW4rFuR1gdrFQR9NTayWjWW0E8cbi4jVb1o3/J fKOyTQvO7joCPnJ7AXqLgvyxHVS/QpSJffMmlWFln1RdVNr/FHqZJmpRz+UPVTqk7/TX kJVbIeuXurnNhhPjX0G0qz3wGb2xUZzjlSVVsevaO8oUxpu/keNTVBWshUG9ObjLnT7k /jO3DKHgU3UC5xb8k343zoXCCP2T++N9UeRYe6HhGh0JXBOSjJZP4tTOrQFYE93Z1P64 BW8/TqXf82okBcu8p11cYrlJF8Y2DsMukPcnn9d1KR87F/buO4eX0I/oanKAlBCL/vRB 6X4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:arc-authentication-results; bh=DTueMVGbDZx9Zt68IMMI0PmQ0k3NttKzT2gPwhD6hXE=; b=gifkmK7aHKgXMSlhIFzSWMMnoDqVaZGdzDS3193l1oLRbTIe48Dqo7Rm+6tH1XozsN c3oIf20qYM9WJR0S8bAXcXmg8YeCk8cVLz0ol2ez/gnn1JLqpQYKk22Yz+skAQrelb/0 kn8iU58xnbiWAhYpIYrF/OhfRaYVHltF/lKWYSboGfVFPwfhSK+8W1XU/wawsKd+VkPA gG2L7arTMISH+5KzQEZICJErqpm8tYKa7SDw4gwxPi/LSiCKbOSIMBRlizOxjY06bsD9 KJOUq9ZQA3Ho5UfVZjP1gHYqEUq8S6o3hEJoskdXEqN3CAmFLEuNiVWx8o493zD29YTG H10Q== 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 t6-v6si2873739plo.508.2018.07.04.01.23.03; Wed, 04 Jul 2018 01:23:18 -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 S933897AbeGDIVj (ORCPT + 99 others); Wed, 4 Jul 2018 04:21:39 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:4085 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932319AbeGDIVh (ORCPT ); Wed, 4 Jul 2018 04:21:37 -0400 X-IronPort-AV: E=Sophos;i="5.49,502,1520924400"; d="scan'208";a="13186508" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 04 Jul 2018 01:21:36 -0700 Received: from [10.145.6.82] (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.352.0; Wed, 4 Jul 2018 01:21:35 -0700 From: Claudiu Beznea Subject: Re: [RFC PATCH 1/2] net: macb: Free RX ring for all queues To: Harini Katakam , , CC: , , , References: <1530286269-32235-1-git-send-email-harini.katakam@xilinx.com> Message-ID: <6afc95e7-1756-41b1-38b9-e503d9016298@microchip.com> Date: Wed, 4 Jul 2018 11:21:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1530286269-32235-1-git-send-email-harini.katakam@xilinx.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29.06.2018 18:31, Harini Katakam wrote: > rx ring is allocated for all queues in macb_alloc_consistent. > Free the same for all queues instead of just Q0. > > Signed-off-by: Harini Katakam Reviewed-by: Claudiu Beznea > --- > drivers/net/ethernet/cadence/macb_main.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c > index 3e93df5..e56ffa9 100644 > --- a/drivers/net/ethernet/cadence/macb_main.c > +++ b/drivers/net/ethernet/cadence/macb_main.c > @@ -1812,13 +1812,7 @@ static void macb_free_consistent(struct macb *bp) > struct macb_queue *queue; > unsigned int q; > > - queue = &bp->queues[0]; > bp->macbgem_ops.mog_free_rx_buffers(bp); > - if (queue->rx_ring) { > - dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES(bp), > - queue->rx_ring, queue->rx_ring_dma); > - queue->rx_ring = NULL; > - } > > for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) { > kfree(queue->tx_skb); > @@ -1828,6 +1822,11 @@ static void macb_free_consistent(struct macb *bp) > queue->tx_ring, queue->tx_ring_dma); > queue->tx_ring = NULL; > } > + if (queue->rx_ring) { > + dma_free_coherent(&bp->pdev->dev, RX_RING_BYTES(bp), > + queue->rx_ring, queue->rx_ring_dma); > + queue->rx_ring = NULL; > + } > } > } > >