Spdk/include/spdk
Richael Zhuang 9bff828f99 sock: introduce dynamic zerocopy according to data size
MSG_ZEROCOPY is not always effective as mentioned in
https://www.kernel.org/doc/html/v4.15/networking/msg_zerocopy.html.

Currently in spdk, once we enable sendmsg zerocopy, then all data
transferred through _sock_flush are sent with zerocopy, and vice
versa. Here dynamic zerocopy is introduced to allow data sent with
MSG_ZEROCOPY or not according to its size, which can be enabled by
setting "enable_dynamic_zerocopy" as true.

Test with 16 P4610 NVMe SSD, 2 initiators, target's and initiators'
configurations are the same as spdk report:
https://ci.spdk.io/download/performance-reports/SPDK_tcp_perf_report_2104.pdf

For posix socket, rw_percent=0(randwrite), it has 1.9%~8.3% performance boost
tested with target 1~40 cpu cores and qdepth=128,256,512. And it has no obvious
influence when read percentage is greater than 50%.

For uring socket, rw_percent=0(randwrite), it has 1.8%~7.9% performance boost
tested with target 1~40 cpu cores and qdepth=128,256,512. And it still has
1%~7% improvement when read percentage is greater than 50%.

The following is part of the detailed data.

posix:
qdepth=128
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1	286.5	298.5	4.19%		 307	304.15	-0.93%
4	1042.5	1107	6.19%		1135.5	1136	0.04%
8	1952.5	2058	5.40%		2170.5	2170.5	0.00%
12	2658.5	2879	8.29%		3042	3046	0.13%
16	3247.5	3460.5	6.56%		3793.5	3775	-0.49%
24	4232.5	4459.5	5.36%		4614.5	4756.5	3.08%
32	4810	5095	5.93%		4488	4845	7.95%
40	5306.5	5435	2.42%		4427.5	4902	10.72%

qdepth=512
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1    275	 287	4.36%		294.4	295.45	0.36%
4	 979	1041	6.33%		1073	1083.5	0.98%
8	1822.5	1914.5	5.05%		2030.5	2018.5	-0.59%
12	2441	2598.5	6.45%		2808.5	2779.5	-1.03%
16	2920.5	3109.5	6.47%		3455	3411.5	-1.26%
24	3709	3972.5	7.10%		4483.5	4502.5	0.42%
32	4225.5	4532.5	7.27%		4463.5	4733	6.04%
40	4790.5	4884.5	1.96%		4427	4904.5	10.79%

uring:
qdepth=128
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1	270.5	287.5	6.28%		295.75	304.75	3.04%
4	1018.5	1089.5	6.97%		1119.5	1156.5	3.31%
8	1907	2055	7.76%		2127	2211.5	3.97%
12	2614	2801	7.15%		2982.5	3061.5	2.65%
16	3169.5	3420	7.90%		3654.5	3781.5	3.48%
24	4109.5	4414	7.41%		4691.5	4750.5	1.26%
32	4752.5	4908	3.27%		4494	4825.5	7.38%
40	5233.5	5327	1.79%		4374.5	4891	11.81%

