linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] fixup AVE ethernet driver
@ 2018-11-29  8:08 Kunihiko Hayashi
  2018-11-29  8:08 ` [PATCH net 1/3] net: ethernet: ave: Increase descriptors to improve performance Kunihiko Hayashi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2018-11-29  8:08 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Kunihiko Hayashi

This series adds fixup for AVE ethernet driver that includes increse of
descriptors, replacing macro for linux-next, and adding missing author
information.

Kunihiko Hayashi (3):
  net: ethernet: ave: Increase descriptors to improve performance
  net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM
  net: ethernet: ave: Add MODULE_AUTHOR and MAINTAINERS entry

 MAINTAINERS                              |  7 +++++++
 drivers/net/ethernet/socionext/sni_ave.c | 24 ++++++++++++++----------
 2 files changed, 21 insertions(+), 10 deletions(-)

-- 
2.7.4


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

* [PATCH net 1/3] net: ethernet: ave: Increase descriptors to improve performance
  2018-11-29  8:08 [PATCH net 0/3] fixup AVE ethernet driver Kunihiko Hayashi
@ 2018-11-29  8:08 ` Kunihiko Hayashi
  2018-11-29  8:08 ` [PATCH net 2/3] net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM Kunihiko Hayashi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2018-11-29  8:08 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Kunihiko Hayashi

To improve performance, this increases Rx descriptor to 256, Tx descriptor
to 64, and adjusts NAPI weight to NAPI_POLL_WEIGHT.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/net/ethernet/socionext/sni_ave.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 8c1e120..598b963 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -185,8 +185,8 @@
 				 NETIF_MSG_TX_ERR)
 
 /* Parameter for descriptor */
-#define AVE_NR_TXDESC		32	/* Tx descriptor */
-#define AVE_NR_RXDESC		64	/* Rx descriptor */
+#define AVE_NR_TXDESC		64	/* Tx descriptor */
+#define AVE_NR_RXDESC		256	/* Rx descriptor */
 
 #define AVE_DESC_OFS_CMDSTS	0
 #define AVE_DESC_OFS_ADDRL	4
@@ -1694,9 +1694,10 @@ static int ave_probe(struct platform_device *pdev)
 		 pdev->name, pdev->id);
 
 	/* Register as a NAPI supported driver */
-	netif_napi_add(ndev, &priv->napi_rx, ave_napi_poll_rx, priv->rx.ndesc);
+	netif_napi_add(ndev, &priv->napi_rx, ave_napi_poll_rx,
+		       NAPI_POLL_WEIGHT);
 	netif_tx_napi_add(ndev, &priv->napi_tx, ave_napi_poll_tx,
-			  priv->tx.ndesc);
+			  NAPI_POLL_WEIGHT);
 
 	platform_set_drvdata(pdev, ndev);
 
-- 
2.7.4


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

* [PATCH net 2/3] net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM
  2018-11-29  8:08 [PATCH net 0/3] fixup AVE ethernet driver Kunihiko Hayashi
  2018-11-29  8:08 ` [PATCH net 1/3] net: ethernet: ave: Increase descriptors to improve performance Kunihiko Hayashi
