netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: eth: altera: set rx and tx ring size before init_dma call
@ 2022-05-31  2:51 Tham, Mun Yew
  2022-06-01  3:50 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Tham, Mun Yew @ 2022-05-31  2:51 UTC (permalink / raw)
  To: Joyce Ooi, David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Tham, Mun Yew

It is more appropriate to set the rx and tx ring size before calling
the init function for the dma.

Signed-off-by: Tham, Mun Yew <mun.yew.tham@intel.com>
---
 drivers/net/ethernet/altera/altera_tse_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 1c00d719e5d7..ebfddad05e7e 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1152,6 +1152,10 @@ static int tse_open(struct net_device *dev)
 	int i;
 	unsigned long int flags;
 
+	/* set tx and rx ring size */
+	priv->rx_ring_size = dma_rx_num;
+	priv->tx_ring_size = dma_tx_num;
+
 	/* Reset and configure TSE MAC and probe associated PHY */
 	ret = priv->dmaops->init_dma(priv);
 	if (ret != 0) {
@@ -1194,8 +1198,6 @@ static int tse_open(struct net_device *dev)
 	priv->dmaops->reset_dma(priv);
 
 	/* Create and initialize the TX/RX descriptors chains. */
-	priv->rx_ring_size = dma_rx_num;
-	priv->tx_ring_size = dma_tx_num;
 	ret = alloc_init_skbufs(priv);
 	if (ret) {
 		netdev_err(dev, "DMA descriptors initialization failed\n");
-- 
2.26.2


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

* Re: [PATCH] net: eth: altera: set rx and tx ring size before init_dma call
  2022-05-31  2:51 [PATCH] net: eth: altera: set rx and tx ring size before init_dma call Tham, Mun Yew
@ 2022-06-01  3:50 ` Jakub Kicinski
  2022-06-02  1:40   ` Tham, Mun Yew
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-06-01  3:50 UTC (permalink / raw)
  To: Tham, Mun Yew
  Cc: Joyce Ooi, David S . Miller, Eric Dumazet, Paolo Abeni, netdev

On Tue, 31 May 2022 10:51:17 +0800 Tham, Mun Yew wrote:
> It is more appropriate to set the rx and tx ring size before calling
> the init function for the dma.

Improve the commit message please, this tells us nothing.
It's hardly a well know software design best practice to set some
random thing before calling another random thing.
AFAICT neither dma implementation upstream cares about
priv->[tr]x_ring_size, do they?

If you're doing this to prepare for adding another DMA engine,
please post this patch together with the support being added.

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

* RE: [PATCH] net: eth: altera: set rx and tx ring size before init_dma call
  2022-06-01  3:50 ` Jakub Kicinski
@ 2022-06-02  1:40   ` Tham, Mun Yew
  0 siblings, 0 replies; 3+ messages in thread
From: Tham, Mun Yew @ 2022-06-02  1:40 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Joyce Ooi, David S . Miller, Eric Dumazet, Paolo Abeni, netdev

> On Tue, 31 May 2022 10:51:17 +0800 Tham, Mun Yew wrote:
> > It is more appropriate to set the rx and tx ring size before calling 
> > the init function for the dma.

> Improve the commit message please, this tells us nothing.
> It's hardly a well know software design best practice to set some random thing before calling another random thing.
> AFAICT neither dma implementation upstream cares about
> priv->[tr]x_ring_size, do they?

> If you're doing this to prepare for adding another DMA engine, please post this patch together with the support being added.
Noted, will post this patch together. Thanks.

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

end of thread, other threads:[~2022-06-02  1:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  2:51 [PATCH] net: eth: altera: set rx and tx ring size before init_dma call Tham, Mun Yew
2022-06-01  3:50 ` Jakub Kicinski
2022-06-02  1:40   ` Tham, Mun Yew

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