netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: [PATCH net-next 3/8] dpaa2-eth: Move function
Date: Fri, 23 Nov 2018 16:56:33 +0000	[thread overview]
Message-ID: <1542992186-26028-4-git-send-email-ruxandra.radulescu@nxp.com> (raw)
In-Reply-To: <1542992186-26028-1-git-send-email-ruxandra.radulescu@nxp.com>

We'll use function free_bufs() on the XDP path as well, so move
it higher in order to avoid a forward declaration.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 34 ++++++++++++------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 5be3008..9ed4d8e 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -200,6 +200,23 @@ static struct sk_buff *build_frag_skb(struct dpaa2_eth_priv *priv,
 	return skb;
 }
 
+/* Free buffers acquired from the buffer pool or which were meant to
+ * be released in the pool
+ */
+static void free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array, int count)
+{
+	struct device *dev = priv->net_dev->dev.parent;
+	void *vaddr;
+	int i;
+
+	for (i = 0; i < count; i++) {
+		vaddr = dpaa2_iova_to_virt(priv->iommu_domain, buf_array[i]);
+		dma_unmap_single(dev, buf_array[i], DPAA2_ETH_RX_BUF_SIZE,
+				 DMA_FROM_DEVICE);
+		skb_free_frag(vaddr);
+	}
+}
+
 static u32 run_xdp(struct dpaa2_eth_priv *priv,
 		   struct dpaa2_eth_channel *ch,
 		   struct dpaa2_fd *fd, void *vaddr)
@@ -794,23 +811,6 @@ static int set_tx_csum(struct dpaa2_eth_priv *priv, bool enable)
 	return 0;
 }
 
-/* Free buffers acquired from the buffer pool or which were meant to
- * be released in the pool
- */
-static void free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array, int count)
-{
-	struct device *dev = priv->net_dev->dev.parent;
-	void *vaddr;
-	int i;
-
-	for (i = 0; i < count; i++) {
-		vaddr = dpaa2_iova_to_virt(priv->iommu_domain, buf_array[i]);
-		dma_unmap_single(dev, buf_array[i], DPAA2_ETH_RX_BUF_SIZE,
-				 DMA_FROM_DEVICE);
-		skb_free_frag(vaddr);
-	}
-}
-
 /* Perform a single release command to add buffers
  * to the specified buffer pool
  */
-- 
2.7.4

  parent reply	other threads:[~2018-11-24  3:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 16:56 [PATCH net-next 0/8] dpaa2-eth: Introduce XDP support Ioana Ciocoi Radulescu
2018-11-23 16:56 ` [PATCH net-next 1/8] dpaa2-eth: Add basic " Ioana Ciocoi Radulescu
2018-11-24 21:49   ` David Ahern
2018-11-26  7:32     ` Ioana Ciocoi Radulescu
2018-11-23 16:56 ` [PATCH net-next 2/8] dpaa2-eth: Allow XDP header adjustments Ioana Ciocoi Radulescu
2018-11-23 16:56 ` Ioana Ciocoi Radulescu [this message]
2018-11-23 16:56 ` [PATCH net-next 5/8] dpaa2-eth: Map Rx buffers as bidirectional Ioana Ciocoi Radulescu
2018-11-23 16:56 ` [PATCH net-next 4/8] dpaa2-eth: Release buffers back to pool on XDP_DROP Ioana Ciocoi Radulescu
2018-11-23 16:56 ` [PATCH net-next 6/8] dpaa2-eth: Add support for XDP_TX Ioana Ciocoi Radulescu
2018-11-23 16:56 ` [PATCH net-next 7/8] dpaa2-eth: Cleanup channel stats Ioana Ciocoi Radulescu
2018-11-23 16:56 ` [PATCH net-next 8/8] dpaa2-eth: Add xdp counters Ioana Ciocoi Radulescu

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=1542992186-26028-4-git-send-email-ruxandra.radulescu@nxp.com \
    --to=ruxandra.radulescu@nxp.com \
    --cc=davem@davemloft.net \
    --cc=ioana.ciornei@nxp.com \
    --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;
as well as URLs for NNTP newsgroup(s).