All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] dpaa2-eth: add rx copybreak support
@ 2021-04-01 16:39 Ioana Ciornei
  2021-04-01 16:39 ` [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf Ioana Ciornei
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ioana Ciornei @ 2021-04-01 16:39 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: ruxandra.radulescu, Ioana Ciornei

From: Ioana Ciornei <ioana.ciornei@nxp.com>

DMA unmapping, allocating a new buffer and DMA mapping it back on the
refill path is really not that efficient. Proper buffer recycling (page
pool, flipping the page and using the other half) cannot be done for
DPAA2 since it's not a ring based controller but it rather deals with
multiple queues which all get their buffers from the same buffer pool on
Rx.

To circumvent these limitations, add support for Rx copybreak in
dpaa2-eth.

Ioana Ciornei (3):
  dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf
  dpaa2-eth: add rx copybreak support
  dpaa2-eth: export the rx copybreak value as an ethtool tunable

 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 65 ++++++++++++++-----
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  | 10 ++-
 .../ethernet/freescale/dpaa2/dpaa2-ethtool.c  | 40 ++++++++++++
 3 files changed, 97 insertions(+), 18 deletions(-)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf
  2021-04-01 16:39 [PATCH net-next 0/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
@ 2021-04-01 16:39 ` Ioana Ciornei
  2021-04-01 23:42   ` Andrew Lunn
  2021-04-01 16:39 ` [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
  2021-04-01 16:39 ` [PATCH net-next 3/3] dpaa2-eth: export the rx copybreak value as an ethtool tunable Ioana Ciornei
  2 siblings, 1 reply; 11+ messages in thread
From: Ioana Ciornei @ 2021-04-01 16:39 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: ruxandra.radulescu, Ioana Ciornei

From: Ioana Ciornei <ioana.ciornei@nxp.com>

Rename the dpaa2_eth_xdp_release_buf function into dpaa2_eth_recycle_buf
since in the next patches we'll be using the same recycle mechanism for
the normal stack path beside for XDP_DROP.

Also, rename the array which holds the buffers to be recycled so that it
does not have any reference to XDP.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 26 +++++++++----------
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  |  6 +++--
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index fc0eb82cdd6a..f545cb99388a 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -223,31 +223,31 @@ static void dpaa2_eth_free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array,
 	}
 }
 
-static void dpaa2_eth_xdp_release_buf(struct dpaa2_eth_priv *priv,
-				      struct dpaa2_eth_channel *ch,
-				      dma_addr_t addr)
+static void dpaa2_eth_recycle_buf(struct dpaa2_eth_priv *priv,
+				  struct dpaa2_eth_channel *ch,
+				  dma_addr_t addr)
 {
 	int retries = 0;
 	int err;
 
-	ch->xdp.drop_bufs[ch->xdp.drop_cnt++] = addr;
-	if (ch->xdp.drop_cnt < DPAA2_ETH_BUFS_PER_CMD)
+	ch->recycled_bufs[ch->recycled_bufs_cnt++] = addr;
+	if (ch->recycled_bufs_cnt < DPAA2_ETH_BUFS_PER_CMD)
 		return;
 
 	while ((err = dpaa2_io_service_release(ch->dpio, priv->bpid,
-					       ch->xdp.drop_bufs,
-					       ch->xdp.drop_cnt)) == -EBUSY) {
+					       ch->recycled_bufs,
+					       ch->recycled_bufs_cnt)) == -EBUSY) {
 		if (retries++ >= DPAA2_ETH_SWP_BUSY_RETRIES)
 			break;
 		cpu_relax();
 	}
 
 	if (err) {
-		dpaa2_eth_free_bufs(priv, ch->xdp.drop_bufs, ch->xdp.drop_cnt);
-		ch->buf_count -= ch->xdp.drop_cnt;
+		dpaa2_eth_free_bufs(priv, ch->recycled_bufs, ch->recycled_bufs_cnt);
+		ch->buf_count -= ch->recycled_bufs_cnt;
 	}
 
-	ch->xdp.drop_cnt = 0;
+	ch->recycled_bufs_cnt = 0;
 }
 
 static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv,
@@ -300,7 +300,7 @@ static void dpaa2_eth_xdp_tx_flush(struct dpaa2_eth_priv *priv,
 		ch->stats.xdp_tx++;
 	}
 	for (i = enqueued; i < fq->xdp_tx_fds.num; i++) {
-		dpaa2_eth_xdp_release_buf(priv, ch, dpaa2_fd_get_addr(&fds[i]));
+		dpaa2_eth_recycle_buf(priv, ch, dpaa2_fd_get_addr(&fds[i]));
 		percpu_stats->tx_errors++;
 		ch->stats.xdp_tx_err++;
 	}
@@ -382,7 +382,7 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv,
 		trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act);
 		fallthrough;
 	case XDP_DROP:
-		dpaa2_eth_xdp_release_buf(priv, ch, addr);
+		dpaa2_eth_recycle_buf(priv, ch, addr);
 		ch->stats.xdp_drop++;
 		break;
 	case XDP_REDIRECT:
@@ -403,7 +403,7 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv,
 				free_pages((unsigned long)vaddr, 0);
 			} else {
 				ch->buf_count++;
-				dpaa2_eth_xdp_release_buf(priv, ch, addr);
+				dpaa2_eth_recycle_buf(priv, ch, addr);
 			}
 			ch->stats.xdp_drop++;
 		} else {
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index 9b6a89709ce1..9ba31c2706bb 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -438,8 +438,6 @@ struct dpaa2_eth_fq {
 
 struct dpaa2_eth_ch_xdp {
 	struct bpf_prog *prog;
-	u64 drop_bufs[DPAA2_ETH_BUFS_PER_CMD];
-	int drop_cnt;
 	unsigned int res;
 };
 
@@ -457,6 +455,10 @@ struct dpaa2_eth_channel {
 	struct dpaa2_eth_ch_xdp xdp;
 	struct xdp_rxq_info xdp_rxq;
 	struct list_head *rx_list;
+
+	/* Buffers to be recycled back in the buffer pool */
+	u64 recycled_bufs[DPAA2_ETH_BUFS_PER_CMD];
+	int recycled_bufs_cnt;
 };
 
 struct dpaa2_eth_dist_fields {
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support
  2021-04-01 16:39 [PATCH net-next 0/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
  2021-04-01 16:39 ` [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf Ioana Ciornei
@ 2021-04-01 16:39 ` Ioana Ciornei
  2021-04-01 18:49   ` Andrew Lunn
  2021-04-01 21:44     ` kernel test robot
  2021-04-01 16:39 ` [PATCH net-next 3/3] dpaa2-eth: export the rx copybreak value as an ethtool tunable Ioana Ciornei
  2 siblings, 2 replies; 11+ messages in thread
From: Ioana Ciornei @ 2021-04-01 16:39 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: ruxandra.radulescu, Ioana Ciornei

From: Ioana Ciornei <ioana.ciornei@nxp.com>

DMA unmapping, allocating a new buffer and DMA mapping it back on the
refill path is really not that efficient. Proper buffer recycling (page
pool, flipping the page and using the other half) cannot be done for
DPAA2 since it's not a ring based controller but it rather deals with
multiple queues which all get their buffers from the same buffer pool on
Rx.

To circumvent these limitations, add support for Rx copybreak. For small
sized packets instead of creating a skb around the buffer in which the
frame was received, allocate a new sk buffer altogether, copy the
contents of the frame and release the initial page back into the buffer
pool.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 36 +++++++++++++++++--
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  |  2 ++
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index f545cb99388a..200831b41078 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -418,6 +418,33 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv,
 	return xdp_act;
 }
 
+struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
+				    const struct dpaa2_fd *fd, void *fd_vaddr)
+{
+	u16 fd_offset = dpaa2_fd_get_offset(fd);
+	u32 fd_length = dpaa2_fd_get_len(fd);
+	struct sk_buff *skb = NULL;
+	unsigned int skb_len;
+
+	if (fd_length > DPAA2_ETH_DEFAULT_COPYBREAK)
+		return NULL;
+
+	skb_len = fd_length + dpaa2_eth_needed_headroom(NULL);
+
+	skb = napi_alloc_skb(&ch->napi, skb_len);
+	if (!skb)
+		return NULL;
+
+	skb_reserve(skb, dpaa2_eth_needed_headroom(NULL));
+	skb_put(skb, fd_length);
+
+	memcpy(skb->data, fd_vaddr + fd_offset, fd_length);
+
+	dpaa2_eth_recycle_buf(ch->priv, ch, dpaa2_fd_get_addr(fd));
+
+	return skb;
+}
+
 /* Main Rx frame processing routine */
 static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
 			 struct dpaa2_eth_channel *ch,
