From: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Russell King <rmk+kernel@armlinux.org.uk>,
Furong Xu <0x1207@gmail.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Serge Semin <fancer.lancer@gmail.com>,
Xiaolei Wang <xiaolei.wang@windriver.com>,
Suraj Jaiswal <quic_jsuraj@quicinc.com>,
Kory Maincent <kory.maincent@bootlin.com>,
Petr Tesarik <petr@tesarici.cz>,
Faizal Rahim <faizal.abdul.rahim@linux.intel.com>,
Choong Yong Liang <yong.liang.choong@linux.intel.com>,
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org
Subject: [PATCH iwl-next v2 4/9] igc: Set the RX packet buffer size for TSN mode
Date: Wed, 5 Feb 2025 05:05:19 -0500 [thread overview]
Message-ID: <20250205100524.1138523-5-faizal.abdul.rahim@linux.intel.com> (raw)
In-Reply-To: <20250205100524.1138523-1-faizal.abdul.rahim@linux.intel.com>
In preparation for supporting frame preemption, when entering TSN mode
set the receive packet buffer to 16KB for the Express MAC, 16KB for
the Preemptible MAC and 2KB for the BMC, according to the datasheet
section 7.1.3.2.
Co-developed-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
---
drivers/net/ethernet/intel/igc/igc_defines.h | 3 +++
drivers/net/ethernet/intel/igc/igc_tsn.c | 13 +++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index 516ef70c98e9..b19ac6f30dac 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -402,6 +402,9 @@
/* 7KB bytes buffer for each tx queue (total 4 queues) + 4KB for BMC*/
#define IGC_TXPBSIZE_TSN 0x041c71c7
+/* 15KB for EXP + 15KB for BE + 2KB for BMC */
+#define IGC_RXPBSIZE_TSN 0x0000f08f
+#define IGC_RXPBSIZE_SIZE_MASK 0x0001FFFF
#define IGC_DTXMXPKTSZ_TSN 0x19 /* 1600 bytes of max TX DMA packet size */
#define IGC_DTXMXPKTSZ_DEFAULT 0x98 /* 9728-byte Jumbo frames */
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
index 1e44374ca1ff..f0213cfce07d 100644
--- a/drivers/net/ethernet/intel/igc/igc_tsn.c
+++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
@@ -132,13 +132,17 @@ static int igc_tsn_disable_offload(struct igc_adapter *adapter)
{
u16 queue_per_tc[4] = { 3, 2, 1, 0 };
struct igc_hw *hw = &adapter->hw;
- u32 tqavctrl;
+ u32 tqavctrl, rxpbs;
int i;
wr32(IGC_GTXOFFSET, 0);
wr32(IGC_TXPBS, I225_TXPBSIZE_DEFAULT);
wr32(IGC_DTXMXPKTSZ, IGC_DTXMXPKTSZ_DEFAULT);
+ rxpbs = rd32(IGC_RXPBS) & ~IGC_RXPBSIZE_SIZE_MASK;
+ rxpbs |= I225_RXPBSIZE_DEFAULT;
+ wr32(IGC_RXPBS, rxpbs);
+
if (igc_is_device_id_i226(hw))
igc_tsn_restore_retx_default(adapter);
@@ -194,7 +198,7 @@ static int igc_tsn_enable_offload(struct igc_adapter *adapter)
{
struct igc_hw *hw = &adapter->hw;
u32 tqavctrl, baset_l, baset_h;
- u32 sec, nsec, cycle;
+ u32 sec, nsec, cycle, rxpbs;
ktime_t base_time, systim;
int i;
@@ -202,6 +206,11 @@ static int igc_tsn_enable_offload(struct igc_adapter *adapter)
wr32(IGC_DTXMXPKTSZ, IGC_DTXMXPKTSZ_TSN);
wr32(IGC_TXPBS, IGC_TXPBSIZE_TSN);
+ rxpbs = rd32(IGC_RXPBS) & ~IGC_RXPBSIZE_SIZE_MASK;
+ rxpbs |= IGC_RXPBSIZE_TSN;
+
+ wr32(IGC_RXPBS, rxpbs);
+
if (igc_is_device_id_i226(hw))
igc_tsn_set_retx_qbvfullthreshold(adapter);
--
2.34.1
next prev parent reply other threads:[~2025-02-05 10:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 10:05 [PATCH iwl-next v2 0/9] igc: Add support for Frame Preemption feature in IGC Faizal Rahim
2025-02-05 10:05 ` [PATCH iwl-next v2 1/9] net: ethtool: mm: extract stmmac verification logic into common library Faizal Rahim
2025-02-05 10:05 ` [PATCH iwl-next v2 2/9] igc: Rename xdp_get_tx_ring() for non-xdp usage Faizal Rahim
2025-02-05 10:05 ` [PATCH iwl-next v2 3/9] igc: Optimize the TX packet buffer utilization Faizal Rahim
2025-02-05 10:05 ` Faizal Rahim [this message]
2025-02-05 10:05 ` [PATCH iwl-next v2 5/9] igc: Add support for frame preemption verification Faizal Rahim
2025-02-05 17:12 ` Vladimir Oltean
2025-02-06 14:40 ` Abdul Rahim, Faizal
2025-02-06 15:04 ` Vladimir Oltean
2025-02-07 16:59 ` Abdul Rahim, Faizal
2025-02-05 10:05 ` [PATCH iwl-next v2 6/9] igc: Add support to set tx-min-frag-size Faizal Rahim
2025-02-05 10:05 ` [PATCH iwl-next v2 7/9] igc: Add support for preemptible traffic class in taprio Faizal Rahim
2025-02-05 10:05 ` [PATCH iwl-next v2 8/9] igc: Add support to get MAC Merge data via ethtool Faizal Rahim
2025-02-05 10:05 ` [PATCH iwl-next v2 9/9] igc: Add support to get frame preemption statistics " Faizal Rahim
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=20250205100524.1138523-5-faizal.abdul.rahim@linux.intel.com \
--to=faizal.abdul.rahim@linux.intel.com \
--cc=0x1207@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fancer.lancer@gmail.com \
--cc=hawk@kernel.org \
--cc=hayashi.kunihiko@socionext.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petr@tesarici.cz \
--cc=przemyslaw.kitszel@intel.com \
--cc=quic_jsuraj@quicinc.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=vinicius.gomes@intel.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaolei.wang@windriver.com \
--cc=yong.liang.choong@linux.intel.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;
as well as URLs for NNTP newsgroup(s).