From: Stefan Wahren <wahrenst@gmx.net>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Lino Sanfilippo <LinoSanfilippo@gmx.de>,
Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Stefan Wahren <wahrenst@gmx.net>,
Jacob Keller <jacob.e.keller@intel.com>
Subject: [PATCH V4 08/15 net-next] qca_spi: Introduce QCASPI_RX_MAX_FRAMES
Date: Sun, 28 Jan 2024 21:10:52 +0100 [thread overview]
Message-ID: <20240128201059.6259-9-wahrenst@gmx.net> (raw)
In-Reply-To: <20240128201059.6259-1-wahrenst@gmx.net>
Currently qca_spi reserves enough space for 4 complete Ethernet over SPI
frames in the receive buffer. Unfortunately this is hidden under a magic
number. So replace it with a more self explaining define.
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
---
drivers/net/ethernet/qualcomm/qca_spi.c | 2 +-
drivers/net/ethernet/qualcomm/qca_spi.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index f53438c4aea2..c0f6bd3d331a 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -829,7 +829,7 @@ qcaspi_netdev_init(struct net_device *dev)
qca->burst_len = qcaspi_burst_len;
qca->spi_thread = NULL;
qca->buffer_size = (dev->mtu + VLAN_ETH_HLEN + QCAFRM_HEADER_LEN +
- QCAFRM_FOOTER_LEN + 4) * 4;
+ QCAFRM_FOOTER_LEN + 4) * QCASPI_RX_MAX_FRAMES;
memset(&qca->stats, 0, sizeof(struct qcaspi_stats));
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.h b/drivers/net/ethernet/qualcomm/qca_spi.h
index dcecb072b8eb..f735ad77402f 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.h
+++ b/drivers/net/ethernet/qualcomm/qca_spi.h
@@ -41,6 +41,7 @@
#define QCASPI_TX_RING_MAX_LEN 10
#define QCASPI_TX_RING_MIN_LEN 2
+#define QCASPI_RX_MAX_FRAMES 4
/* sync related constants */
#define QCASPI_SYNC_UNKNOWN 0
--
2.34.1
next prev parent reply other threads:[~2024-01-28 20:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-28 20:10 [PATCH V4 00/15 net-next] qca_spi: collection of improvements Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 01/15 net-next] qca_spi: Add check for kthread_stop Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 02/15 net-next] qca_spi: Improve SPI thread creation Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 03/15 net-next] qca_spi: Improve SPI IRQ handling Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 04/15 net-next] qca_spi: Avoid skb_copy_expand in TX path Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 05/15 net-next] qca_7k_common: Drop unnecessary function description Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 06/15 net-next] qca_7k_common: Drop unused len from qcafrm_handle Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 07/15 net-next] qca_spi: Add QCASPI prefix to ring defines Stefan Wahren
2024-01-28 20:10 ` Stefan Wahren [this message]
2024-01-28 20:10 ` [PATCH V4 09/15 net-next] qca_spi: Improve calculation of RX buffer size Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 10/15 net-next] qca_spi: Log expected signature in error case Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 11/15 net-next] qca_spi: Adjust log of SPI_REG_RDBUF_BYTE_AVA Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 12/15 net-next] qca_7k: Replace BSD boilerplate with SPDX Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 13/15 net-next] qca_7k: Replace old mail address Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 14/15 net-next] mailmap: add entry for Stefan Wahren Stefan Wahren
2024-01-28 20:10 ` [PATCH V4 15/15 net-next] MAINTAINERS: add entry for qca7k driver(s) Stefan Wahren
2024-01-31 13:40 ` [PATCH V4 00/15 net-next] qca_spi: collection of improvements patchwork-bot+netdevbpf
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=20240128201059.6259-9-wahrenst@gmx.net \
--to=wahrenst@gmx.net \
--cc=LinoSanfilippo@gmx.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=jacob.e.keller@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®