@@ -459,9 +486,12 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
 			return;
 		}
 
-		dma_unmap_page(dev, addr, priv->rx_buf_size,
-			       DMA_BIDIRECTIONAL);
-		skb = dpaa2_eth_build_linear_skb(ch, fd, vaddr);
+		skb = dpaa2_eth_copybreak(ch, fd, vaddr);
+		if (!skb) {
+			dma_unmap_page(dev, addr, priv->rx_buf_size,
+				       DMA_BIDIRECTIONAL);
+			skb = dpaa2_eth_build_linear_skb(ch, fd, vaddr);
+		}
 	} else if (fd_format == dpaa2_fd_sg) {
 		WARN_ON(priv->xdp_prog);
 
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index 9ba31c2706bb..f8d2b4769983 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -489,6 +489,8 @@ struct dpaa2_eth_trap_data {
 	struct dpaa2_eth_priv *priv;
 };
 
+#define DPAA2_ETH_DEFAULT_COPYBREAK	512
+
 /* Driver private data */
 struct dpaa2_eth_priv {
 	struct net_device *net_dev;
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net-next 3/3] dpaa2-eth: export the rx copybreak value as an ethtool tunable
  2021-04-01 16:39 [PATCH net-next 0/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
  2021-04-01 16:39 ` [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf Ioana Ciornei
  2021-04-01 16:39 ` [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
@ 2021-04-01 16:39 ` Ioana Ciornei
  2021-04-01 23:41   ` Andrew Lunn
  2 siblings, 1 reply; 11+ messages in thread
From: Ioana Ciornei @ 2021-04-01 16:39 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: ruxandra.radulescu, Ioana Ciornei

From: Ioana Ciornei <ioana.ciornei@nxp.com>

It's useful, especially for debugging purposes, to have the Rx copybreak
value changeable at runtime. Export it as an ethtool tunable.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  |  7 +++-
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  |  2 +
 .../ethernet/freescale/dpaa2/dpaa2-ethtool.c  | 40 +++++++++++++++++++
 3 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 200831b41078..e9d606f99377 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -422,11 +422,12 @@ struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
 				    const struct dpaa2_fd *fd, void *fd_vaddr)
 {
 	u16 fd_offset = dpaa2_fd_get_offset(fd);
+	struct dpaa2_eth_priv *priv = ch->priv;
 	u32 fd_length = dpaa2_fd_get_len(fd);
 	struct sk_buff *skb = NULL;
 	unsigned int skb_len;
 
-	if (fd_length > DPAA2_ETH_DEFAULT_COPYBREAK)
+	if (fd_length > priv->rx_copybreak)
 		return NULL;
 
 	skb_len = fd_length + dpaa2_eth_needed_headroom(NULL);
@@ -440,7 +441,7 @@ struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
 
 	memcpy(skb->data, fd_vaddr + fd_offset, fd_length);
 
-	dpaa2_eth_recycle_buf(ch->priv, ch, dpaa2_fd_get_addr(fd));
+	dpaa2_eth_recycle_buf(priv, ch, dpaa2_fd_get_addr(fd));
 
 	return skb;
 }
@@ -4332,6 +4333,8 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
 
 	skb_queue_head_init(&priv->tx_skbs);
 
+	priv->rx_copybreak = DPAA2_ETH_DEFAULT_COPYBREAK;
+
 	/* Obtain a MC portal */
 	err = fsl_mc_portal_allocate(dpni_dev, FSL_MC_IO_ATOMIC_CONTEXT_PORTAL,
 				     &priv->mc_io);
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index f8d2b4769983..cdb623d5f2c1 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -571,6 +571,8 @@ struct dpaa2_eth_priv {
 	struct devlink *devlink;
 	struct dpaa2_eth_trap_data *trap_data;
 	struct devlink_port devlink_port;
+
+	u32 rx_copybreak;
 };
 
 struct dpaa2_eth_devlink_priv {
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
index bf59708b869e..ad5e374eeccf 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
@@ -782,6 +782,44 @@ static int dpaa2_eth_get_ts_info(struct net_device *dev,
 	return 0;
 }
 
+static int dpaa2_eth_get_tunable(struct net_device *net_dev,
+				 const struct ethtool_tunable *tuna,
+				 void *data)
+{
+	struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
+	int err = 0;
+
+	switch (tuna->id) {
+	case ETHTOOL_RX_COPYBREAK:
+		*(u32 *)data = priv->rx_copybreak;
+		break;
+	default:
+		err = -EOPNOTSUPP;
+		break;
+	}
+
+	return err;
+}
+
+static int dpaa2_eth_set_tunable(struct net_device *net_dev,
+				 const struct ethtool_tunable *tuna,
+				 const void *data)
+{
+	struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
+	int err = 0;
+
+	switch (tuna->id) {
+	case ETHTOOL_RX_COPYBREAK:
+		priv->rx_copybreak = *(u32 *)data;
+		break;
+	default:
+		err = -EOPNOTSUPP;
+		break;
+	}
+
+	return err;
+}
+
 const struct ethtool_ops dpaa2_ethtool_ops = {
 	.get_drvinfo = dpaa2_eth_get_drvinfo,
 	.nway_reset = dpaa2_eth_nway_reset,
@@ -796,4 +834,6 @@ const struct ethtool_ops dpaa2_ethtool_ops = {
 	.get_rxnfc = dpaa2_eth_get_rxnfc,
 	.set_rxnfc = dpaa2_eth_set_rxnfc,
 	.get_ts_info = dpaa2_eth_get_ts_info,
+	.get_tunable = dpaa2_eth_get_tunable,
+	.set_tunable = dpaa2_eth_set_tunable,
 };
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support
  2021-04-01 16:39 ` [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
@ 2021-04-01 18:49   ` Andrew Lunn
  2021-04-01 20:13     ` Ioana Ciornei
  2021-04-01 21:44     ` kernel test robot
  1 sibling, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2021-04-01 18:49 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, kuba, netdev, ruxandra.radulescu, Ioana Ciornei

Hi Ioana

> +#define DPAA2_ETH_DEFAULT_COPYBREAK	512

This is quite big. A quick grep suggest other driver use 256.

Do you have some performance figures for this? 

   Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support
  2021-04-01 18:49   ` Andrew Lunn
@ 2021-04-01 20:13     ` Ioana Ciornei
  2021-04-01 20:19       ` Andrew Lunn
  0 siblings, 1 reply; 11+ messages in thread
From: Ioana Ciornei @ 2021-04-01 20:13 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Ioana Ciornei, davem, kuba, netdev, ruxandra.radulescu, Ioana Ciornei

On Thu, Apr 01, 2021 at 08:49:43PM +0200, Andrew Lunn wrote:
> Hi Ioana
> 
> > +#define DPAA2_ETH_DEFAULT_COPYBREAK	512
> 
> This is quite big. A quick grep suggest other driver use 256.
> 
> Do you have some performance figures for this? 
> 

Hi Andrew,

Yes, I did some tests which made me end up with this default value.

A bit about the setup - a LS2088A SoC, 8 x Cortex A72 @ 1.8GHz, IPfwd
zero loss test @ 20Gbit/s throughput.  I tested multiple frame sizes to
get an idea where is the break even point.

Here are 2 sets of results, (1) is the baseline and (2) is just
allocating a new skb for all frames sizes received (as if the copybreak
was even to the MTU). All numbers are in Mpps.

         64   128    256   512  640   768   896

(1)     3.23  3.23  3.24  3.21  3.1  2.76  2.71
(2)     3.95  3.88  3.79  3.62  3.3  3.02  2.65

It seems that even for 512 bytes frame sizes it's comfortably better when
allocating a new skb. After that, we see diminishing rewards or even worse.

Ioana


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support
  2021-04-01 20:13     ` Ioana Ciornei
@ 2021-04-01 20:19       ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2021-04-01 20:19 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, kuba, netdev, ruxandra.radulescu, Ioana Ciornei

On Thu, Apr 01, 2021 at 11:13:50PM +0300, Ioana Ciornei wrote:
> On Thu, Apr 01, 2021 at 08:49:43PM +0200, Andrew Lunn wrote:
> > Hi Ioana
> > 
> > > +#define DPAA2_ETH_DEFAULT_COPYBREAK	512
> > 
> > This is quite big. A quick grep suggest other driver use 256.
> > 
> > Do you have some performance figures for this? 
> > 
> 
> Hi Andrew,
> 
> Yes, I did some tests which made me end up with this default value.
> 
> A bit about the setup - a LS2088A SoC, 8 x Cortex A72 @ 1.8GHz, IPfwd
> zero loss test @ 20Gbit/s throughput.  I tested multiple frame sizes to
> get an idea where is the break even point.
> 
> Here are 2 sets of results, (1) is the baseline and (2) is just
> allocating a new skb for all frames sizes received (as if the copybreak
> was even to the MTU). All numbers are in Mpps.
> 
>          64   128    256   512  640   768   896
> 
> (1)     3.23  3.23  3.24  3.21  3.1  2.76  2.71
> (2)     3.95  3.88  3.79  3.62  3.3  3.02  2.65
> 
> It seems that even for 512 bytes frame sizes it's comfortably better when
> allocating a new skb. After that, we see diminishing rewards or even worse.

Nice. If you need to respin, consider putting this in patch 0/3.

      Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support
  2021-04-01 16:39 ` [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
@ 2021-04-01 21:44     ` kernel test robot
  2021-04-01 21:44     ` kernel test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kernel test robot @ 2021-04-01 21:44 UTC (permalink / raw)
  To: Ioana Ciornei, davem, kuba, netdev
  Cc: kbuild-all, ruxandra.radulescu, Ioana Ciornei

[-- Attachment #1: Type: text/plain, Size: 2529 bytes --]

Hi Ioana,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Ioana-Ciornei/dpaa2-eth-add-rx-copybreak-support/20210402-022225
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 040806343bb4ef6365166eae666ced8a91b95321
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0550b91894796909d20b7cfdcd4a751a49d708a3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ioana-Ciornei/dpaa2-eth-add-rx-copybreak-support/20210402-022225
        git checkout 0550b91894796909d20b7cfdcd4a751a49d708a3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:421:17: warning: no previous prototype for 'dpaa2_eth_copybreak' [-Wmissing-prototypes]
     421 | struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
         |                 ^~~~~~~~~~~~~~~~~~~


vim +/dpaa2_eth_copybreak +421 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

   420	
 > 421	struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
   422					    const struct dpaa2_fd *fd, void *fd_vaddr)
   423	{
   424		u16 fd_offset = dpaa2_fd_get_offset(fd);
   425		u32 fd_length = dpaa2_fd_get_len(fd);
   426		struct sk_buff *skb = NULL;
   427		unsigned int skb_len;
   428	
   429		if (fd_length > DPAA2_ETH_DEFAULT_COPYBREAK)
   430			return NULL;
   431	
   432		skb_len = fd_length + dpaa2_eth_needed_headroom(NULL);
   433	
   434		skb = napi_alloc_skb(&ch->napi, skb_len);
   435		if (!skb)
   436			return NULL;
   437	
   438		skb_reserve(skb, dpaa2_eth_needed_headroom(NULL));
   439		skb_put(skb, fd_length);
   440	
   441		memcpy(skb->data, fd_vaddr + fd_offset, fd_length);
   442	
   443		dpaa2_eth_recycle_buf(ch->priv, ch, dpaa2_fd_get_addr(fd));
   444	
   445		return skb;
   446	}
   447	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 76947 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support
@ 2021-04-01 21:44     ` kernel test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2021-04-01 21:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2595 bytes --]

Hi Ioana,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Ioana-Ciornei/dpaa2-eth-add-rx-copybreak-support/20210402-022225
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 040806343bb4ef6365166eae666ced8a91b95321
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0550b91894796909d20b7cfdcd4a751a49d708a3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ioana-Ciornei/dpaa2-eth-add-rx-copybreak-support/20210402-022225
        git checkout 0550b91894796909d20b7cfdcd4a751a49d708a3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:421:17: warning: no previous prototype for 'dpaa2_eth_copybreak' [-Wmissing-prototypes]
     421 | struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
         |                 ^~~~~~~~~~~~~~~~~~~


vim +/dpaa2_eth_copybreak +421 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

   420	
 > 421	struct sk_buff *dpaa2_eth_copybreak(struct dpaa2_eth_channel *ch,
   422					    const struct dpaa2_fd *fd, void *fd_vaddr)
   423	{
   424		u16 fd_offset = dpaa2_fd_get_offset(fd);
   425		u32 fd_length = dpaa2_fd_get_len(fd);
   426		struct sk_buff *skb = NULL;
   427		unsigned int skb_len;
   428	
   429		if (fd_length > DPAA2_ETH_DEFAULT_COPYBREAK)
   430			return NULL;
   431	
   432		skb_len = fd_length + dpaa2_eth_needed_headroom(NULL);
   433	
   434		skb = napi_alloc_skb(&ch->napi, skb_len);
   435		if (!skb)
   436			return NULL;
   437	
   438		skb_reserve(skb, dpaa2_eth_needed_headroom(NULL));
   439		skb_put(skb, fd_length);
   440	
   441		memcpy(skb->data, fd_vaddr + fd_offset, fd_length);
   442	
   443		dpaa2_eth_recycle_buf(ch->priv, ch, dpaa2_fd_get_addr(fd));
   444	
   445		return skb;
   446	}
   447	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 76947 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 3/3] dpaa2-eth: export the rx copybreak value as an ethtool tunable
  2021-04-01 16:39 ` [PATCH net-next 3/3] dpaa2-eth: export the rx copybreak value as an ethtool tunable Ioana Ciornei
@ 2021-04-01 23:41   ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2021-04-01 23:41 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, kuba, netdev, ruxandra.radulescu, Ioana Ciornei

On Thu, Apr 01, 2021 at 07:39:56PM +0300, Ioana Ciornei wrote:
> From: Ioana Ciornei <ioana.ciornei@nxp.com>
> 
> It's useful, especially for debugging purposes, to have the Rx copybreak
> value changeable at runtime. Export it as an ethtool tunable.
> 
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf
  2021-04-01 16:39 ` [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf Ioana Ciornei
@ 2021-04-01 23:42   ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2021-04-01 23:42 UTC (permalink / raw)
  To: Ioana Ciornei; +Cc: davem, kuba, netdev, ruxandra.radulescu, Ioana Ciornei

On Thu, Apr 01, 2021 at 07:39:54PM +0300, Ioana Ciornei wrote:
> From: Ioana Ciornei <ioana.ciornei@nxp.com>
> 
> Rename the dpaa2_eth_xdp_release_buf function into dpaa2_eth_recycle_buf
> since in the next patches we'll be using the same recycle mechanism for
> the normal stack path beside for XDP_DROP.
> 
> Also, rename the array which holds the buffers to be recycled so that it
> does not have any reference to XDP.
> 
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-01 23:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 16:39 [PATCH net-next 0/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
2021-04-01 16:39 ` [PATCH net-next 1/3] dpaa2-eth: rename dpaa2_eth_xdp_release_buf into dpaa2_eth_recycle_buf Ioana Ciornei
2021-04-01 23:42   ` Andrew Lunn
2021-04-01 16:39 ` [PATCH net-next 2/3] dpaa2-eth: add rx copybreak support Ioana Ciornei
2021-04-01 18:49   ` Andrew Lunn
2021-04-01 20:13     ` Ioana Ciornei
2021-04-01 20:19       ` Andrew Lunn
2021-04-01 21:44   ` kernel test robot
2021-04-01 21:44     ` kernel test robot
2021-04-01 16:39 ` [PATCH net-next 3/3] dpaa2-eth: export the rx copybreak value as an ethtool tunable Ioana Ciornei
2021-04-01 23:41   ` Andrew Lunn

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.