From: "Tham, Mun Yew" <mun.yew.tham@intel.com>
To: Joyce Ooi <joyce.ooi@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Tham@vger.kernel.org, Mun Yew <mun.yew.tham@intel.com>
Subject: [PATCH] net: eth: altera: set rx and tx ring size before init_dma call
Date: Tue, 31 May 2022 10:51:17 +0800 [thread overview]
Message-ID: <20220531025117.13822-1-mun.yew.tham@intel.com> (raw)
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
reply other threads:[~2022-05-31 2:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220531025117.13822-1-mun.yew.tham@intel.com \
--to=mun.yew.tham@intel.com \
--cc=Tham@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joyce.ooi@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®