netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexander Duyck' <alexander.duyck@gmail.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Coco Li <lixiaoyan@google.com>
Subject: RE: [PATCH net-next 09/15] net: increase MAX_SKB_FRAGS
Date: Fri, 4 Feb 2022 10:18:02 +0000	[thread overview]
Message-ID: <11f331492498494584f171c4ab8dc733@AcuMS.aculab.com> (raw)
In-Reply-To: <CAKgT0UeTvj_6DWUskxxaRiQQxcwg6j0u+UHDaougJSMdkogKWA@mail.gmail.com>

From: Alexander Duyck
> Sent: 03 February 2022 17:57
...
> > > So a big issue I see with this patch is the potential queueing issues
> > > it may introduce on Tx queues. I suspect it will cause a number of
> > > performance regressions and deadlocks as it will change the Tx queueing
> > > behavior for many NICs.
> > >
> > > As I recall many of the Intel drivers are using MAX_SKB_FRAGS as one of
> > > the ingredients for DESC_NEEDED in order to determine if the Tx queue
> > > needs to stop. With this change the value for igb for instance is
> > > jumping from 21 to 49, and the wake threshold is twice that, 98. As
> > > such the minimum Tx descriptor threshold for the driver would need to
> > > be updated beyond 80 otherwise it is likely to deadlock the first time
> > > it has to pause.
> >
> > Are these limits hard coded in Intel drivers and firmware, or do you
> > think this can be changed ?
> 
> This is all code in the drivers. Most drivers have them as the logic
> is used to avoid having to return NETIDEV_TX_BUSY. Basically the
> assumption is there is a 1:1 correlation between descriptors and
> individual frags. So most drivers would need to increase the size of
> their Tx descriptor rings if they were optimized for a lower value.

Maybe the drivers can be a little less conservative about the number
of fragments they expect in the next message?
There is little point requiring 49 free descriptors when the workload
never has more than 2 or 3 fragments.

Clearly you don't want to re-enable things unless there are enough
descriptors for an skb that has generated NETDEV_TX_BUSY, but the
current logic of 'trying to never actually return NETDEV_TX_BUSY'
is probably over cautious.

Does Linux allow skb to have a lot of short fragments?
If dma_map isn't cheap (probably anything with an iommu or non-coherent
memory) them copying/merging short fragments into a pre-mapped
buffer can easily be faster.
Many years ago we found it was worth copying anything under 1k on
a sparc mbus+sbus system.
I don't think Linux can generate what I've seen elsewhere - the mac
driver being asked to transmit something with 1000+ one byte fragmemts!

	David

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

  parent reply	other threads:[~2022-02-04 10:18 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  1:51 [PATCH net-next 00/15] tcp: BIG TCP implementation Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 01/15] net: add netdev->tso_ipv6_max_size attribute Eric Dumazet
2022-02-03 16:34   ` Jakub Kicinski
2022-02-03 16:56     ` Eric Dumazet
2022-02-03 18:58       ` Jakub Kicinski
2022-02-03 19:12         ` Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 02/15] ipv6: add dev->gso_ipv6_max_size Eric Dumazet
2022-02-03  8:57   ` Paolo Abeni
2022-02-03 15:34     ` Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 03/15] tcp_cubic: make hystart_ack_delay() aware of BIG TCP Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 04/15] ipv6: add struct hop_jumbo_hdr definition Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 05/15] ipv6/gso: remove temporary HBH/jumbo header Eric Dumazet
2022-02-03 18:53   ` Alexander H Duyck
2022-02-03 19:17     ` Eric Dumazet
2022-02-03 19:45       ` Alexander Duyck
2022-02-03 19:59         ` Eric Dumazet
2022-02-03 21:08           ` Alexander H Duyck
2022-02-03 21:41             ` Eric Dumazet
2022-02-04  0:05               ` Alexander Duyck
2022-02-04  0:27                 ` Eric Dumazet
2022-02-04  1:14                   ` Eric Dumazet
2022-02-04  1:48                     ` Eric Dumazet
2022-02-04  2:15                       ` Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 06/15] ipv6/gro: insert " Eric Dumazet
2022-02-03  9:19   ` Paolo Abeni
2022-02-03 15:48     ` Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 07/15] ipv6: add GRO_IPV6_MAX_SIZE Eric Dumazet
2022-02-03  2:18   ` Eric Dumazet
2022-02-03 10:44   ` Paolo Abeni
2022-02-03  1:51 ` [PATCH net-next 08/15] ipv6: Add hop-by-hop header to jumbograms in ip6_output Eric Dumazet
2022-02-03  9:07   ` Paolo Abeni
2022-02-03 16:31     ` Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 09/15] net: increase MAX_SKB_FRAGS Eric Dumazet
2022-02-03  5:02   ` kernel test robot
2022-02-03  5:20     ` Eric Dumazet
2022-02-03  5:31       ` Jakub Kicinski
2022-02-03  6:35         ` Eric Dumazet
2022-02-03  5:23   ` kernel test robot
2022-02-03  5:43   ` kernel test robot
2022-02-03 16:01   ` Paolo Abeni
2022-02-03 17:26   ` Alexander H Duyck
2022-02-03 17:34     ` Eric Dumazet
2022-02-03 17:56       ` Alexander Duyck
2022-02-03 19:18         ` Jakub Kicinski
2022-02-03 19:20           ` Eric Dumazet
2022-02-03 19:54             ` Eric Dumazet
2022-02-04 10:18         ` David Laight [this message]
2022-02-04 15:46           ` Alexander Duyck
2022-02-03  1:51 ` [PATCH net-next 10/15] net: loopback: enable BIG TCP packets Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 11/15] bonding: update dev->tso_ipv6_max_size Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 12/15] macvlan: enable BIG TCP Packets Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 13/15] ipvlan: " Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 14/15] mlx4: support BIG TCP packets Eric Dumazet
2022-02-03 13:04   ` Tariq Toukan
2022-02-03 15:54     ` Eric Dumazet
2022-02-03  1:51 ` [PATCH net-next 15/15] mlx5: " Eric Dumazet
2022-02-03  7:27   ` Tariq Toukan
2022-02-04  4:03   ` kernel test robot

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=11f331492498494584f171c4ab8dc733@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lixiaoyan@google.com \
    --cc=netdev@vger.kernel.org \
    /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).