mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Stanislaw Gruszka' <sgruszka@redhat.com>,
	Jian-Hong Pan <jian-hong@endlessm.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux@endlessm.com" <linux@endlessm.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] rtw88: pci: Use general byte arrays as the elements of RX ring
Date: Tue, 30 Jul 2019 09:48:38 +0000	[thread overview]
Message-ID: <962a8a8e735946d6b3944b7d0e228309@AcuMS.aculab.com> (raw)
In-Reply-To: <20190730093533.GC3174@redhat.com>

From: Stanislaw Gruszka
> Sent: 30 July 2019 10:36
...
> > +		len = pkt_stat.pkt_len + pkt_offset;
> > +		skb = dev_alloc_skb(len);
> > +		if (WARN_ONCE(!skb, "rx routine starvation\n"))
> >  			goto next_rp;
> >
> >  		/* put the DMA data including rx_desc from phy to new skb */
> > -		skb_put_data(new, skb->data, new_len);
> > +		skb_put_data(skb, rx_desc, len);
> 
> Coping big packets it quite inefficient. What drivers usually do is
> copy only for small packets and for big ones allocate new rx buf
> (drop packet alloc if fail) and pas old buf to network stack via
> skb_add_rx_frag(). See iwlmvm as example.

If you have to do iommu setup/teardown then the breakeven point
for (not) copying may be surprisingly large.
You do need to do the measurements on a range of hardware.
Coping is also likely to affect the L1 cache - unless you can
copy quickly without polluting the cache.

It is all 'swings and roundabouts'.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


      reply	other threads:[~2019-07-30  9:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  8:09 Jian-Hong Pan
2019-07-25  9:21 ` David Laight
2019-07-26  6:18   ` Jian-Hong Pan
2019-07-26  9:23     ` David Laight
2019-07-26  9:40       ` Jian-Hong Pan
2019-07-30  3:11         ` Tony Chuang
2019-07-30  9:35 ` Stanislaw Gruszka
2019-07-30  9:48   ` David Laight [this message]

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=962a8a8e735946d6b3944b7d0e228309@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=jian-hong@endlessm.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=netdev@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=yhchuang@realtek.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®