lkml.org 
[lkml]   [2019]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] rtw88: pci: Use general byte arrays as the elements of RX ring
Date
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)

\
 
 \ /
  Last update: 2019-07-30 11:49    [W:0.091 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site