@ 2018-11-29  8:08 ` Kunihiko Hayashi
  2018-11-29  8:08 ` [PATCH net 3/3] net: ethernet: ave: Add MODULE_AUTHOR and MAINTAINERS entry Kunihiko Hayashi
  2018-11-29 18:39 ` [PATCH net 0/3] fixup AVE ethernet driver David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2018-11-29  8:08 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Kunihiko Hayashi

In commit 26a4676faa1a ("arm64: mm: define NET_IP_ALIGN to 0"),
AVE controller affects this modification because the controller forces
to ignore lower 2bits of buffer start address, and make 2-byte headroom,
that is, data reception starts from (buffer + 2).

This patch defines AVE_FRAME_HEADROOM macro as hardware-specific value,
and replaces NET_IP_ALIGN with it.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/net/ethernet/socionext/sni_ave.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 598b963..6710151 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -194,6 +194,7 @@
 
 /* Parameter for ethernet frame */
 #define AVE_MAX_ETHFRAME	1518
+#define AVE_FRAME_HEADROOM	2
 
 /* Parameter for interrupt */
 #define AVE_INTM_COUNT		20
@@ -577,12 +578,13 @@ static int ave_rxdesc_prepare(struct net_device *ndev, int entry)
 
 	skb = priv->rx.desc[entry].skbs;
 	if (!skb) {
-		skb = netdev_alloc_skb_ip_align(ndev,
-						AVE_MAX_ETHFRAME);
+		skb = netdev_alloc_skb(ndev, AVE_MAX_ETHFRAME);
 		if (!skb) {
 			netdev_err(ndev, "can't allocate skb for Rx\n");
 			return -ENOMEM;
 		}
+		skb->data += AVE_FRAME_HEADROOM;
+		skb->tail += AVE_FRAME_HEADROOM;
 	}
 
 	/* set disable to cmdsts */
@@ -595,12 +597,12 @@ static int ave_rxdesc_prepare(struct net_device *ndev, int entry)
 	 * - Rx buffer begins with 2 byte headroom, and data will be put from
 	 *   (buffer + 2).
 	 * To satisfy this, specify the address to put back the buffer
-	 * pointer advanced by NET_IP_ALIGN by netdev_alloc_skb_ip_align(),
-	 * and expand the map size by NET_IP_ALIGN.
+	 * pointer advanced by AVE_FRAME_HEADROOM, and expand the map size
+	 * by AVE_FRAME_HEADROOM.
 	 */
 	ret = ave_dma_map(ndev, &priv->rx.desc[entry],
-			  skb->data - NET_IP_ALIGN,
-			  AVE_MAX_ETHFRAME + NET_IP_ALIGN,
+			  skb->data - AVE_FRAME_HEADROOM,
+			  AVE_MAX_ETHFRAME + AVE_FRAME_HEADROOM,
 			  DMA_FROM_DEVICE, &paddr);
 	if (ret) {
 		netdev_err(ndev, "can't map skb for Rx\n");
-- 
2.7.4


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

* [PATCH net 3/3] net: ethernet: ave: Add MODULE_AUTHOR and MAINTAINERS entry
  2018-11-29  8:08 [PATCH net 0/3] fixup AVE ethernet driver Kunihiko Hayashi
  2018-11-29  8:08 ` [PATCH net 1/3] net: ethernet: ave: Increase descriptors to improve performance Kunihiko Hayashi
  2018-11-29  8:08 ` [PATCH net 2/3] net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM Kunihiko Hayashi
@ 2018-11-29  8:08 ` Kunihiko Hayashi
  2018-11-29 18:39 ` [PATCH net 0/3] fixup AVE ethernet driver David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2018-11-29  8:08 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Kunihiko Hayashi

Add missing MODULE_AUTHOR of ave driver and an entry to MAINTAINERS.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 MAINTAINERS                              | 7 +++++++
 drivers/net/ethernet/socionext/sni_ave.c | 1 +
 2 files changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 380e43f..0bbab10 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13824,6 +13824,13 @@ F:	drivers/md/raid*
 F:	include/linux/raid/
 F:	include/uapi/linux/raid/
 
+SOCIONEXT (SNI) AVE NETWORK DRIVER
+M:	Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
+L:	netdev@vger.kernel.org
+S:	Maintained
+F:	drivers/net/ethernet/socionext/sni_ave.c
+F:	Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
+
 SOCIONEXT (SNI) NETSEC NETWORK DRIVER
 M:	Jassi Brar <jaswinder.singh@linaro.org>
 L:	netdev@vger.kernel.org
diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 6710151..2c66c0e 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -1974,5 +1974,6 @@ static struct platform_driver ave_driver = {
 };
 module_platform_driver(ave_driver);
 
+MODULE_AUTHOR("Kunihiko Hayashi <hayashi.kunihiko@socionext.com>");
 MODULE_DESCRIPTION("Socionext UniPhier AVE ethernet driver");
 MODULE_LICENSE("GPL v2");
-- 
2.7.4


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

* Re: [PATCH net 0/3] fixup AVE ethernet driver
  2018-11-29  8:08 [PATCH net 0/3] fixup AVE ethernet driver Kunihiko Hayashi
                   ` (2 preceding siblings ...)
  2018-11-29  8:08 ` [PATCH net 3/3] net: ethernet: ave: Add MODULE_AUTHOR and MAINTAINERS entry Kunihiko Hayashi
@ 2018-11-29 18:39 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-11-29 18:39 UTC (permalink / raw)
  To: hayashi.kunihiko; +Cc: netdev, linux-kernel

From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: Thu, 29 Nov 2018 17:08:35 +0900

> This series adds fixup for AVE ethernet driver that includes increse of
> descriptors, replacing macro for linux-next, and adding missing author
> information.

Series applied.

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

end of thread, other threads:[~2018-11-29 18:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29  8:08 [PATCH net 0/3] fixup AVE ethernet driver Kunihiko Hayashi
2018-11-29  8:08 ` [PATCH net 1/3] net: ethernet: ave: Increase descriptors to improve performance Kunihiko Hayashi
2018-11-29  8:08 ` [PATCH net 2/3] net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM Kunihiko Hayashi
2018-11-29  8:08 ` [PATCH net 3/3] net: ethernet: ave: Add MODULE_AUTHOR and MAINTAINERS entry Kunihiko Hayashi
2018-11-29 18:39 ` [PATCH net 0/3] fixup AVE ethernet driver David Miller

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).