All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Cc: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Nadav Haklai <nadavh@marvell.com>,
	Hanna Hawa <hannah@marvell.com>,
	Yehuda Yitschak <yehuday@marvell.com>,
	linux-arm-kernel@lists.infradead.org,
	Stefan Chulski <stefanc@marvell.com>,
	Marcin Wojtas <mw@semihalf.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: [PATCHv2 net-next 06/11] net: mvpp2: simplify mvpp2_bm_bufs_add()
Date: Wed, 28 Dec 2016 17:46:02 +0100	[thread overview]
Message-ID: <1482943567-12483-7-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1482943567-12483-1-git-send-email-thomas.petazzoni@free-electrons.com>

The mvpp2_bm_bufs_add() currently creates a fake cookie by calling
mvpp2_bm_cookie_pool_set(), just to be able to call
mvpp2_pool_refill(). But all what mvpp2_pool_refill() does is extract
the pool ID from the cookie, and call mvpp2_bm_pool_put() with this ID.

Instead of doing this convoluted thing, just call mvpp2_bm_pool_put()
directly, since we have the BM pool ID.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index bfa9f77..8174f40 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -3626,7 +3626,6 @@ static int mvpp2_bm_bufs_add(struct mvpp2_port *port,
 {
 	struct sk_buff *skb;
 	int i, buf_size, total_size;
-	u32 bm;
 	dma_addr_t phys_addr;
 
 	buf_size = MVPP2_RX_BUF_SIZE(bm_pool->pkt_size);
@@ -3640,13 +3639,12 @@ static int mvpp2_bm_bufs_add(struct mvpp2_port *port,
 		return 0;
 	}
 
-	bm = mvpp2_bm_cookie_pool_set(0, bm_pool->id);
 	for (i = 0; i < buf_num; i++) {
 		skb = mvpp2_skb_alloc(port, bm_pool, &phys_addr, GFP_KERNEL);
 		if (!skb)
 			break;
 
-		mvpp2_pool_refill(port, bm, (u32)phys_addr, (u32)skb);
+		mvpp2_bm_pool_put(port, bm_pool->id, (u32)phys_addr, (u32)skb);
 	}
 
 	/* Update BM driver with number of buffers added to pool */
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 net-next 06/11] net: mvpp2: simplify mvpp2_bm_bufs_add()
Date: Wed, 28 Dec 2016 17:46:02 +0100	[thread overview]
Message-ID: <1482943567-12483-7-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1482943567-12483-1-git-send-email-thomas.petazzoni@free-electrons.com>

The mvpp2_bm_bufs_add() currently creates a fake cookie by calling
mvpp2_bm_cookie_pool_set(), just to be able to call
mvpp2_pool_refill(). But all what mvpp2_pool_refill() does is extract
the pool ID from the cookie, and call mvpp2_bm_pool_put() with this ID.

Instead of doing this convoluted thing, just call mvpp2_bm_pool_put()
directly, since we have the BM pool ID.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index bfa9f77..8174f40 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -3626,7 +3626,6 @@ static int mvpp2_bm_bufs_add(struct mvpp2_port *port,
 {
 	struct sk_buff *skb;
 	int i, buf_size, total_size;
-	u32 bm;
 	dma_addr_t phys_addr;
 
 	buf_size = MVPP2_RX_BUF_SIZE(bm_pool->pkt_size);
@@ -3640,13 +3639,12 @@ static int mvpp2_bm_bufs_add(struct mvpp2_port *port,
 		return 0;
 	}
 
-	bm = mvpp2_bm_cookie_pool_set(0, bm_pool->id);
 	for (i = 0; i < buf_num; i++) {
 		skb = mvpp2_skb_alloc(port, bm_pool, &phys_addr, GFP_KERNEL);
 		if (!skb)
 			break;
 
-		mvpp2_pool_refill(port, bm, (u32)phys_addr, (u32)skb);
+		mvpp2_bm_pool_put(port, bm_pool->id, (u32)phys_addr, (u32)skb);
 	}
 
 	/* Update BM driver with number of buffers added to pool */
-- 
2.7.4

  parent reply	other threads:[~2016-12-28 16:46 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 16:45 [PATCHv2 net-next 00/11] net: mvpp2: misc improvements and preparation patches Thomas Petazzoni
2016-12-28 16:45 ` Thomas Petazzoni
2016-12-28 16:45 ` [PATCHv2 net-next 01/11] net: mvpp2: handle too large value handling in mvpp2_rx_pkts_coal_set() Thomas Petazzoni
2016-12-28 16:45   ` Thomas Petazzoni
2016-12-28 16:45 ` [PATCHv2 net-next 02/11] net: mvpp2: handle too large value in mvpp2_rx_time_coal_set() Thomas Petazzoni
2016-12-28 16:45   ` Thomas Petazzoni
2017-01-06 12:59   ` Russell King - ARM Linux
2017-01-06 12:59     ` Russell King - ARM Linux
2017-02-02 16:11     ` Thomas Petazzoni
2017-02-02 16:11       ` Thomas Petazzoni
2016-12-28 16:45 ` [PATCHv2 net-next 03/11] net: mvpp2: release reference to txq_cpu[] entry after unmapping Thomas Petazzoni
2016-12-28 16:45   ` Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 04/11] net: mvpp2: remove unused 'tx_skb' field of 'struct mvpp2_tx_queue' Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 05/11] net: mvpp2: drop useless fields in mvpp2_bm_pool and related code Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2016-12-28 16:46 ` Thomas Petazzoni [this message]
2016-12-28 16:46   ` [PATCHv2 net-next 06/11] net: mvpp2: simplify mvpp2_bm_bufs_add() Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 07/11] net: mvpp2: remove unused register definitions Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 08/11] net: mvpp2: fix indentation of MVPP2_EXT_GLOBAL_CTRL_DEFAULT Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 09/11] net: mvpp2: simplify MVPP2_PRS_RI_* definitions Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2017-01-06 13:07   ` Russell King - ARM Linux
2017-01-06 13:07     ` Russell King - ARM Linux
2017-02-02 16:11     ` Thomas Petazzoni
2017-02-02 16:11       ` Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 10/11] net: mvpp2: switch to build_skb() in the RX path Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2016-12-28 16:46 ` [PATCHv2 net-next 11/11] net: mvpp2: enable building on 64-bit platforms Thomas Petazzoni
2016-12-28 16:46   ` Thomas Petazzoni
2016-12-29 17:03 ` [PATCHv2 net-next 00/11] net: mvpp2: misc improvements and preparation patches David Miller
2016-12-29 17:03   ` David Miller
2017-02-02 16:12   ` Thomas Petazzoni
2017-02-02 16:12     ` Thomas Petazzoni

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=1482943567-12483-7-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gregory.clement@free-electrons.com \
    --cc=hannah@marvell.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=stefanc@marvell.com \
    --cc=yehuday@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.