Skip to content

ionic: putting ionic on a diet

Shannon Nelson netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 0 repliesApplied 14/14

Patches in v1 All 14 applied

#Subject and filesSizeRepliesApplied
1/14ionic: remove desc, sg_desc and cmb_desc from desc_infodrivers/net/ethernet/pensando/ionic/ionic_dev.c drivers/net/ethernet/pensando/ionic/ionic_dev.h drivers/net/ethernet/pensando/ionic/ionic_main.c +1 more+45 -600 repliesApplied
2/14ionic: drop q mappingdrivers/net/ethernet/pensando/ionic/ionic_dev.c drivers/net/ethernet/pensando/ionic/ionic_dev.h drivers/net/ethernet/pensando/ionic/ionic_lif.c+10 -350 repliesApplied
3/14ionic: move adminq-notifyq handling to main filedrivers/net/ethernet/pensando/ionic/ionic.h drivers/net/ethernet/pensando/ionic/ionic_lif.c drivers/net/ethernet/pensando/ionic/ionic_main.c+67 -650 repliesApplied
4/14ionic: remove callback pointer from desc_infodrivers/net/ethernet/pensando/ionic/ionic_dev.c drivers/net/ethernet/pensando/ionic/ionic_dev.h drivers/net/ethernet/pensando/ionic/ionic_lif.c +2 more+57 -910 repliesApplied
5/14ionic: remove the cq_info to save more memorydrivers/net/ethernet/pensando/ionic/ionic.h drivers/net/ethernet/pensando/ionic/ionic_dev.c drivers/net/ethernet/pensando/ionic/ionic_dev.h +4 more+38 -890 repliesApplied
6/14ionic: use specialized desc info structsdrivers/net/ethernet/pensando/ionic/ionic_dev.c drivers/net/ethernet/pensando/ionic/ionic_dev.h drivers/net/ethernet/pensando/ionic/ionic_lif.c +2 more+111 -860 repliesApplied
7/14ionic: fold adminq clean into service routinedrivers/net/ethernet/pensando/ionic/ionic_main.c+11 -210 repliesApplied
8/14ionic: refactor skb buildingdrivers/net/ethernet/pensando/ionic/ionic_txrx.c+65 -530 repliesApplied
9/14ionic: carry idev in ionic_cq structdrivers/net/ethernet/pensando/ionic/ionic_dev.c drivers/net/ethernet/pensando/ionic/ionic_dev.h drivers/net/ethernet/pensando/ionic/ionic_txrx.c+6 -190 repliesApplied
10/14ionic: rearrange ionic_qcqdrivers/net/ethernet/pensando/ionic/ionic_lif.h+4 -40 repliesApplied
11/14ionic: rearrange ionic_queue for better layoutdrivers/net/ethernet/pensando/ionic/ionic_dev.h+2 -20 repliesApplied
12/14ionic: remove unnecessary NULL testdrivers/net/ethernet/pensando/ionic/ionic_txrx.c+0 -60 repliesApplied
13/14ionic: better dma-map error handlingdrivers/net/ethernet/pensando/ionic/ionic_txrx.c+14 -180 repliesApplied
14/14ionic: keep stats struct local to error handlingdrivers/net/ethernet/pensando/ionic/ionic_txrx.c+8 -220 repliesApplied

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchBrett Creeley
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14R-b
6/14R-b
7/14R-b
8/14R-b
9/14R-b
10/14R-b
11/14R-b
12/14R-b
13/14R-b
14/14R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/14] ionic: putting ionic on a diet

Building on the performance work done in the previous patchset

    [Link] https://lore.kernel.org/netdev/[email protected]/

this patchset puts the ionic driver on a diet, decreasing the memory requirements per queue, and simplifies a few more bits of logic.

We trimmed the queue management structs and gained some ground, but the most savings came from trimming the individual buffer descriptors. The original design used a single generic buffer descriptor for Tx, Rx and Adminq needs, but the Rx and Adminq descriptors really don't need all the info that the Tx descriptors track. By splitting up the descriptor types we can significantly reduce the descriptor sizes for Rx and Adminq use.

There is a small reduction in the queue management structs, saving about 3 cachelines per queuepair:

    ionic_qcq:
	Before:	/* size: 2176, cachelines: 34, members: 23 */
	After:	/* size: 2048, cachelines: 32, members: 23 */

We also remove an array of completion descriptor pointers, or about 8 Kbytes per queue.

But the biggest savings came from splitting the desc_info struct into queue specific structs and trimming out what was unnecessary.

    Before:
	ionic_desc_info:
		/* size: 496, cachelines: 8, members: 10 */
    After:
	ionic_tx_desc_info:
		/* size: 496, cachelines: 8, members: 6 */
	ionic_rx_desc_info:
		/* size: 224, cachelines: 4, members: 2 */
	ionic_admin_desc_info:
		/* size: 8, cachelines: 1, members: 1 */

In a 64 core host the ionic driver will default to 64 queuepairs of 1024 descriptors for Rx, 1024 for Tx, and 80 for Adminq and Notifyq.

The total memory usage for 64 queues:
Before:
65 * sizeof(ionic_qcq) 141,440
+ 64 * 1024 * sizeof(ionic_desc_info) 32,505,856
+ 64 * 1024 * sizeof(ionic_desc_info) 32,505,856
+ 64 * 1024 * 2 * sizeof(ionic_qc_info) 16,384
+ 1 * 80 * sizeof(ionic_desc_info) 39,690
----------
65,201,038

After:
65 * sizeof(ionic_qcq) 133,120
+ 64 * 1024 * sizeof(ionic_tx_desc_info) 32,505,856
+ 64 * 1024 * sizeof(ionic_rx_desc_info) 14,680,064
+ (removed) 0
+ 1 * 80 * sizeof(ionic_admin desc_info) 640
----------
47,319,680

This saves us approximately 18 Mbytes per port in a 64 core machine, a 28% savings in our memory needs.

In addition, this improves our simple single thread / single queue iperf case on a 9100 MTU connection from 86.7 to 95 Gbits/sec.

Shannon Nelson (14):
ionic: remove desc, sg_desc and cmb_desc from desc_info
ionic: drop q mapping
ionic: move adminq-notifyq handling to main file
ionic: remove callback pointer from desc_info
ionic: remove the cq_info to save more memory
ionic: use specialized desc info structs
ionic: fold adminq clean into service routine
ionic: refactor skb building
ionic: carry idev in ionic_cq struct
ionic: rearrange ionic_qcq
ionic: rearrange ionic_queue for better layout
ionic: remove unnecessary NULL test
ionic: better dma-map error handling
ionic: keep stats struct local to error handling

 drivers/net/ethernet/pensando/ionic/ionic.h   |   2 +
 .../net/ethernet/pensando/ionic/ionic_dev.c   | 105 +----
 .../net/ethernet/pensando/ionic/ionic_dev.h   |  79 ++--
 .../net/ethernet/pensando/ionic/ionic_lif.c   | 165 +++-----
 .../net/ethernet/pensando/ionic/ionic_lif.h   |   8 +-
 .../net/ethernet/pensando/ionic/ionic_main.c  | 115 ++++-
 .../net/ethernet/pensando/ionic/ionic_txrx.c  | 399 ++++++++----------
 .../net/ethernet/pensando/ionic/ionic_txrx.h  |   2 +-
 8 files changed, 371 insertions(+), 504 deletions(-)
Signature · 1 line
2.17.1