qdepth=512
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1	259.95	 276	6.17%		286.65	294.8	2.84%
4	955 	1021	6.91%		1070.5	1100	2.76%
8	1772	1903.5	7.42%		1992.5	2077.5	4.27%
12	2380.5	2543.5	6.85%		2752.5	2860	3.91%
16	2920.5	3099	6.11%		3391.5	3540	4.38%
24	3697	3912	5.82%		4401	4637	5.36%
32	4256.5	4454.5	4.65%		4516	4777	5.78%
40	4707	4968.5	5.56%		4400.5	4933	12.10%

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I730dcf89ed2bf3efe91586421a89045fc11c81f0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12210
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-04-28 07:29:28 +00:00
..
accel_engine.h accel: cleanup by getting rid of capabilties enum 2022-04-14 08:32:50 +00:00
assert.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
barrier.h nvmf/vfio-user: Fix doorbell polling not working on some ARM platform 2021-12-14 09:09:09 +00:00
base64.h util/base64: Extend b64 decode to calculate exact len 2020-02-03 11:39:49 +00:00
bdev_module.h bdev: Add spdk_bdev_unregister_by_name() to handle race condtions 2022-04-04 09:57:43 +00:00
bdev_zone.h bdev/zone: add support for get zone id 2021-11-11 23:23:35 +00:00
bdev.h bdev: Add spdk_for_each_bdev/bdev_leaf for clean up and further improvements 2022-04-05 07:30:47 +00:00
bit_array.h util: added bit array bitmask load, store and clear 2018-12-14 15:34:53 +00:00
bit_pool.h util: add spdk_bit_pool 2020-09-15 07:12:44 +00:00
blob_bdev.h module/blob: remove deprecated spdk_bdev_create_bs_dev/from_desc() 2021-03-05 08:33:45 +00:00
blob.h blob: add forced recovery 2022-02-03 20:07:58 +00:00
blobfs_bdev.h blobfs/fuse: put FUSE code in module blobfs_bdev 2019-10-15 16:25:09 +00:00
blobfs.h doc: do not document void returns 2021-12-02 15:41:33 +00:00
conf.h spelling: include 2021-12-01 09:15:13 +00:00
cpuset.h cpuset: Expose internal of struct spdk_cpuset in header file 2019-07-04 00:30:22 +00:00
crc16.h util/crc16: Add spdk_crc16_t10dif_copy to use in read strip and write insert 2018-12-20 17:52:29 +00:00
crc32.h util/crc32c: Add spdk_crc32c_iov_update. 2021-06-02 11:37:17 +00:00
dif.h dif: enhance copy API to support block-aligned bounce_iov 2022-04-01 08:29:12 +00:00
dma.h spelling: include 2021-12-01 09:15:13 +00:00
endian.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
env_dpdk.h spelling: include 2021-12-01 09:15:13 +00:00
env.h env: add experimental APIs to handle PCI device interrupts 2022-01-14 08:35:24 +00:00
event.h event: Add a user option to change the size of spdk_msg_mempool 2022-03-09 08:00:28 +00:00
fd_group.h spelling: include 2021-12-01 09:15:13 +00:00
fd.h include/fd.h: add comments for pubclic APIs 2018-01-04 12:12:10 -05:00
file.h util: add a new file operation API 2019-05-15 18:54:27 +00:00
ftl.h lib/ftl: Create l2p on l2p_path file if set in config 2020-03-06 10:28:21 +00:00
gpt_spec.h bdev/gpt: dump partition name 2017-07-12 18:12:52 -04:00
histogram_data.h histogram: add handling for datapoint == 0 2021-05-19 07:50:28 +00:00
idxd_spec.h idxd: Fix IDXD_FLAG_* indentation 2022-04-21 08:11:33 +00:00
idxd.h idxd: Eliminate configs 2022-03-21 11:05:28 +00:00
init.h event: Move json config loading to init 2021-05-26 09:13:34 +00:00
ioat_spec.h ioat_spec: fix gcc9 warning 2019-06-17 14:09:03 +00:00
ioat.h lib/ioat: add mew API to get the max # of descriptors supported 2020-07-23 22:26:39 +00:00
iscsi_spec.h spelling: include 2021-12-01 09:15:13 +00:00
json.h json: add spdk_json_write_bytearray 2021-12-14 09:08:59 +00:00
jsonrpc.h spelling: include 2021-12-01 09:15:13 +00:00
likely.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
log.h log: fix out-of-order designated initializer 2021-12-20 08:44:34 +00:00
lvol.h lvol: ensure enum for lvol clear method is the same as blobstore 2019-02-28 20:50:27 +00:00
memory.h memory.h: move to public headers 2020-03-19 08:50:45 +00:00
mmio.h mmio: add functions for 1 and 2 byte I/O accesses 2017-10-13 10:46:00 -04:00
nbd.h nbd: Use async manner to stop nbd device. 2020-12-28 14:05:15 +00:00
notify.h spelling: include 2021-12-01 09:15:13 +00:00
nvme_intel.h nvme: pad struct spdk_nvme_intel_marketing_description_page 2019-06-05 02:46:50 +00:00
nvme_ocssd_spec.h ocssd: add chunk notification log struct 2018-09-27 01:30:45 +00:00
nvme_ocssd.h spelling: include 2021-12-01 09:15:13 +00:00
nvme_spec.h nvmf: support oacs in cdata_init callback 2022-03-24 09:21:46 +00:00
nvme_zns.h lib/nvme: NVMe ZNS - Zone Descriptor Extension support 2021-09-16 07:21:40 +00:00
nvme.h nvme_tcp: set transport_ack_timeout to ack_timeout 2022-04-20 08:21:42 +00:00
nvmf_cmd.h spelling: include 2021-12-01 09:15:13 +00:00
nvmf_fc_spec.h spelling: include 2021-12-01 09:15:13 +00:00
nvmf_spec.h spelling: include 2021-12-01 09:15:13 +00:00
nvmf_transport.h nvmf/rdma: Improve read performance in DIF strip mode 2022-04-01 11:19:18 +00:00
nvmf.h nvmf: zero-copy enable flag in transport opts 2022-01-06 18:53:42 +00:00
opal_spec.h spelling: include 2021-12-01 09:15:13 +00:00
opal.h lib/opal: remove deprecated spdk_opal_supported() 2021-03-18 14:43:08 +00:00
pci_ids.h nvmf/vfio-user: define SPDK_PCI_VID_NUTANIX macro and use it in vfio-user 2021-12-06 23:17:07 +00:00
pipe.h pipe: Add a utility for buffering data from sockets 2019-11-20 09:35:32 +00:00
queue_extras.h include: remove util.h include from queue_extras.h 2021-04-14 07:25:21 +00:00
queue.h Include: Test for __linux__ 2020-11-19 09:53:21 +00:00
reduce.h reduce: Add a check that driver supports SGL 2022-03-25 08:17:56 +00:00
rpc.h rpc: add spdk_rpc_verify_methods() 2019-11-06 15:19:48 +00:00
scheduler.h scheduler: create and parse JSON values for dynamic scheduler params 2022-03-16 08:19:26 +00:00
scsi_spec.h Lib/iSCSI: add the LUN Resize support 2022-01-20 07:56:23 +00:00
scsi.h doc: match spdk_scsi_dev_get_next_lun argument name 2021-12-02 15:41:33 +00:00
sock.h sock: introduce dynamic zerocopy according to data size 2022-04-28 07:29:28 +00:00
stdinc.h util: add zipf random number generator 2021-05-17 11:29:52 +00:00
string.h string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
thread.h event: Add a user option to change the size of spdk_msg_mempool 2022-03-09 08:00:28 +00:00
trace_parser.h spelling: include 2021-12-01 09:15:13 +00:00
trace.h trace: make trace_create_tpoint_group_mask() external 2022-01-05 08:52:40 +00:00
tree.h util: rename RB_ROOT into _RB_ROOT 2021-06-04 22:46:40 +00:00
util.h util: Add spdk_ioviter for iterating iovecs 2021-12-17 09:45:44 +00:00
uuid.h util/uuid: add a new uuid copy API. 2018-12-06 22:25:09 +00:00
version.h version: SPDK 22.05 pre 2022-01-21 08:12:20 +00:00
vfio_user_pci.h NVMe/vfio-user: add initial version vfio-user transport to NVMe driver 2021-01-21 05:00:18 +00:00
vfio_user_spec.h libvfio-user: update submodule 2021-06-22 23:42:02 +00:00
vhost.h vhost: parse JSON vhost_blk devices specific params 2022-04-11 07:44:09 +00:00
vmd.h lib/vmd: detach devices during shutdown 2020-02-04 16:50:25 +00:00
zipf.h util: add zipf random number generator 2021-05-17 11:29:52 +00:00