From: Jakub Kicinski <kuba@kernel.org>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, horms@kernel.org,
jiri@resnulli.us, pabeni@redhat.com, linux@armlinux.org.uk,
hfdevel@gmx.net, naveenm@marvell.com, jdamato@fastly.com
Subject: Re: [PATCH net-next v11 5/7] net: tn40xx: add basic Rx handling
Date: Tue, 18 Jun 2024 18:52:47 -0700 [thread overview]
Message-ID: <20240618185247.060c183a@kernel.org> (raw)
In-Reply-To: <20240618051608.95208-6-fujita.tomonori@gmail.com>
On Tue, 18 Jun 2024 14:16:06 +0900 FUJITA Tomonori wrote:
> + netif_tx_lock(priv->ndev);
> + while (f->m.wptr != f->m.rptr) {
> + f->m.rptr += TN40_TXF_DESC_SZ;
> + f->m.rptr &= f->m.size_mask;
> + /* Unmap all fragments */
> + /* First has to come tx_maps containing DMA */
> + do {
> + dma_unmap_page(&priv->pdev->dev, db->rptr->addr.dma,
> + db->rptr->len, DMA_TO_DEVICE);
> + tn40_tx_db_inc_rptr(db);
> + } while (db->rptr->len > 0);
> + tx_level -= db->rptr->len; /* '-' Because the len is negative */
> +
> + /* Now should come skb pointer - free it */
> + dev_kfree_skb_any(db->rptr->addr.skb);
> + netdev_dbg(priv->ndev, "dev_kfree_skb_any %p %d\n",
> + db->rptr->addr.skb, -db->rptr->len);
> + tn40_tx_db_inc_rptr(db);
> + }
Do you have to hold the Tx lock while unmapping the previous skbs?
That's the most expensive part of the function, would be good to let
other CPUs queue new packets at the same time.
next prev parent reply other threads:[~2024-06-19 1:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 5:16 [PATCH net-next v11 0/7] add ethernet driver for Tehuti Networks TN40xx chips FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 1/7] PCI: Add Edimax Vendor ID to pci_ids.h FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 2/7] net: tn40xx: add pci driver for Tehuti Networks TN40xx chips FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 3/7] net: tn40xx: add register defines FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 4/7] net: tn40xx: add basic Tx handling FUJITA Tomonori
2024-06-19 1:50 ` Jakub Kicinski
2024-06-19 3:44 ` FUJITA Tomonori
2024-06-19 14:55 ` Jakub Kicinski
2024-06-19 23:49 ` FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 5/7] net: tn40xx: add basic Rx handling FUJITA Tomonori
2024-06-19 1:52 ` Jakub Kicinski
2024-06-19 4:03 ` FUJITA Tomonori
2024-06-19 1:52 ` Jakub Kicinski [this message]
2024-06-19 6:21 ` FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 6/7] net: tn40xx: add mdio bus support FUJITA Tomonori
2024-06-18 5:16 ` [PATCH net-next v11 7/7] net: tn40xx: add phylink support FUJITA Tomonori
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=20240618185247.060c183a@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=fujita.tomonori@gmail.com \
--cc=hfdevel@gmx.net \
--cc=horms@kernel.org \
--cc=jdamato@fastly.com \
--cc=jiri@resnulli.us \
--cc=linux@armlinux.org.uk \
--cc=naveenm@marvell.com \
--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;
as well as URLs for NNTP newsgroup(s).