From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: "Marek Behún" <kabel@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [PATCH net-next 4/5] net: mvneta: move tso_build_hdr() into mvneta_tso_put_hdr()
Date: Wed, 10 May 2023 11:15:58 +0100 [thread overview]
Message-ID: <E1pwgrW-001XE4-DB@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZFtuhJOC03qpASt2@shell.armlinux.org.uk>
Move tso_build_hdr() into mvneta_tso_put_hdr() so that all the TSO
header building code is in one place.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/marvell/mvneta.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c23d75af65ee..bea84e86cf99 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2659,19 +2659,24 @@ static int mvneta_rx_hwbm(struct napi_struct *napi,
return rx_done;
}
-static inline void
-mvneta_tso_put_hdr(struct sk_buff *skb, struct mvneta_tx_queue *txq)
+static void mvneta_tso_put_hdr(struct sk_buff *skb, struct mvneta_tx_queue *txq,
+ struct tso_t *tso, int size, bool is_last)
{
struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index];
- int hdr_len = skb_tcp_all_headers(skb);
+ int tso_offset, hdr_len = skb_tcp_all_headers(skb);
struct mvneta_tx_desc *tx_desc;
+ char *hdr;
+
+ tso_offset = txq->txq_put_index * TSO_HEADER_SIZE;
+
+ hdr = txq->tso_hdrs + tso_offset;
+ tso_build_hdr(skb, hdr, tso, size, is_last);
tx_desc = mvneta_txq_next_desc_get(txq);
tx_desc->data_size = hdr_len;
tx_desc->command = mvneta_skb_tx_csum(skb);
tx_desc->command |= MVNETA_TXD_F_DESC;
- tx_desc->buf_phys_addr = txq->tso_hdrs_phys +
- txq->txq_put_index * TSO_HEADER_SIZE;
+ tx_desc->buf_phys_addr = txq->tso_hdrs_phys + tso_offset;
buf->type = MVNETA_TYPE_TSO;
buf->skb = NULL;
@@ -2764,17 +2769,12 @@ static int mvneta_tx_tso(struct sk_buff *skb, struct net_device *dev,
total_len = skb->len - hdr_len;
while (total_len > 0) {
- char *hdr;
-
data_left = min_t(int, skb_shinfo(skb)->gso_size, total_len);
total_len -= data_left;
desc_count++;
/* prepare packet headers: MAC + IP + TCP */
- hdr = txq->tso_hdrs + txq->txq_put_index * TSO_HEADER_SIZE;
- tso_build_hdr(skb, hdr, &tso, data_left, total_len == 0);
-
- mvneta_tso_put_hdr(skb, txq);
+ mvneta_tso_put_hdr(skb, txq, &tso, data_left, total_len == 0);
while (data_left > 0) {
int size;
--
2.30.2
next prev parent reply other threads:[~2023-05-10 10:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 10:14 [PATCH net-next 0/6] net: mvneta: reduce size of TSO header allocation Russell King (Oracle)
2023-05-10 10:15 ` [PATCH net-next 1/5] net: mvneta: fix transmit path dma-unmapping on error Russell King (Oracle)
2023-05-10 11:33 ` Eric Dumazet
2023-05-10 10:15 ` [PATCH net-next 2/5] net: mvneta: mark mapped and tso buffers separately Russell King (Oracle)
2023-05-10 11:34 ` Eric Dumazet
2023-05-10 10:15 ` [PATCH net-next 3/5] net: mvneta: use buf->type to determine whether to dma-unmap Russell King (Oracle)
2023-05-10 11:34 ` Eric Dumazet
2023-05-10 10:15 ` Russell King (Oracle) [this message]
2023-05-10 11:34 ` [PATCH net-next 4/5] net: mvneta: move tso_build_hdr() into mvneta_tso_put_hdr() Eric Dumazet
2023-05-10 10:16 ` [PATCH net-next 5/5] net: mvneta: allocate TSO header DMA memory in chunks Russell King (Oracle)
2023-05-10 11:38 ` Eric Dumazet
2023-05-10 11:48 ` Russell King (Oracle)
2023-05-10 12:00 ` Thomas Petazzoni
2023-05-10 10:36 ` [PATCH net-next 0/6] net: mvneta: reduce size of TSO header allocation Russell King (Oracle)
2023-05-11 11:10 ` 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=E1pwgrW-001XE4-DB@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thomas.petazzoni@bootlin.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).