2017-03-30 19:06:49 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2017 Intel Corporation
|
|
|
|
# All rights reserved.
|
nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach:
Avahi Daemon needs to be running to provide the mDNS server service. In the SPDK, Avahi-client library based client API is implemented.
The client API will connect to the Avahi-daemon and receive events for new discovery and removal of an existing discovery entry.
Following sets on new RPCs have been introduced.
scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
User shall initiate an mDNS based discovery using this RPC. This will start a Avahi-client based poller
looking for new discovery events from the Avahi server. On a new discovery of the discovery controller,
the existing bdev_nvme_start_discovery API will be invoked with the trid of the discovery controller learnt.
This will enable automatic connection of the initiator to the subsystems discovered from the discovery controller.
Multiple mdns discovery instances can be run by specifying a unique bdev-prefix and a unique servicename to discover as parameters.
scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
This will stop the Avahi poller that was started for the specified service.Internally bdev_nvme_stop_discovery
API will be invoked for each of the discovery controllers learnt automatically by this instance of mdns discovery service.
This will result in termination of connections to all the subsystems learnt by this mdns discovery instance.
scripts/rpc.py bdev_nvme_get_mdns_discovery_info
This RPC will display the list of mdns discovery instances running and the trid of the controllers discovered by these instances.
Test Result:
root@ubuntu-pm-18-226:~/param-spdk/spdk/build/bin# ./nvmf_tgt -i 1 -s 2048 -m 0xF
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[
{
"name": "cdc_auto",
"svcname": "_nvme-disc._tcp",
"referrals": [
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
}
]
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[
{
"name": "cdc_auto02n1",
"aliases": [
"600110d6-1681-1681-0403-000045805c45"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-1681-1681-0403-000045805c45",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T0",
"serial_number": "00-681681dc681681dc",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto00n1",
"aliases": [
"600110da-09a6-09a6-0302-00005eeb19b4"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 2048,
"uuid": "600110da-09a6-09a6-0302-00005eeb19b4",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0"
},
"ctrlr_data": {
"cntlid": 1,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P2T0",
"serial_number": "00-ab09a6f5ab09a6f5",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n1",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8c"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8c",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n2",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8d"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8d",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 2,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com>
Change-Id: Ic2c2e614e2549a655c7f81ae844b80d8505a4f02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15703
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-30 20:11:23 +00:00
|
|
|
# Copyright (c) 2022 Dell Inc, or its subsidiaries.
|
2022-11-02 15:49:40 +00:00
|
|
|
#
|
2017-03-30 19:06:49 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-10-03 14:32:45 +00:00
|
|
|
trap 'echo -e "\n\nConfiguration failed\n\n" >&2' ERR
|
|
|
|
|
2019-08-26 23:02:30 +00:00
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
2020-10-21 17:06:08 +00:00
|
|
|
source "$rootdir/scripts/common.sh"
|
2019-08-26 23:02:30 +00:00
|
|
|
|
2021-01-21 11:54:00 +00:00
|
|
|
function usage() {
|
2017-03-30 19:06:49 +00:00
|
|
|
echo "'configure' configures SPDK to compile on supported platforms."
|
|
|
|
echo ""
|
|
|
|
echo "Usage: ./configure [OPTION]..."
|
|
|
|
echo ""
|
|
|
|
echo "Defaults for the options are specified in brackets."
|
|
|
|
echo ""
|
|
|
|
echo "General:"
|
|
|
|
echo " -h, --help Display this help and exit"
|
2017-11-15 17:36:36 +00:00
|
|
|
echo ""
|
|
|
|
echo " --prefix=path Configure installation prefix (default: /usr/local)"
|
2019-07-23 17:52:47 +00:00
|
|
|
echo " --target-arch=arch Target build architecture. Must be a valid GNU arch. Default: native"
|
2017-11-15 17:36:36 +00:00
|
|
|
echo ""
|
2019-07-09 12:40:41 +00:00
|
|
|
echo " --cross-prefix=prefix Prefix for cross compilation (default: none)"
|
|
|
|
echo " example: aarch64-linux-gnu"
|
2022-06-08 12:43:12 +00:00
|
|
|
echo " --libdir=path Configure installation path for the libraries (default: \$prefix/lib)"
|
2023-04-12 13:01:41 +00:00
|
|
|
echo " --max-lcores=VAL DPDK configuration. VAL defines maximum number of lcores supported"
|
|
|
|
echo " by EAL, or enables autodetection if set to 'detect'. When 'detect'"
|
|
|
|
echo " is specified, DPDK will detect number of cores in the system during"
|
|
|
|
echo " compilation, and will set maximum number of lcores to this value"
|
2017-03-30 19:06:49 +00:00
|
|
|
echo " --enable-debug Configure for debug builds"
|
|
|
|
echo " --enable-werror Treat compiler warnings as errors"
|
|
|
|
echo " --enable-asan Enable address sanitizer"
|
|
|
|
echo " --enable-ubsan Enable undefined behavior sanitizer"
|
|
|
|
echo " --enable-coverage Enable code coverage tracking"
|
2016-03-24 20:27:53 +00:00
|
|
|
echo " --enable-lto Enable link-time optimization"
|
2019-02-11 18:19:32 +00:00
|
|
|
echo " --enable-pgo-capture Enable generation of profile guided optimization data"
|
|
|
|
echo " --enable-pgo-use Use previously captured profile guided optimization data"
|
2021-01-14 11:06:33 +00:00
|
|
|
echo " --enable-cet Enable Intel Control-flow Enforcement Technology (CET)"
|
2020-03-06 09:08:29 +00:00
|
|
|
echo " --disable-tests Disable building of functional tests"
|
|
|
|
echo " --disable-unit-tests Disable building of unit tests"
|
2020-02-27 16:59:20 +00:00
|
|
|
echo " --disable-examples Disable building of examples"
|
2021-04-17 05:09:30 +00:00
|
|
|
echo " --disable-apps Disable building of apps"
|
2017-03-30 19:06:49 +00:00
|
|
|
echo ""
|
|
|
|
echo "Specifying Dependencies:"
|
|
|
|
echo "--with-DEPENDENCY[=path] Use the given dependency. Optionally, provide the"
|
|
|
|
echo " path."
|
|
|
|
echo "--without-DEPENDENCY Do not link to the given dependency. This may"
|
|
|
|
echo " disable features and components."
|
|
|
|
echo ""
|
|
|
|
echo "Valid dependencies are listed below."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-dpdk[=DIR] Build against a custom dpdk version. By default, the dpdk"
|
|
|
|
echo " --without-dpdk submodule in spdk tree will be used."
|
2017-03-30 19:06:49 +00:00
|
|
|
echo " example: /usr/share/dpdk/x86_64-default-linuxapp-gcc"
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-env=DIR Use an alternate environment implementation instead of DPDK."
|
2019-02-08 21:37:23 +00:00
|
|
|
echo " Implies --without-dpdk."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-idxd Build the IDXD library and accel framework plug-in module."
|
|
|
|
echo " --without-idxd Disabled while experimental. Only built for x86 when enabled."
|
2022-10-04 19:14:10 +00:00
|
|
|
echo " --with-crypto Build isa-l-crypto and vbdev crypto module. No path required."
|
|
|
|
echo " --without-crypto Disable isa-l-crypto and vbdev crypto module."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-fio[=DIR] Build fio_plugin."
|
|
|
|
echo " --without-fio default: /usr/src/fio"
|
2022-01-19 10:12:50 +00:00
|
|
|
echo " --with-xnvme Build xNVMe bdev module."
|
|
|
|
echo " --without-xnvme No path required."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-vhost Build vhost target. Enabled by default."
|
|
|
|
echo " --without-vhost No path required."
|
|
|
|
echo " --with-virtio Build vhost initiator and virtio-pci bdev modules."
|
|
|
|
echo " --without-virtio No path required."
|
2022-07-28 07:42:43 +00:00
|
|
|
echo " --with-vfio-user[=DIR] Build custom vfio-user transport for NVMf target and vfio-user target."
|
|
|
|
echo " vfio-user initiator is always built-in in Linux."
|
2022-10-08 04:21:55 +00:00
|
|
|
echo " example: /usr/src/libvfio-user"
|
|
|
|
echo " --without-vfio-user No path required."
|
2022-10-28 23:07:51 +00:00
|
|
|
echo " --with-vbdev-compress Build vbdev compression module and dependencies."
|
|
|
|
echo " --without-vbdev-compress No path required."
|
2022-10-28 21:56:55 +00:00
|
|
|
echo " --with-dpdk-compressdev Build accel DPDK compression module and dependencies."
|
|
|
|
echo " --without-dpdk-compressdev No path required."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-rbd Build Ceph RBD bdev module."
|
|
|
|
echo " --without-rbd No path required."
|
2022-11-29 05:56:56 +00:00
|
|
|
echo " --with-ublk Build ublk library."
|
|
|
|
echo " --without-ublk No path required."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-rdma[=DIR] Build RDMA transport for NVMf target and initiator."
|
|
|
|
echo " --without-rdma Accepts optional RDMA provider name. Can be \"verbs\" or \"mlx5_dv\"."
|
2020-03-14 12:08:29 +00:00
|
|
|
echo " If no provider specified, \"verbs\" provider is used by default."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-fc[=DIR] Build FC transport for NVMf target."
|
|
|
|
echo " --without-fc If an argument is provided, it is considered a directory containing"
|
2019-04-22 09:28:02 +00:00
|
|
|
echo " libufc.a and fc_lld.h. Otherwise the regular system paths will"
|
|
|
|
echo " be searched."
|
2022-09-15 10:55:46 +00:00
|
|
|
echo " --with-daos[=DIR] Build DAOS bdev module."
|
2022-03-08 23:55:01 +00:00
|
|
|
echo " --without-daos No path required."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-shared Build spdk shared libraries."
|
|
|
|
echo " --without-shared No path required."
|
|
|
|
echo " --with-iscsi-initiator Build with iscsi bdev module."
|
|
|
|
echo " --without-iscsi-initiator No path required."
|
2023-01-13 17:27:12 +00:00
|
|
|
echo " --with-vtune=DIR Required to profile I/O under Intel VTune Amplifier XE. (Deprecated)"
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --without-vtune example: /opt/intel/vtune_amplifier_xe_version"
|
2023-05-01 13:38:46 +00:00
|
|
|
echo " --with-ocf[=DIR] Build OCF library and bdev module."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --without-ocf If argument is directory, interpret it as root of OCF repo"
|
2018-09-20 16:54:49 +00:00
|
|
|
echo " If argument is file, interpret it as compiled OCF lib"
|
2019-02-12 13:27:52 +00:00
|
|
|
echo " If no argument is specified, OCF git submodule is used by default"
|
2018-09-20 16:54:49 +00:00
|
|
|
echo " example: /usr/src/ocf/"
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-uring[=DIR] Build I/O uring bdev or socket module."
|
|
|
|
echo " --without-uring If an argument is provided, it is considered a directory containing"
|
2019-06-27 08:10:02 +00:00
|
|
|
echo " liburing.a and io_uring.h. Otherwise the regular system paths will"
|
|
|
|
echo " be searched."
|
2022-09-21 05:49:45 +00:00
|
|
|
echo " --without-uring-zns Build I/O uring module without ZNS (zoned namespaces) support."
|
2022-06-24 23:38:40 +00:00
|
|
|
echo " --with-openssl[=DIR] Build OPENSSL with custom path. Otherwise the regular system paths will"
|
|
|
|
echo " be searched."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-fuse Build FUSE components for mounting a blobfs filesystem."
|
|
|
|
echo " --without-fuse No path required."
|
|
|
|
echo " --with-nvme-cuse Build NVMe driver with support for CUSE-based character devices."
|
|
|
|
echo " --without-nvme-cuse No path required."
|
2022-04-27 09:18:05 +00:00
|
|
|
echo " --with-raid5f Build with bdev_raid module RAID5f support."
|
|
|
|
echo " --without-raid5f No path required."
|
2021-11-22 19:02:33 +00:00
|
|
|
echo " --with-wpdk=DIR Build using WPDK to provide support for Windows (experimental)."
|
|
|
|
echo " --without-wpdk The argument must be a directory containing lib and include."
|
|
|
|
echo " --with-usdt Build with userspace DTrace probes enabled."
|
|
|
|
echo " --without-usdt No path required."
|
test/nvmf: fuzz nvmf target using LLVM's libFuzzer
LLVM provides libFuzzer which does coverage-guided
fuzzing of a library or application under test. For
SPDK, we can use this as a new and better way to
generate random commands to the SPDK nvmf target.
By default, libFuzzer provides the main() and your
source file just provides the function called by
LLVM for each iteration of random data. But this
doesn't really work for SPDK since we need to start
the app framework and the nvmf target. So we
specify -fsanitizer=fuzzer-no-link, explicitly
specify the location of the fuzzer_no_main library
and then call LLVMFuzzerRunDriver to start the
fuzzing process once we are ready.
Since this is all coverage-guided, we invoke the
fuzzer inside the nvmf target application. So this
patch creates a new target application called
'llvm_nvme_fuzz'. One core is needed to run the
nvmf target, then we spawn a pthread to run the
fuzzer against it.
Currently there are two fuzzers defined. Fuzzer 0
does random testing of admin commands. Fuzzer 1
is focused solely on GET_LOG_PAGE and fuzzes a
smaller subset of the bytes in the spdk_nvme_cmd.
Additional fuzzers can be added in the future for
other commands, testing I/O queues, data payloads,
etc.
You do need to specify CC and CXX when running
configure, as well as specify the location of the
special clang_rt.fuzz_no_main library. The path of
that library is dependent on your clang version and
architecture. If using clang-12 on x86_64 platform,
it will look like:
CC=clang-12 CXX=clang++-12 ./configure --with-fuzzer= \
/usr/lib/llvm-12/lib/clang/12.0.0/lib/linux/libclang_rt.fuzzer_no_main-x86_64.a
Then just do the following to demonstrate the fuzzer
tool.
make
test/nvmf/target/llvm_nvme_fuzz.sh --time=60 --fuzzer=0
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iee0997501893ac284a3947a1db7a155c5ceb7849
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10038
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-15 21:54:52 +00:00
|
|
|
echo " --with-fuzzer Build with LLVM fuzzing enabled."
|
|
|
|
echo " Path to clang_rt.fuzzer_no_main library required."
|
|
|
|
echo " Requires setting CC and CXX to clang."
|
|
|
|
echo " (Typically /usr/lib/llvm-VER/lib/clang/VER/lib/linux/libclang_rt.fuzzer_no_main-ARCH.a)"
|
2022-01-05 09:14:39 +00:00
|
|
|
echo " --with-sma Generate Storage Management Agent's protobuf interface"
|
|
|
|
echo " --without-sma No path required."
|
nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach:
Avahi Daemon needs to be running to provide the mDNS server service. In the SPDK, Avahi-client library based client API is implemented.
The client API will connect to the Avahi-daemon and receive events for new discovery and removal of an existing discovery entry.
Following sets on new RPCs have been introduced.
scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
User shall initiate an mDNS based discovery using this RPC. This will start a Avahi-client based poller
looking for new discovery events from the Avahi server. On a new discovery of the discovery controller,
the existing bdev_nvme_start_discovery API will be invoked with the trid of the discovery controller learnt.
This will enable automatic connection of the initiator to the subsystems discovered from the discovery controller.
Multiple mdns discovery instances can be run by specifying a unique bdev-prefix and a unique servicename to discover as parameters.
scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
This will stop the Avahi poller that was started for the specified service.Internally bdev_nvme_stop_discovery
API will be invoked for each of the discovery controllers learnt automatically by this instance of mdns discovery service.
This will result in termination of connections to all the subsystems learnt by this mdns discovery instance.
scripts/rpc.py bdev_nvme_get_mdns_discovery_info
This RPC will display the list of mdns discovery instances running and the trid of the controllers discovered by these instances.
Test Result:
root@ubuntu-pm-18-226:~/param-spdk/spdk/build/bin# ./nvmf_tgt -i 1 -s 2048 -m 0xF
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[
{
"name": "cdc_auto",
"svcname": "_nvme-disc._tcp",
"referrals": [
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
}
]
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[
{
"name": "cdc_auto02n1",
"aliases": [
"600110d6-1681-1681-0403-000045805c45"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-1681-1681-0403-000045805c45",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T0",
"serial_number": "00-681681dc681681dc",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto00n1",
"aliases": [
"600110da-09a6-09a6-0302-00005eeb19b4"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 2048,
"uuid": "600110da-09a6-09a6-0302-00005eeb19b4",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0"
},
"ctrlr_data": {
"cntlid": 1,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P2T0",
"serial_number": "00-ab09a6f5ab09a6f5",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n1",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8c"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8c",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n2",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8d"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8d",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 2,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com>
Change-Id: Ic2c2e614e2549a655c7f81ae844b80d8505a4f02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15703
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-30 20:11:23 +00:00
|
|
|
echo " --with-avahi Build with Avahi mDNS discovery client service enabled in bdev-nvme module."
|
|
|
|
echo " --without-avahi No path required."
|
2017-03-30 19:06:49 +00:00
|
|
|
echo ""
|
2018-03-28 18:24:48 +00:00
|
|
|
echo "Environment variables:"
|
|
|
|
echo ""
|
2019-07-24 17:15:08 +00:00
|
|
|
echo "CC C compiler"
|
2018-03-28 18:24:48 +00:00
|
|
|
echo "CFLAGS C compiler flags"
|
2019-07-24 17:15:08 +00:00
|
|
|
echo "CXX C++ compiler"
|
2018-03-28 18:24:48 +00:00
|
|
|
echo "CXXFLAGS C++ compiler flags"
|
2019-07-24 17:15:08 +00:00
|
|
|
echo "LD Linker"
|
2018-03-28 18:24:48 +00:00
|
|
|
echo "LDFLAGS Linker flags"
|
|
|
|
echo "DESTDIR Destination for 'make install'"
|
|
|
|
echo ""
|
2017-03-30 19:06:49 +00:00
|
|
|
}
|
|
|
|
|
2018-10-03 14:58:36 +00:00
|
|
|
# Load default values
|
2021-11-25 01:40:57 +00:00
|
|
|
# Convert config to sourceable configuration file
|
2019-08-26 23:02:30 +00:00
|
|
|
sed -r 's/CONFIG_([[:alnum:]_]+)=(.*)/CONFIG[\1]=\2/g' $rootdir/CONFIG > $rootdir/CONFIG.sh
|
2018-10-03 14:58:36 +00:00
|
|
|
declare -A CONFIG
|
2019-08-26 23:02:30 +00:00
|
|
|
source $rootdir/CONFIG.sh
|
|
|
|
rm $rootdir/CONFIG.sh
|
2018-10-03 14:58:36 +00:00
|
|
|
|
2022-04-26 19:22:18 +00:00
|
|
|
# Try to expand literal ~ that might have been passed as an option via --long-opt=~/dir.
|
|
|
|
set -- "${@//\~/~}"
|
|
|
|
|
2020-04-07 12:05:15 +00:00
|
|
|
for i in "$@"; do
|
|
|
|
case "$i" in
|
|
|
|
--cross-prefix=*)
|
|
|
|
CONFIG[CROSS_PREFIX]="${i#*=}"
|
|
|
|
;;
|
|
|
|
--enable-lto)
|
|
|
|
CONFIG[LTO]=y
|
|
|
|
;;
|
|
|
|
--disable-lto)
|
|
|
|
CONFIG[LTO]=n
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2020-02-20 16:57:44 +00:00
|
|
|
# Detect the compiler toolchain
|
2021-01-21 11:54:00 +00:00
|
|
|
$rootdir/scripts/detect_cc.sh --cc="$CC" --cxx="$CXX" --lto="${CONFIG[LTO]}" --ld="$LD" --cross-prefix="${CONFIG[CROSS_PREFIX]}" > $rootdir/mk/cc.mk
|
2020-02-20 16:57:44 +00:00
|
|
|
|
2021-01-21 12:05:25 +00:00
|
|
|
CC=$(grep "DEFAULT_CC=" "$rootdir/mk/cc.mk" | sed s/DEFAULT_CC=//)
|
|
|
|
CC_TYPE=$(grep "CC_TYPE=" "$rootdir/mk/cc.mk" | cut -d "=" -f 2)
|
2020-02-20 16:57:44 +00:00
|
|
|
|
|
|
|
arch=$($CC -dumpmachine)
|
2020-03-11 08:38:46 +00:00
|
|
|
sys_name=$(uname -s)
|
2020-02-20 16:57:44 +00:00
|
|
|
|
2021-03-03 09:48:43 +00:00
|
|
|
if [[ $arch == *mingw* ]] || [[ $arch == *windows* ]]; then
|
|
|
|
sys_name=Windows
|
|
|
|
fi
|
|
|
|
|
2021-01-22 21:04:59 +00:00
|
|
|
if [[ $sys_name != "Linux" ]]; then
|
2020-02-20 16:57:44 +00:00
|
|
|
# Vhost, rte_vhost library and virtio are only supported on Linux.
|
|
|
|
CONFIG[VHOST]="n"
|
|
|
|
CONFIG[VIRTIO]="n"
|
|
|
|
echo "Notice: Vhost, rte_vhost library and virtio are only supported on Linux. Turning off default feature."
|
|
|
|
fi
|
|
|
|
|
2018-03-08 23:02:09 +00:00
|
|
|
function check_dir() {
|
|
|
|
arg="$1"
|
|
|
|
dir="${arg#*=}"
|
|
|
|
if [ ! -d "$dir" ]; then
|
|
|
|
echo "$arg: directory not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-01-17 14:23:01 +00:00
|
|
|
# On x86_64 'clang -dumpmachine' produces x86_64-pc-linux-gnu
|
|
|
|
# whereas the dpdk might be built with gcc and its libs lie in
|
2022-11-30 13:25:22 +00:00
|
|
|
# x86_64-linux-gnu. Let's find the right libdir for dpdk libs.
|
2022-01-17 14:23:01 +00:00
|
|
|
function find_dpdk_arch_libdir() {
|
2022-11-30 13:25:22 +00:00
|
|
|
local dpdk_libdir="$1/lib"
|
|
|
|
|
|
|
|
# Use libdir with 'lib' or 'lib64'
|
|
|
|
if [[ ! -d "$dpdk_libdir" ]]; then
|
|
|
|
dpdk_libdir+="64"
|
|
|
|
fi
|
2022-01-17 14:23:01 +00:00
|
|
|
|
|
|
|
# Checking first what we have with $arch, then clang
|
|
|
|
# variant of arch.
|
|
|
|
arches=("$arch" "$(echo $arch | sed 's/-pc//g')")
|
|
|
|
for a in "${arches[@]}"; do
|
2022-11-30 13:25:22 +00:00
|
|
|
local libdir_arch="$dpdk_libdir/$a"
|
|
|
|
if [[ -d "$libdir_arch" ]]; then
|
|
|
|
echo "$libdir_arch"
|
2022-01-17 14:23:01 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Fallback to the libdir without arch component
|
2022-11-30 13:25:22 +00:00
|
|
|
echo "$dpdk_libdir"
|
2022-01-17 14:23:01 +00:00
|
|
|
}
|
|
|
|
|
2022-01-19 05:42:56 +00:00
|
|
|
function check_IPSec_mb() {
|
|
|
|
local mode=$1
|
|
|
|
local dpdk_libdir=$2
|
|
|
|
local dpdk_incdir=$3
|
|
|
|
local have_ipsec_mb=n
|
|
|
|
|
|
|
|
if [[ $mode = "pkg-config" ]]; then
|
|
|
|
local dpdk_libs
|
|
|
|
|
|
|
|
# Request libdpdk pkg-config settings to figure out if the IPSec_MB is used
|
|
|
|
# as a dependency.
|
|
|
|
# Due to some reason pkg-config shows -lIPSec_MB only with --static option
|
2022-03-02 18:55:47 +00:00
|
|
|
dpdk_libs=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --libs --static libdpdk)
|
2022-01-19 05:42:56 +00:00
|
|
|
if echo "$dpdk_libs" | grep "\-lIPSec_MB" > /dev/null 2>&1; then
|
|
|
|
have_ipsec_mb=y
|
|
|
|
fi
|
|
|
|
elif [[ $mode = "build-config" ]]; then
|
|
|
|
# Use dpdk build config header to check if the IPSec_MB was used.
|
|
|
|
if grep -F "define RTE_CRYPTO_IPSEC_MB 1" "$dpdk_incdir/rte_build_config.h" > /dev/null 2>&1; then
|
|
|
|
have_ipsec_mb=y
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "ERROR: Invalid IPSec_MB checking mode $mode."
|
|
|
|
echo "ERROR: Only \"pkg-config\" and \"build-config\" available."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [[ $have_ipsec_mb = "n" ]]; then
|
|
|
|
CONFIG[IPSEC_MB]=n
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Since we don't know the library path where the IPSec_MB is located
|
|
|
|
# let's find it out with the ldd utility. This can be a standard location
|
|
|
|
# or a custom build.
|
|
|
|
local librte_crypto_ipsec_mb="$dpdk_libdir/librte_crypto_ipsec_mb.so"
|
|
|
|
if [[ -f "$librte_crypto_ipsec_mb" ]]; then
|
|
|
|
local ipsec_mb_libdir
|
|
|
|
|
|
|
|
ipsec_mb_libdir=$(ldd "$librte_crypto_ipsec_mb" | grep "libIPSec_MB.so" \
|
|
|
|
| sed -e 's/\s*libIPSec_MB.so.*=>\s//' -e 's/\/libIPSec_MB.so.*$//')
|
|
|
|
if [[ -d $ipsec_mb_libdir ]]; then
|
|
|
|
CONFIG[IPSEC_MB]=y
|
|
|
|
CONFIG[IPSEC_MB_DIR]="$ipsec_mb_libdir"
|
|
|
|
elif [[ $ipsec_mb_libdir = "not found" ]]; then
|
|
|
|
# ldconfig cache is broken, old build with refs to non-existing libs, etc.
|
|
|
|
echo "ERROR: Invalid IPSec_MB installation. Library is not found and/or ldconfig cache is broken!"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
# Failed to check for IPSec_MB lib path. Let's just assume it is lives
|
|
|
|
# in one of the standard locations (/usr/lib, etc.).
|
|
|
|
CONFIG[IPSEC_MB]=y
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# pkg-config says there is IPSec_mb and dpdk lib does not have it. Let's just
|
|
|
|
# assume it is installed in the system in one of the standard locations.
|
|
|
|
CONFIG[IPSEC_MB]=y
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-03-30 19:06:49 +00:00
|
|
|
for i in "$@"; do
|
|
|
|
case "$i" in
|
2021-01-21 11:54:00 +00:00
|
|
|
-h | --help)
|
2017-03-30 19:06:49 +00:00
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
2020-04-07 12:05:15 +00:00
|
|
|
--cross-prefix=*) ;&
|
|
|
|
--enable-lto) ;&
|
|
|
|
--disable-lto)
|
|
|
|
# Options handled before detecting CC.
|
|
|
|
;;
|
2017-11-15 17:36:36 +00:00
|
|
|
--prefix=*)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[PREFIX]="${i#*=}"
|
2017-11-15 17:36:36 +00:00
|
|
|
;;
|
2019-07-23 17:52:47 +00:00
|
|
|
--target-arch=*)
|
|
|
|
CONFIG[ARCH]="${i#*=}"
|
|
|
|
;;
|
2022-06-08 12:43:12 +00:00
|
|
|
--libdir=*)
|
|
|
|
CONFIG[LIBDIR]="${i#*=}"
|
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--enable-debug)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[DEBUG]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--disable-debug)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[DEBUG]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--enable-asan)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[ASAN]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--disable-asan)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[ASAN]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--enable-ubsan)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[UBSAN]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--disable-ubsan)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[UBSAN]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2017-05-24 22:00:54 +00:00
|
|
|
--enable-tsan)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[TSAN]=y
|
2017-05-24 22:00:54 +00:00
|
|
|
;;
|
|
|
|
--disable-tsan)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[TSAN]=n
|
2017-05-24 22:00:54 +00:00
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--enable-coverage)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[COVERAGE]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--disable-coverage)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[COVERAGE]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2019-02-11 18:19:32 +00:00
|
|
|
--enable-pgo-capture)
|
|
|
|
CONFIG[PGO_CAPTURE]=y
|
|
|
|
;;
|
|
|
|
--disable-pgo-capture)
|
|
|
|
CONFIG[PGO_CAPTURE]=n
|
|
|
|
;;
|
|
|
|
--enable-pgo-use)
|
|
|
|
CONFIG[PGO_USE]=y
|
|
|
|
;;
|
|
|
|
--disable-pgo-use)
|
|
|
|
CONFIG[PGO_USE]=n
|
|
|
|
;;
|
2018-03-06 22:39:04 +00:00
|
|
|
--enable-tests)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[TESTS]=y
|
2018-03-06 22:39:04 +00:00
|
|
|
;;
|
|
|
|
--disable-tests)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[TESTS]=n
|
2018-03-06 22:39:04 +00:00
|
|
|
;;
|
2020-03-06 09:08:29 +00:00
|
|
|
--enable-unit-tests)
|
|
|
|
CONFIG[UNIT_TESTS]=y
|
|
|
|
;;
|
|
|
|
--disable-unit-tests)
|
|
|
|
CONFIG[UNIT_TESTS]=n
|
|
|
|
;;
|
2020-02-27 16:59:20 +00:00
|
|
|
--enable-examples)
|
|
|
|
CONFIG[EXAMPLES]=y
|
|
|
|
;;
|
|
|
|
--disable-examples)
|
|
|
|
CONFIG[EXAMPLES]=n
|
|
|
|
;;
|
2021-04-17 05:09:30 +00:00
|
|
|
--enable-apps)
|
|
|
|
CONFIG[APPS]=y
|
|
|
|
;;
|
|
|
|
--disable-apps)
|
|
|
|
CONFIG[APPS]=N
|
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--enable-werror)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[WERROR]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--disable-werror)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[WERROR]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2021-01-14 11:06:33 +00:00
|
|
|
--enable-cet)
|
|
|
|
CONFIG[CET]=y
|
|
|
|
;;
|
|
|
|
--disable-cet)
|
|
|
|
CONFIG[CET]=n
|
|
|
|
;;
|
2021-06-15 16:42:29 +00:00
|
|
|
--with-dpdk)
|
2022-01-17 14:23:01 +00:00
|
|
|
# Can we use pkg-config?
|
|
|
|
if command -v "pkg-config" > /dev/null 2>&1 && pkg-config --exists libdpdk; then
|
|
|
|
dpdk_libdir=$(pkg-config --variable=libdir libdpdk)
|
|
|
|
dpdk_libdir=$(readlink -f $dpdk_libdir)
|
|
|
|
dpdk_incdir=$(pkg-config --variable=includedir libdpdk)
|
|
|
|
echo "Using DPDK lib dir $dpdk_libdir"
|
|
|
|
CONFIG[DPDK_LIB_DIR]=$dpdk_libdir
|
|
|
|
CONFIG[DPDK_INC_DIR]=$dpdk_incdir
|
2021-06-15 16:42:29 +00:00
|
|
|
CONFIG[DPDK_PKG_CONFIG]=y
|
|
|
|
CFLAGS="${CFLAGS:+$CFLAGS }$(pkg-config --cflags libdpdk)"
|
2022-01-19 05:42:56 +00:00
|
|
|
check_IPSec_mb "pkg-config" "$dpdk_libdir" "$dpdk_incdir"
|
2021-06-15 16:42:29 +00:00
|
|
|
else
|
|
|
|
echo "libdpdk.pc not found, aborting"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2019-02-08 21:37:23 +00:00
|
|
|
--with-dpdk=*)
|
|
|
|
check_dir "$i"
|
2022-01-17 14:23:01 +00:00
|
|
|
dpdk_dir=$(readlink -f ${i#*=})
|
|
|
|
dpdk_libdir=$(find_dpdk_arch_libdir $dpdk_dir)
|
|
|
|
dpdk_incdir="$dpdk_dir/include"
|
|
|
|
|
|
|
|
# Can we use pkg-config?
|
2022-03-02 18:55:47 +00:00
|
|
|
if command -v "pkg-config" > /dev/null 2>&1 && PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --exists libdpdk; then
|
2022-01-17 14:23:01 +00:00
|
|
|
echo "Using $dpdk_libdir/pkgconfig for additional libs..."
|
2022-04-27 15:20:40 +00:00
|
|
|
sysroot_dir=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=pc_sysrootdir libdpdk)
|
2022-08-31 15:11:13 +00:00
|
|
|
dpdk_libdir=$(PKG_CONFIG_SYSROOT_DIR='' PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=libdir libdpdk)
|
2022-04-27 15:20:40 +00:00
|
|
|
dpdk_libdir=$(readlink -f "${sysroot_dir}$dpdk_libdir")
|
2022-01-17 14:23:01 +00:00
|
|
|
if ! echo $dpdk_libdir | grep $dpdk_dir > /dev/null 2>&1; then
|
|
|
|
echo "ERROR: pkg-config reported DPDK libdir $dpdk_libdir is out of the directory specified with --with-dpdk="
|
|
|
|
echo "ERROR: do you have another DPDK installed in the system?"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-02 18:55:47 +00:00
|
|
|
CFLAGS="${CFLAGS:+$CFLAGS }$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --cflags libdpdk)"
|
2022-04-27 15:20:40 +00:00
|
|
|
dpdk_incdir="${sysroot_dir}$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=includedir libdpdk)"
|
2022-01-19 05:42:56 +00:00
|
|
|
check_IPSec_mb "pkg-config" "$dpdk_libdir" "$dpdk_incdir"
|
2022-01-18 07:57:15 +00:00
|
|
|
else
|
|
|
|
echo "Using $dpdk_incdir/rte_build_config.h for additional libs..."
|
|
|
|
|
2022-01-19 05:42:56 +00:00
|
|
|
check_IPSec_mb "build-config" "$dpdk_libdir" "$dpdk_incdir"
|
2022-01-17 14:23:01 +00:00
|
|
|
fi
|
|
|
|
echo "DPDK libraries: $dpdk_libdir"
|
|
|
|
echo "DPDK includes: $dpdk_incdir"
|
|
|
|
CONFIG[DPDK_DIR]=$dpdk_dir
|
|
|
|
CONFIG[DPDK_LIB_DIR]="$dpdk_libdir"
|
|
|
|
CONFIG[DPDK_INC_DIR]="$dpdk_incdir"
|
|
|
|
CONFIG[DPDK_PKG_CONFIG]=n
|
2019-02-08 21:37:23 +00:00
|
|
|
;;
|
|
|
|
--without-dpdk)
|
|
|
|
CONFIG[DPDK_DIR]=
|
|
|
|
;;
|
2021-03-03 09:48:43 +00:00
|
|
|
--with-wpdk=*)
|
|
|
|
check_dir "$i"
|
|
|
|
CONFIG[WPDK_DIR]=$(readlink -f ${i#*=})
|
|
|
|
;;
|
2021-11-22 19:02:33 +00:00
|
|
|
--without-wpdk)
|
|
|
|
CONFIG[WPDK_DIR]=
|
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--with-env=*)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[ENV]="${i#*=}"
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2022-11-29 05:56:56 +00:00
|
|
|
--with-ublk)
|
|
|
|
CONFIG[UBLK]=y
|
|
|
|
;;
|
|
|
|
--without-ublk)
|
|
|
|
CONFIG[UBLK]=n
|
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--with-rbd)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[RBD]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--without-rbd)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[RBD]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2020-03-14 12:08:29 +00:00
|
|
|
--with-rdma=*)
|
|
|
|
CONFIG[RDMA]=y
|
|
|
|
CONFIG[RDMA_PROV]=${i#*=}
|
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--with-rdma)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[RDMA]=y
|
2020-03-14 12:08:29 +00:00
|
|
|
CONFIG[RDMA_PROV]="verbs"
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--without-rdma)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[RDMA]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2019-04-22 09:28:02 +00:00
|
|
|
--with-fc=*)
|
|
|
|
CONFIG[FC]=y
|
|
|
|
CONFIG[FC_PATH]=$(readlink -f ${i#*=})
|
|
|
|
;;
|
|
|
|
--with-fc)
|
|
|
|
CONFIG[FC]=y
|
|
|
|
CONFIG[FC_PATH]=
|
|
|
|
;;
|
|
|
|
--without-fc)
|
|
|
|
CONFIG[FC]=n
|
|
|
|
CONFIG[FC_PATH]=
|
|
|
|
;;
|
2022-03-08 23:55:01 +00:00
|
|
|
--with-daos)
|
|
|
|
CONFIG[DAOS]=y
|
2022-09-15 10:55:46 +00:00
|
|
|
CONFIG[DAOS_DIR]=""
|
|
|
|
;;
|
|
|
|
--with-daos=*)
|
|
|
|
CONFIG[DAOS]=y
|
|
|
|
check_dir "$i"
|
|
|
|
CONFIG[DAOS_DIR]=$(readlink -f ${i#*=})
|
2022-03-08 23:55:01 +00:00
|
|
|
;;
|
|
|
|
--without-daos)
|
|
|
|
CONFIG[DAOS]=n
|
|
|
|
;;
|
2018-08-14 17:56:26 +00:00
|
|
|
--with-shared)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[SHARED]=y
|
2018-08-14 17:56:26 +00:00
|
|
|
;;
|
|
|
|
--without-shared)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[SHARED]=n
|
2018-08-14 17:56:26 +00:00
|
|
|
;;
|
2017-12-04 17:07:04 +00:00
|
|
|
--with-iscsi-initiator)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[ISCSI_INITIATOR]=y
|
2017-12-04 17:07:04 +00:00
|
|
|
;;
|
|
|
|
--without-iscsi-initiator)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[ISCSI_INITIATOR]=n
|
2017-12-04 17:07:04 +00:00
|
|
|
;;
|
2018-03-22 23:24:14 +00:00
|
|
|
--with-crypto)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[CRYPTO]=y
|
2018-03-22 23:24:14 +00:00
|
|
|
;;
|
|
|
|
--without-crypto)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[CRYPTO]=n
|
2018-03-22 23:24:14 +00:00
|
|
|
;;
|
2018-03-14 00:05:36 +00:00
|
|
|
--with-vhost)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VHOST]=y
|
2018-03-14 00:05:36 +00:00
|
|
|
;;
|
|
|
|
--without-vhost)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VHOST]=n
|
2018-03-14 00:05:36 +00:00
|
|
|
;;
|
2017-10-17 17:04:28 +00:00
|
|
|
--with-virtio)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VIRTIO]=y
|
2017-10-17 17:04:28 +00:00
|
|
|
;;
|
|
|
|
--without-virtio)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VIRTIO]=n
|
2017-10-17 17:04:28 +00:00
|
|
|
;;
|
2020-11-02 15:32:20 +00:00
|
|
|
--with-vfio-user)
|
|
|
|
CONFIG[VFIO_USER]=y
|
2021-02-19 09:31:12 +00:00
|
|
|
CONFIG[VFIO_USER_DIR]=""
|
|
|
|
;;
|
|
|
|
--with-vfio-user=*)
|
|
|
|
CONFIG[VFIO_USER]=y
|
|
|
|
check_dir "$i"
|
|
|
|
CONFIG[VFIO_USER_DIR]=$(readlink -f ${i#*=})
|
2020-11-02 15:32:20 +00:00
|
|
|
;;
|
|
|
|
--without-vfio-user)
|
|
|
|
CONFIG[VFIO_USER]=n
|
|
|
|
;;
|
2022-10-28 23:07:51 +00:00
|
|
|
--with-vbdev-compress)
|
|
|
|
CONFIG[VBDEV_COMPRESS]=y
|
2018-09-21 14:37:54 +00:00
|
|
|
;;
|
2022-10-28 23:07:51 +00:00
|
|
|
--without-vbdev-compress)
|
|
|
|
CONFIG[VBDEV_COMPRESS]=n
|
2018-09-21 14:37:54 +00:00
|
|
|
;;
|
2022-10-28 21:56:55 +00:00
|
|
|
--with-dpdk-compressdev)
|
|
|
|
CONFIG[DPDK_COMPRESSDEV]=y
|
|
|
|
;;
|
|
|
|
--without-dpdk-compressdev)
|
|
|
|
CONFIG[DPDK_COMPRESSDEV]=n
|
|
|
|
;;
|
2022-01-19 10:12:50 +00:00
|
|
|
--with-xnvme)
|
|
|
|
CONFIG[XNVME]=y
|
|
|
|
;;
|
|
|
|
--without-xnvme)
|
|
|
|
CONFIG[XNVME]=n
|
|
|
|
;;
|
2020-03-02 19:32:59 +00:00
|
|
|
--with-fio) ;&
|
2017-03-30 19:06:49 +00:00
|
|
|
--with-fio=*)
|
2020-03-02 19:32:59 +00:00
|
|
|
if [[ ${i#*=} != "$i" ]]; then
|
2022-04-26 19:22:18 +00:00
|
|
|
CONFIG[FIO_SOURCE_DIR]=${i#*=}
|
2020-03-02 19:32:59 +00:00
|
|
|
fi
|
|
|
|
check_dir "--with-fio=${CONFIG[FIO_SOURCE_DIR]}"
|
2022-04-26 19:22:18 +00:00
|
|
|
CONFIG[FIO_SOURCE_DIR]=$(readlink -f "${CONFIG[FIO_SOURCE_DIR]}")
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[FIO_PLUGIN]=y
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
|
|
|
--without-fio)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[FIO_PLUGIN]=n
|
2017-03-30 19:06:49 +00:00
|
|
|
;;
|
2017-05-30 08:45:46 +00:00
|
|
|
--with-vtune=*)
|
2018-03-08 23:02:09 +00:00
|
|
|
check_dir "$i"
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VTUNE_DIR]="${i#*=}"
|
|
|
|
CONFIG[VTUNE]=y
|
2017-05-30 08:45:46 +00:00
|
|
|
;;
|
|
|
|
--without-vtune)
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VTUNE_DIR]=
|
|
|
|
CONFIG[VTUNE]=n
|
2017-05-30 08:45:46 +00:00
|
|
|
;;
|
2019-02-12 13:27:52 +00:00
|
|
|
--with-ocf)
|
|
|
|
CONFIG[OCF]=y
|
2022-10-17 18:28:24 +00:00
|
|
|
CONFIG[OCF_PATH]=$(readlink -f "$rootdir/ocf")
|
2019-02-12 13:27:52 +00:00
|
|
|
;;
|
2018-09-20 16:54:49 +00:00
|
|
|
--with-ocf=*)
|
|
|
|
CONFIG[OCF]=y
|
|
|
|
CONFIG[OCF_PATH]=$(readlink -f ${i#*=})
|
|
|
|
;;
|
|
|
|
--without-ocf)
|
|
|
|
CONFIG[OCF]=n
|
|
|
|
CONFIG[OCF_PATH]=
|
|
|
|
;;
|
2019-02-14 19:07:42 +00:00
|
|
|
--with-uring=*)
|
|
|
|
CONFIG[URING]=y
|
|
|
|
CONFIG[URING_PATH]=$(readlink -f ${i#*=})
|
|
|
|
;;
|
|
|
|
--with-uring)
|
|
|
|
CONFIG[URING]=y
|
2022-09-21 05:49:45 +00:00
|
|
|
CONFIG[URING_ZNS]=y
|
2019-02-14 19:07:42 +00:00
|
|
|
CONFIG[URING_PATH]=
|
|
|
|
;;
|
|
|
|
--without-uring)
|
|
|
|
CONFIG[URING]=n
|
|
|
|
CONFIG[URING_PATH]=
|
|
|
|
;;
|
2022-09-21 05:49:45 +00:00
|
|
|
--without-uring-zns)
|
|
|
|
CONFIG[URING_ZNS]=n
|
2022-07-02 14:53:02 +00:00
|
|
|
;;
|
2022-06-24 23:38:40 +00:00
|
|
|
--with-openssl=*)
|
|
|
|
check_dir "$i"
|
|
|
|
CONFIG[OPENSSL_PATH]=$(readlink -f ${i#*=})
|
|
|
|
;;
|
2019-10-08 12:28:49 +00:00
|
|
|
--with-fuse)
|
|
|
|
CONFIG[FUSE]=y
|
|
|
|
;;
|
|
|
|
--without-fuse)
|
|
|
|
CONFIG[FUSE]=n
|
|
|
|
;;
|
2019-10-24 18:04:33 +00:00
|
|
|
--with-nvme-cuse)
|
|
|
|
CONFIG[NVME_CUSE]=y
|
|
|
|
;;
|
|
|
|
--without-nvme-cuse)
|
|
|
|
CONFIG[NVME_CUSE]=n
|
|
|
|
;;
|
2022-04-27 09:18:05 +00:00
|
|
|
--with-raid5f)
|
|
|
|
CONFIG[RAID5F]=y
|
2019-11-04 11:35:50 +00:00
|
|
|
;;
|
2022-04-27 09:18:05 +00:00
|
|
|
--without-raid5f)
|
|
|
|
CONFIG[RAID5F]=n
|
2019-11-04 11:35:50 +00:00
|
|
|
;;
|
2020-04-10 15:29:01 +00:00
|
|
|
--with-idxd)
|
|
|
|
CONFIG[IDXD]=y
|
2021-03-31 10:09:42 +00:00
|
|
|
CONFIG[IDXD_KERNEL]=n
|
2020-04-10 15:29:01 +00:00
|
|
|
;;
|
|
|
|
--without-idxd)
|
|
|
|
CONFIG[IDXD]=n
|
|
|
|
;;
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
--with-usdt)
|
|
|
|
CONFIG[USDT]=y
|
|
|
|
;;
|
|
|
|
--without-usdt)
|
|
|
|
CONFIG[USDT]=n
|
|
|
|
;;
|
test/nvmf: fuzz nvmf target using LLVM's libFuzzer
LLVM provides libFuzzer which does coverage-guided
fuzzing of a library or application under test. For
SPDK, we can use this as a new and better way to
generate random commands to the SPDK nvmf target.
By default, libFuzzer provides the main() and your
source file just provides the function called by
LLVM for each iteration of random data. But this
doesn't really work for SPDK since we need to start
the app framework and the nvmf target. So we
specify -fsanitizer=fuzzer-no-link, explicitly
specify the location of the fuzzer_no_main library
and then call LLVMFuzzerRunDriver to start the
fuzzing process once we are ready.
Since this is all coverage-guided, we invoke the
fuzzer inside the nvmf target application. So this
patch creates a new target application called
'llvm_nvme_fuzz'. One core is needed to run the
nvmf target, then we spawn a pthread to run the
fuzzer against it.
Currently there are two fuzzers defined. Fuzzer 0
does random testing of admin commands. Fuzzer 1
is focused solely on GET_LOG_PAGE and fuzzes a
smaller subset of the bytes in the spdk_nvme_cmd.
Additional fuzzers can be added in the future for
other commands, testing I/O queues, data payloads,
etc.
You do need to specify CC and CXX when running
configure, as well as specify the location of the
special clang_rt.fuzz_no_main library. The path of
that library is dependent on your clang version and
architecture. If using clang-12 on x86_64 platform,
it will look like:
CC=clang-12 CXX=clang++-12 ./configure --with-fuzzer= \
/usr/lib/llvm-12/lib/clang/12.0.0/lib/linux/libclang_rt.fuzzer_no_main-x86_64.a
Then just do the following to demonstrate the fuzzer
tool.
make
test/nvmf/target/llvm_nvme_fuzz.sh --time=60 --fuzzer=0
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iee0997501893ac284a3947a1db7a155c5ceb7849
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10038
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-15 21:54:52 +00:00
|
|
|
--with-fuzzer)
|
|
|
|
echo "Must specify fuzzer library path with --with-fuzzer"
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
--with-fuzzer=*)
|
|
|
|
CONFIG[FUZZER]=y
|
|
|
|
CONFIG[FUZZER_LIB]=$(readlink -f ${i#*=})
|
|
|
|
;;
|
|
|
|
--without-fuzzer)
|
|
|
|
CONFIG[FUZZER]=n
|
|
|
|
CONFIG[FUZZER_LIB]=
|
|
|
|
;;
|
2022-01-05 09:14:39 +00:00
|
|
|
--with-sma)
|
|
|
|
CONFIG[SMA]=y
|
|
|
|
;;
|
|
|
|
--without-sma)
|
|
|
|
CONFIG[SMA]=n
|
|
|
|
;;
|
nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach:
Avahi Daemon needs to be running to provide the mDNS server service. In the SPDK, Avahi-client library based client API is implemented.
The client API will connect to the Avahi-daemon and receive events for new discovery and removal of an existing discovery entry.
Following sets on new RPCs have been introduced.
scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
User shall initiate an mDNS based discovery using this RPC. This will start a Avahi-client based poller
looking for new discovery events from the Avahi server. On a new discovery of the discovery controller,
the existing bdev_nvme_start_discovery API will be invoked with the trid of the discovery controller learnt.
This will enable automatic connection of the initiator to the subsystems discovered from the discovery controller.
Multiple mdns discovery instances can be run by specifying a unique bdev-prefix and a unique servicename to discover as parameters.
scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
This will stop the Avahi poller that was started for the specified service.Internally bdev_nvme_stop_discovery
API will be invoked for each of the discovery controllers learnt automatically by this instance of mdns discovery service.
This will result in termination of connections to all the subsystems learnt by this mdns discovery instance.
scripts/rpc.py bdev_nvme_get_mdns_discovery_info
This RPC will display the list of mdns discovery instances running and the trid of the controllers discovered by these instances.
Test Result:
root@ubuntu-pm-18-226:~/param-spdk/spdk/build/bin# ./nvmf_tgt -i 1 -s 2048 -m 0xF
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[
{
"name": "cdc_auto",
"svcname": "_nvme-disc._tcp",
"referrals": [
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
}
]
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[
{
"name": "cdc_auto02n1",
"aliases": [
"600110d6-1681-1681-0403-000045805c45"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-1681-1681-0403-000045805c45",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T0",
"serial_number": "00-681681dc681681dc",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto00n1",
"aliases": [
"600110da-09a6-09a6-0302-00005eeb19b4"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 2048,
"uuid": "600110da-09a6-09a6-0302-00005eeb19b4",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0"
},
"ctrlr_data": {
"cntlid": 1,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P2T0",
"serial_number": "00-ab09a6f5ab09a6f5",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n1",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8c"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8c",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n2",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8d"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8d",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 2,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com>
Change-Id: Ic2c2e614e2549a655c7f81ae844b80d8505a4f02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15703
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-30 20:11:23 +00:00
|
|
|
--with-avahi)
|
|
|
|
CONFIG[AVAHI]=y
|
|
|
|
;;
|
|
|
|
--without-avahi)
|
|
|
|
CONFIG[AVAHI]=n
|
|
|
|
;;
|
2023-03-31 14:55:52 +00:00
|
|
|
--max-lcores='')
|
|
|
|
echo "Must specify max number of lcores for --max-lcores"
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
--max-lcores=*)
|
|
|
|
CONFIG[MAX_LCORES]="${i#*=}"
|
2023-04-12 13:01:41 +00:00
|
|
|
CONFIG["MAX_LCORES"]=${CONFIG["MAX_LCORES"],,}
|
2023-03-31 14:55:52 +00:00
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
--)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unrecognized option $i"
|
|
|
|
usage
|
|
|
|
exit 1
|
2021-01-21 11:54:00 +00:00
|
|
|
;;
|
2017-03-30 19:06:49 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2019-09-25 10:30:10 +00:00
|
|
|
if [[ $arch == x86_64* ]]; then
|
2022-05-24 09:37:35 +00:00
|
|
|
BUILD_CMD=($CC -o /dev/null -x c $CPPFLAGS $CFLAGS $LDFLAGS "-march=native")
|
2019-09-25 10:30:10 +00:00
|
|
|
else
|
2022-05-24 09:37:35 +00:00
|
|
|
BUILD_CMD=($CC -o /dev/null -x c $CPPFLAGS $CFLAGS $LDFLAGS)
|
2019-09-25 10:30:10 +00:00
|
|
|
fi
|
2020-05-14 15:35:42 +00:00
|
|
|
BUILD_CMD+=(-I/usr/local/include -L/usr/local/lib)
|
2019-07-24 17:15:08 +00:00
|
|
|
|
2020-11-02 15:32:20 +00:00
|
|
|
if [[ "${CONFIG[VFIO_USER]}" = "y" ]]; then
|
2022-06-29 20:20:48 +00:00
|
|
|
if ! echo -e '#include <json-c/json.h>' \
|
|
|
|
| "${BUILD_CMD[@]}" -E - 2> /dev/null; then
|
2021-01-28 10:27:57 +00:00
|
|
|
echo "ERROR: --with-vfio-user requires json-c-devel"
|
|
|
|
echo "Please install then re-run this script"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-06-29 20:20:48 +00:00
|
|
|
if ! echo -e '#include <cmocka.h>' \
|
|
|
|
| "${BUILD_CMD[@]}" -E - 2> /dev/null; then
|
2021-01-28 10:27:57 +00:00
|
|
|
echo "ERROR: --with-vfio-user requires libcmocka-devel"
|
|
|
|
echo "Please install then re-run this script"
|
|
|
|
exit 1
|
2020-11-02 15:32:20 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-04-10 15:29:01 +00:00
|
|
|
# IDXD uses Intel specific instructions.
|
|
|
|
if [[ "${CONFIG[IDXD]}" = "y" ]]; then
|
2020-04-28 02:08:10 +00:00
|
|
|
if [ $(uname -s) == "FreeBSD" ]; then
|
|
|
|
intel="hw.model: Intel"
|
|
|
|
cpu_vendor=$(sysctl -a | grep hw.model | cut -c 1-15)
|
|
|
|
else
|
|
|
|
intel="GenuineIntel"
|
2021-01-21 11:54:00 +00:00
|
|
|
cpu_vendor=$(grep -i 'vendor' /proc/cpuinfo --max-count=1)
|
2020-04-28 02:08:10 +00:00
|
|
|
fi
|
2020-04-10 15:29:01 +00:00
|
|
|
if [[ "$cpu_vendor" != *"$intel"* ]]; then
|
2021-11-25 01:40:57 +00:00
|
|
|
echo "ERROR: IDXD cannot be used due to CPU incompatibility."
|
2020-04-10 15:29:01 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-03-31 10:09:42 +00:00
|
|
|
if [ -e /usr/include/accel-config/libaccel_config.h ]; then
|
|
|
|
CONFIG[IDXD_KERNEL]=y
|
|
|
|
fi
|
|
|
|
|
2020-04-10 15:29:01 +00:00
|
|
|
fi
|
|
|
|
|
2018-10-03 14:58:36 +00:00
|
|
|
if [ -z "${CONFIG[ENV]}" ]; then
|
|
|
|
CONFIG[ENV]=$rootdir/lib/env_dpdk
|
|
|
|
echo "Using default SPDK env in ${CONFIG[ENV]}"
|
2021-06-15 16:42:29 +00:00
|
|
|
if [[ -z "${CONFIG[DPDK_DIR]}" && "${CONFIG[DPDK_PKG_CONFIG]}" == n ]]; then
|
2020-11-30 12:31:36 +00:00
|
|
|
if [ ! -f "$rootdir"/dpdk/config/meson.build ]; then
|
2017-06-02 00:51:29 +00:00
|
|
|
echo "DPDK not found; please specify --with-dpdk=<path> or run:"
|
|
|
|
echo
|
|
|
|
echo " git submodule update --init"
|
|
|
|
exit 1
|
2018-10-03 14:58:36 +00:00
|
|
|
else
|
|
|
|
CONFIG[DPDK_DIR]="${rootdir}/dpdk/build"
|
2022-01-19 05:42:56 +00:00
|
|
|
# Default ipsec libs
|
2022-08-31 11:41:04 +00:00
|
|
|
if [[ "${CONFIG[CRYPTO]}" = "y" ]] && [[ $arch = x86_64* ]]; then
|
2022-01-19 05:42:56 +00:00
|
|
|
CONFIG[IPSEC_MB]=y
|
|
|
|
CONFIG[IPSEC_MB_DIR]="${rootdir}/intel-ipsec-mb/lib"
|
|
|
|
fi
|
2018-10-03 14:58:36 +00:00
|
|
|
echo "Using default DPDK in ${CONFIG[DPDK_DIR]}"
|
2017-06-02 00:51:29 +00:00
|
|
|
fi
|
2017-03-30 19:06:49 +00:00
|
|
|
fi
|
2018-07-19 19:55:44 +00:00
|
|
|
else
|
2021-06-15 16:42:29 +00:00
|
|
|
if [[ -n "${CONFIG[DPDK_DIR]}" || "${CONFIG[DPDK_PKG_CONFIG]}" == y ]]; then
|
2019-02-08 21:37:23 +00:00
|
|
|
echo "--with-env and --with-dpdk are mutually exclusive."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-10-03 14:58:36 +00:00
|
|
|
if [ "${CONFIG[VHOST]}" = "y" ]; then
|
2018-07-19 19:55:44 +00:00
|
|
|
echo "Vhost is only supported when using the default DPDK environment. Disabling it."
|
|
|
|
fi
|
|
|
|
# Always disable vhost, but only print the error message if the user explicitly turned it on.
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VHOST]="n"
|
|
|
|
if [ "${CONFIG[VIRTIO]}" = "y" ]; then
|
2018-07-19 19:55:44 +00:00
|
|
|
echo "Virtio is only supported when using the default DPDK environment. Disabling it."
|
|
|
|
fi
|
|
|
|
# Always disable virtio, but only print the error message if the user explicitly turned it on.
|
2018-10-03 14:58:36 +00:00
|
|
|
CONFIG[VIRTIO]="n"
|
2017-03-30 19:06:49 +00:00
|
|
|
fi
|
|
|
|
|
2021-06-15 16:42:29 +00:00
|
|
|
if [[ "${CONFIG[DPDK_PKG_CONFIG]}" == y ]]; then
|
|
|
|
if [[ "${CONFIG[SHARED]}" == n ]]; then
|
|
|
|
# dpdk-devel doesn't provide static libs
|
|
|
|
echo "Build against packaged DPDK requested, enabling shared libraries"
|
|
|
|
CONFIG[SHARED]=y
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-03-03 09:48:43 +00:00
|
|
|
if [[ $sys_name == "Windows" ]]; then
|
|
|
|
if [ -z "${CONFIG[WPDK_DIR]}" ]; then
|
|
|
|
if [ ! -f "$rootdir"/wpdk/Makefile ]; then
|
|
|
|
echo "WPDK not found; please specify --with-wpdk=<path>. See https://wpdk.github.io."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
CONFIG[WPDK_DIR]="${rootdir}/wpdk/build"
|
|
|
|
echo "Using default WPDK in ${CONFIG[WPDK_DIR]}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ -n "${CONFIG[WPDK_DIR]}" ]; then
|
|
|
|
echo "ERROR: --with-wpdk is only supported for Windows"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-10-03 14:58:36 +00:00
|
|
|
if [ "${CONFIG[VTUNE]}" = "y" ]; then
|
2023-01-13 17:27:12 +00:00
|
|
|
echo "WARNING: VTune support is deprecated."
|
2018-10-03 14:58:36 +00:00
|
|
|
if [ -z "${CONFIG[VTUNE_DIR]}" ]; then
|
2017-05-30 08:45:46 +00:00
|
|
|
echo "When VTune is enabled, you must specify the VTune directory using --with-vtune=path"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-01-21 12:05:25 +00:00
|
|
|
if [[ "${CONFIG[ASAN]}" = "y" && "${CONFIG[TSAN]}" = "y" ]]; then
|
2017-05-24 22:00:54 +00:00
|
|
|
echo "ERROR: ASAN and TSAN cannot be enabled at the same time."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-06-15 18:35:16 +00:00
|
|
|
if [[ "${CONFIG[FIO_PLUGIN]}" = "y" && "${CONFIG[EXAMPLES]}" = "n" ]]; then
|
|
|
|
echo "ERROR: --with-fio and --disable-examples are mutually exclusive."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-03-11 08:38:46 +00:00
|
|
|
if [[ $sys_name == "FreeBSD" ]]; then
|
2017-07-13 18:01:45 +00:00
|
|
|
# FreeBSD doesn't support all configurations
|
2018-10-03 14:58:36 +00:00
|
|
|
if [[ "${CONFIG[COVERAGE]}" == "y" ]]; then
|
2017-07-13 18:01:45 +00:00
|
|
|
echo "ERROR: CONFIG_COVERAGE not available on FreeBSD"
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-06-14 00:01:22 +00:00
|
|
|
fi
|
|
|
|
|
2022-12-14 11:19:02 +00:00
|
|
|
if [[ $sys_name == "Linux" ]]; then
|
|
|
|
if pkg-config libbsd; then
|
|
|
|
CONFIG[HAVE_LIBBSD]=y
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-12-14 11:20:33 +00:00
|
|
|
if pkg-config libarchive; then
|
|
|
|
CONFIG[HAVE_LIBARCHIVE]=y
|
|
|
|
fi
|
|
|
|
|
2021-01-22 21:04:59 +00:00
|
|
|
if [[ $sys_name != "Linux" ]]; then
|
2019-07-04 19:51:04 +00:00
|
|
|
if [[ "${CONFIG[VHOST]}" == "y" ]]; then
|
2020-02-20 16:57:44 +00:00
|
|
|
echo "Vhost is only supported on Linux."
|
|
|
|
exit 1
|
2019-07-04 19:51:04 +00:00
|
|
|
fi
|
|
|
|
if [[ "${CONFIG[VIRTIO]}" == "y" ]]; then
|
2020-02-20 16:57:44 +00:00
|
|
|
echo "Virtio is only supported on Linux."
|
|
|
|
exit 1
|
2019-07-04 19:51:04 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-10-03 14:58:36 +00:00
|
|
|
if [ "${CONFIG[RDMA]}" = "y" ]; then
|
2021-01-21 11:54:00 +00:00
|
|
|
if [[ ! "${CONFIG[RDMA_PROV]}" == "verbs" ]] && [[ ! "${CONFIG[RDMA_PROV]}" == "mlx5_dv" ]]; then
|
|
|
|
echo "Invalid RDMA provider specified, must be \"verbs\" or \"mlx5_dv\""
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-03-14 12:08:29 +00:00
|
|
|
|
2019-05-07 16:30:45 +00:00
|
|
|
if ! echo -e '#include <infiniband/verbs.h>\n#include <rdma/rdma_verbs.h>\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -libverbs -lrdmacm - 2> /dev/null; then
|
|
|
|
echo "--with-rdma requires libverbs and librdmacm."
|
|
|
|
echo "Please install then re-run this script."
|
2019-05-07 16:30:45 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if echo -e '#include <infiniband/verbs.h>\n' \
|
|
|
|
'int main(void) { return !!IBV_WR_SEND_WITH_INV; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -c - 2> /dev/null; then
|
2019-05-07 17:12:15 +00:00
|
|
|
CONFIG[RDMA_SEND_WITH_INVAL]="y"
|
|
|
|
else
|
|
|
|
CONFIG[RDMA_SEND_WITH_INVAL]="n"
|
|
|
|
echo "
|
2018-08-15 20:09:49 +00:00
|
|
|
*******************************************************************************
|
|
|
|
WARNING: The Infiniband Verbs opcode Send With Invalidate is either not
|
|
|
|
supported or is not functional with the current version of libibverbs installed
|
|
|
|
on this system. Please upgrade to at least version 1.1.
|
|
|
|
|
|
|
|
Beginning with Linux kernel 4.14, the kernel NVMe-oF initiator leverages Send
|
|
|
|
With Invalidate RDMA operations to improve performance. Failing to use the
|
|
|
|
Send With Invalidate operation on the NVMe-oF target side results in full
|
|
|
|
functionality, but greatly reduced performance. The SPDK NVMe-oF target will
|
|
|
|
be unable to leverage that operation using the currently installed version
|
|
|
|
of libibverbs, so Linux kernel NVMe-oF initiators based on kernels greater
|
|
|
|
than or equal to 4.14 will see significantly reduced performance.
|
2018-08-22 16:31:54 +00:00
|
|
|
*******************************************************************************"
|
2018-08-15 20:09:49 +00:00
|
|
|
fi
|
2020-01-21 14:03:40 +00:00
|
|
|
|
|
|
|
if echo -e '#include <rdma/rdma_cma.h>\n' \
|
|
|
|
'int main(void) { return !!RDMA_OPTION_ID_ACK_TIMEOUT; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -c - 2> /dev/null; then
|
2020-01-21 14:03:40 +00:00
|
|
|
CONFIG[RDMA_SET_ACK_TIMEOUT]="y"
|
|
|
|
else
|
|
|
|
CONFIG[RDMA_SET_ACK_TIMEOUT]="n"
|
|
|
|
echo "RDMA_OPTION_ID_ACK_TIMEOUT is not supported"
|
|
|
|
fi
|
|
|
|
|
2022-12-13 20:56:06 +00:00
|
|
|
if echo -e '#include <rdma/rdma_cma.h>\n' \
|
|
|
|
'int main(void) { return !!RDMA_OPTION_ID_TOS; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" -c - 2> /dev/null; then
|
|
|
|
CONFIG[RDMA_SET_TOS]="y"
|
|
|
|
else
|
|
|
|
CONFIG[RDMA_SET_TOS]="n"
|
|
|
|
echo "RDMA_OPTION_ID_TOS is not supported"
|
|
|
|
fi
|
|
|
|
|
2020-03-14 12:08:29 +00:00
|
|
|
if [ "${CONFIG[RDMA_PROV]}" == "mlx5_dv" ]; then
|
2022-10-10 08:53:49 +00:00
|
|
|
MLX5_DV_BUILD_BUILD_CMD="
|
|
|
|
#include <infiniband/mlx5dv.h>\n
|
|
|
|
#include <rdma/rdma_cma.h>\n
|
|
|
|
int main(void) { return rdma_establish(NULL) ||\n
|
|
|
|
!!IBV_QP_INIT_ATTR_SEND_OPS_FLAGS || !!MLX5_OPCODE_RDMA_WRITE"
|
|
|
|
if [ "${CONFIG[CRYPTO]}" = "y" ]; then
|
|
|
|
MLX5_DV_BUILD_BUILD_CMD+="|| !!MLX5DV_CRYPTO_ENGINES_CAP_AES_XTS_SINGLE_BLOCK"
|
|
|
|
fi
|
|
|
|
MLX5_DV_BUILD_BUILD_CMD+=";}"
|
|
|
|
if ! echo -e $MLX5_DV_BUILD_BUILD_CMD | "${BUILD_CMD[@]}" -lmlx5 -I${rootdir}/include -c -; then
|
2021-01-21 11:54:00 +00:00
|
|
|
echo "mlx5_dv provider is not supported"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-03-14 12:08:29 +00:00
|
|
|
fi
|
|
|
|
|
2021-01-21 12:05:25 +00:00
|
|
|
echo "Using '${CONFIG[RDMA_PROV]}' RDMA provider"
|
2018-08-15 20:09:49 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-22 09:28:02 +00:00
|
|
|
if [[ "${CONFIG[FC]}" = "y" ]]; then
|
|
|
|
if [[ -n "${CONFIG[FC_PATH]}" ]]; then
|
2022-11-30 13:22:37 +00:00
|
|
|
check_dir "${CONFIG[FC_PATH]}"
|
2019-04-22 09:28:02 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-01-19 15:28:13 +00:00
|
|
|
function dpdk_version() {
|
|
|
|
# Check DPDK version to determine if mlx5_pci driver is supported
|
|
|
|
local dpdk_ver="none"
|
|
|
|
if [[ "${CONFIG[DPDK_DIR]}" == "$rootdir/dpdk/build" ]]; then
|
|
|
|
# DPDK_DIR points at our submodule so ./build may not exist yet. Use
|
|
|
|
# absolute path to lookup the version.
|
|
|
|
dpdk_ver=$(< "$rootdir/dpdk/VERSION")
|
|
|
|
elif [[ -f "${CONFIG[DPDK_DIR]}"/../VERSION ]]; then
|
|
|
|
dpdk_ver=$(< "${CONFIG[DPDK_DIR]}"/../VERSION)
|
|
|
|
fi
|
|
|
|
echo $dpdk_ver
|
|
|
|
}
|
|
|
|
|
|
|
|
function mlx5_build() {
|
|
|
|
# Check if libmlx5 exists to enable mlx5_pci compress/crypto PMD
|
|
|
|
if ! echo -e '#include <spdk/stdinc.h>\n' \
|
|
|
|
'#include <infiniband/mlx5dv.h>\n' \
|
|
|
|
'#include <infiniband/verbs.h>\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" -lmlx5 -libverbs -I${rootdir}/include -c - 2> /dev/null; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2022-10-28 23:07:51 +00:00
|
|
|
if [[ "${CONFIG[VBDEV_COMPRESS]}" = "y" ]]; then
|
2023-01-20 12:55:51 +00:00
|
|
|
echo "WARNING: PMDK - Persistent device support with bdev_compress is deprecated."
|
2019-05-07 13:33:48 +00:00
|
|
|
if ! echo -e '#include <libpmem.h>\nint main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -lpmem - 2> /dev/null; then
|
2022-10-28 23:07:51 +00:00
|
|
|
echo "--with-vbdev-compress requires libpmem."
|
2021-01-21 12:05:25 +00:00
|
|
|
echo "Please install then re-run this script."
|
2018-09-21 14:37:54 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-01-19 15:28:13 +00:00
|
|
|
# Try to enable mlx5 compress
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS_MLX5]="y"
|
2022-01-19 15:28:13 +00:00
|
|
|
|
2021-08-23 12:37:06 +00:00
|
|
|
# Check if libmlx5 exists to enable mlx5_pci compress PMD
|
2022-01-19 15:28:13 +00:00
|
|
|
if ! mlx5_build; then
|
2021-08-23 12:37:06 +00:00
|
|
|
echo "libmlx5 is not found, so disabling DPDK mlx5_pci compress PMD"
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS_MLX5]="n"
|
2022-01-19 15:28:13 +00:00
|
|
|
else
|
|
|
|
if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then
|
|
|
|
# Check if librte_compress_mlx5 exists in DPDK package
|
|
|
|
if [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then
|
|
|
|
echo "librte_compress_mlx5 is not found, so disabling DPDK mlx5_pci compress PMD"
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS_MLX5]="n"
|
2022-01-19 15:28:13 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
# Check DPDK version to determine if mlx5_pci driver is supported
|
|
|
|
dpdk_ver=$(dpdk_version)
|
|
|
|
if [[ $dpdk_ver = "none" ]]; then
|
|
|
|
echo "Cannot get DPDK version, so disabling DPDK mlx5_pci compress PMD"
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS_MLX5]="n"
|
2022-01-19 15:28:13 +00:00
|
|
|
elif [[ -n $dpdk_ver ]] && lt "$dpdk_ver" 21.02.0; then
|
|
|
|
# mlx5_pci for compress is supported by DPDK >- 21.02.0
|
|
|
|
echo "DPDK version ${dpdk_ver} doesn't support mlx5_pci compress PMD"
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS_MLX5]="n"
|
2022-01-19 15:28:13 +00:00
|
|
|
elif [[ -n ${CONFIG[DPDK_LIB_DIR]} ]] && [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then
|
|
|
|
# This is only checked when --with-dpdk or --with-dpdk=* is used
|
|
|
|
echo "librte_compress_mlx5 is not found, so disabling DPDK mlx5_pci compress PMD"
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS_MLX5]="n"
|
2022-01-19 15:28:13 +00:00
|
|
|
fi
|
|
|
|
fi
|
2021-08-23 12:37:06 +00:00
|
|
|
fi
|
2022-01-19 15:28:13 +00:00
|
|
|
fi
|
2021-08-23 12:37:06 +00:00
|
|
|
|
2022-01-19 15:28:13 +00:00
|
|
|
if [[ "${CONFIG[CRYPTO]}" = "y" ]]; then
|
|
|
|
# Try to enable mlx5 crypto
|
|
|
|
CONFIG[CRYPTO_MLX5]="y"
|
|
|
|
|
|
|
|
# Check if libmlx5 exists to enable mlx5_pci compress PMD
|
|
|
|
if ! mlx5_build; then
|
|
|
|
echo "libmlx5 is not found, so disabling DPDK mlx5_pci crypto PMD"
|
|
|
|
CONFIG[CRYPTO_MLX5]="n"
|
2021-08-23 12:37:06 +00:00
|
|
|
else
|
2022-01-19 15:28:13 +00:00
|
|
|
if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then
|
|
|
|
# Check if librte_crypto_mlx5 exists in DPDK package
|
|
|
|
if [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_crypto_mlx5.so ]; then
|
|
|
|
echo "librte_crypto_mlx5 is not found, so disabling DPDK mlx5_pci crypto PMD"
|
|
|
|
CONFIG[CRYPTO_MLX5]="n"
|
|
|
|
fi
|
2021-08-23 12:37:06 +00:00
|
|
|
else
|
2022-01-19 15:28:13 +00:00
|
|
|
# Check DPDK version to determine if mlx5_pci driver is supported
|
|
|
|
dpdk_ver=$(dpdk_version)
|
|
|
|
if [[ $dpdk_ver = "none" ]]; then
|
|
|
|
echo "Cannot get DPDK version, so disabling DPDK mlx5_pci crypto PMD"
|
|
|
|
CONFIG[CRYPTO_MLX5]="n"
|
2022-04-04 09:37:47 +00:00
|
|
|
elif [[ -n $dpdk_ver ]] && lt "$dpdk_ver" 21.11.0; then
|
|
|
|
# mlx5_pci for crypto is supported by DPDK >- 21.11.0
|
2022-01-19 15:28:13 +00:00
|
|
|
echo "DPDK version ${dpdk_ver} doesn't support mlx5_pci crypto PMD"
|
|
|
|
CONFIG[CRYPTO_MLX5]="n"
|
|
|
|
elif [[ -n ${CONFIG[DPDK_LIB_DIR]} ]] && [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_crypto_mlx5.so ]; then
|
|
|
|
# This is only checked when --with-dpdk or --with-dpdk=* is used
|
|
|
|
echo "librte_crypto_mlx5 is not found, so disabling DPDK mlx5_pci crypto PMD"
|
|
|
|
CONFIG[CRYPTO_MLX5]="n"
|
|
|
|
fi
|
2021-08-23 12:37:06 +00:00
|
|
|
fi
|
2021-06-15 13:25:07 +00:00
|
|
|
fi
|
2018-09-21 14:37:54 +00:00
|
|
|
fi
|
|
|
|
|
2019-10-24 18:04:33 +00:00
|
|
|
if [[ "${CONFIG[NVME_CUSE]}" = "y" ]]; then
|
|
|
|
if ! echo -e '#define FUSE_USE_VERSION 31\n#include <fuse3/cuse_lowlevel.h>\n#include <fuse3/fuse_lowlevel.h>\n#include <fuse3/fuse_opt.h>\nint main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -lfuse3 -D_FILE_OFFSET_BITS=64 - 2> /dev/null; then
|
|
|
|
echo "--with-cuse requires libfuse3."
|
|
|
|
echo "Please install then re-run this script."
|
2019-10-24 18:04:33 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-05-07 16:42:28 +00:00
|
|
|
if [[ "${CONFIG[RBD]}" = "y" ]]; then
|
|
|
|
if ! echo -e '#include <rbd/librbd.h>\n#include <rados/librados.h>\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -lrados -lrbd - 2> /dev/null; then
|
|
|
|
echo "--with-rbd requires librados and librbd."
|
|
|
|
echo "Please install then re-run this script."
|
2019-05-07 16:42:28 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-11-29 05:56:56 +00:00
|
|
|
if [[ "${CONFIG[UBLK]}" = "y" ]]; then
|
|
|
|
if ! echo -e '#include <linux/ublk_cmd.h>\n#include <liburing.h>\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" -luring - 2> /dev/null; then
|
|
|
|
echo "--with-ublk requires liburing and ublk_drv."
|
|
|
|
echo "Please install then re-run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-05-07 16:55:00 +00:00
|
|
|
if [[ "${CONFIG[ISCSI_INITIATOR]}" = "y" ]]; then
|
|
|
|
# Fedora installs libiscsi to /usr/lib64/iscsi for some reason.
|
|
|
|
if ! echo -e '#include <iscsi/iscsi.h>\n#include <iscsi/scsi-lowlevel.h>\n' \
|
|
|
|
'#if LIBISCSI_API_VERSION < 20150621\n' \
|
|
|
|
'#error\n' \
|
|
|
|
'#endif\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -L/usr/lib64/iscsi -liscsi - 2> /dev/null; then
|
|
|
|
echo "--with-iscsi-initiator requires libiscsi with"
|
|
|
|
echo "LIBISCSI_API_VERSION >= 20150621."
|
|
|
|
echo "Please install then re-run this script."
|
2019-05-07 16:55:00 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-03-08 23:55:01 +00:00
|
|
|
if [[ "${CONFIG[DAOS]}" = "y" ]]; then
|
2022-09-15 10:55:46 +00:00
|
|
|
daos_build_cmd=("${BUILD_CMD[@]}")
|
|
|
|
if [[ -n "${CONFIG[DAOS_DIR]}" ]]; then
|
|
|
|
daos_build_cmd+=(-I"${CONFIG[DAOS_DIR]}"/include -L"${CONFIG[DAOS_DIR]}"/lib64)
|
|
|
|
fi
|
2022-03-08 23:55:01 +00:00
|
|
|
if ! echo -e '#include <daos.h>\n#include <daos_fs.h>\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
2022-09-15 10:55:46 +00:00
|
|
|
| "${daos_build_cmd[@]}" -lgurt -ldaos -ldaos_common -ldfs - 2> /dev/null; then
|
2022-03-08 23:55:01 +00:00
|
|
|
echo "--with-daos requires libdaos, libdaos_common, libdfs and libgurt"
|
|
|
|
echo "Please install then re-run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-05-08 15:48:59 +00:00
|
|
|
if [[ "${CONFIG[ASAN]}" = "y" ]]; then
|
|
|
|
if ! echo -e 'int main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -fsanitize=address - 2> /dev/null; then
|
|
|
|
echo "--enable-asan requires libasan."
|
|
|
|
echo "Please install then re-run this script."
|
2019-05-08 15:48:59 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${CONFIG[UBSAN]}" = "y" ]]; then
|
|
|
|
if ! echo -e 'int main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -fsanitize=undefined - 2> /dev/null; then
|
|
|
|
echo "--enable-ubsan requires libubsan."
|
|
|
|
echo "Please install then re-run this script."
|
|
|
|
echo "If installed, please check that the GCC version is at least 6.4"
|
|
|
|
echo "and synchronize CC accordingly."
|
2019-05-08 15:48:59 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${CONFIG[TSAN]}" = "y" ]]; then
|
|
|
|
if ! echo -e 'int main(void) { return 0; }\n' \
|
2021-01-21 12:05:25 +00:00
|
|
|
| "${BUILD_CMD[@]}" -fsanitize=thread - 2> /dev/null; then
|
|
|
|
echo "--enable-tsan requires libtsan."
|
|
|
|
echo "Please install then re-run this script."
|
2019-05-08 15:48:59 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-08-12 05:00:25 +00:00
|
|
|
if echo -e '#include <stdlib.h>\nint main(void) { arc4random(); return 0; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" - 2> /dev/null; then
|
|
|
|
CONFIG[HAVE_ARC4RANDOM]="y"
|
|
|
|
fi
|
|
|
|
|
2023-01-23 13:48:08 +00:00
|
|
|
if echo -e '#include <uuid/uuid.h>\nint main(void) { uuid_generate_sha1(NULL, NULL, NULL, 0); return 0; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" - -luuid 2> /dev/null; then
|
|
|
|
CONFIG[HAVE_UUID_GENERATE_SHA1]="y"
|
|
|
|
fi
|
|
|
|
|
2018-09-20 16:54:49 +00:00
|
|
|
if [[ "${CONFIG[OCF]}" = "y" ]]; then
|
|
|
|
# If OCF_PATH is a file, assume it is a library and use it to compile with
|
|
|
|
if [ -f ${CONFIG[OCF_PATH]} ]; then
|
|
|
|
CONFIG[CUSTOMOCF]=y
|
|
|
|
else
|
|
|
|
CONFIG[CUSTOMOCF]=n
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-02-11 18:19:32 +00:00
|
|
|
if [[ "${CONFIG[PGO_CAPTURE]}" = "y" && "${CONFIG[PGO_USE]}" = "y" ]]; then
|
|
|
|
echo "ERROR: --enable-pgo-capture and --enable-pgo-use are mutually exclusive."
|
|
|
|
exit 1
|
2019-02-12 19:45:01 +00:00
|
|
|
elif [[ "${CONFIG[PGO_USE]}" = "y" ]]; then
|
|
|
|
if [[ "$CC_TYPE" = "clang" ]]; then
|
|
|
|
# For clang we need to run an extra step on gathered profiling data.
|
|
|
|
echo "Generating suitable profile data"
|
|
|
|
llvm-profdata merge -output=build/pgo/default.profdata build/pgo
|
|
|
|
fi
|
2019-02-11 18:19:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-09-24 13:35:48 +00:00
|
|
|
if [[ "${CONFIG[URING]}" = "y" || "${CONFIG[XNVME]}" = "y" ]]; then
|
2019-02-14 19:07:42 +00:00
|
|
|
if [[ -n "${CONFIG[URING_PATH]}" ]]; then
|
2022-11-30 13:22:37 +00:00
|
|
|
check_dir "${CONFIG[URING_PATH]}"
|
2021-04-21 23:30:45 +00:00
|
|
|
elif ! echo -e '#include <liburing.h>\nint main(void) { return 0; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" -luring - 2> /dev/null; then
|
|
|
|
echo "--with-uring requires liburing."
|
|
|
|
echo "Please build and install then re-run this script."
|
|
|
|
exit 1
|
2019-02-14 19:07:42 +00:00
|
|
|
fi
|
2022-09-21 05:49:45 +00:00
|
|
|
# Support for Zoned devices is enabled by default for Uring bdev. Check appropriate support in kernel.
|
|
|
|
if [[ "${CONFIG[URING_ZNS]}" = "y" ]]; then
|
|
|
|
if ! echo -e '#include<linux/blkzoned.h>\nint main(void) { return BLK_ZONE_REP_CAPACITY; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" -c - 2> /dev/null; then
|
|
|
|
echo "Disabling Zoned NS support in Uring! Requires blkzoned.h from kernel >= linux-5.9."
|
|
|
|
CONFIG[URING_ZNS]=n
|
|
|
|
fi
|
2022-07-02 14:53:02 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-10-08 12:28:49 +00:00
|
|
|
if [[ "${CONFIG[FUSE]}" = "y" ]]; then
|
|
|
|
if [[ ! -d /usr/include/fuse3 ]] && [[ ! -d /usr/local/include/fuse3 ]]; then
|
|
|
|
echo "--with-fuse requires libfuse3."
|
|
|
|
echo "Please install then re-run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-01-14 11:06:33 +00:00
|
|
|
if [ "${CONFIG[CET]}" = "y" ]; then
|
2021-01-21 12:05:25 +00:00
|
|
|
if ! echo -e 'int main(void) { return 0; }\n' | "${BUILD_CMD[@]}" -fcf-protection - 2> /dev/null; then
|
|
|
|
echo "--enable-cet requires compiler/linker that supports CET."
|
|
|
|
echo "Please install then re-run this script."
|
2021-01-14 11:06:33 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
test/nvmf: fuzz nvmf target using LLVM's libFuzzer
LLVM provides libFuzzer which does coverage-guided
fuzzing of a library or application under test. For
SPDK, we can use this as a new and better way to
generate random commands to the SPDK nvmf target.
By default, libFuzzer provides the main() and your
source file just provides the function called by
LLVM for each iteration of random data. But this
doesn't really work for SPDK since we need to start
the app framework and the nvmf target. So we
specify -fsanitizer=fuzzer-no-link, explicitly
specify the location of the fuzzer_no_main library
and then call LLVMFuzzerRunDriver to start the
fuzzing process once we are ready.
Since this is all coverage-guided, we invoke the
fuzzer inside the nvmf target application. So this
patch creates a new target application called
'llvm_nvme_fuzz'. One core is needed to run the
nvmf target, then we spawn a pthread to run the
fuzzer against it.
Currently there are two fuzzers defined. Fuzzer 0
does random testing of admin commands. Fuzzer 1
is focused solely on GET_LOG_PAGE and fuzzes a
smaller subset of the bytes in the spdk_nvme_cmd.
Additional fuzzers can be added in the future for
other commands, testing I/O queues, data payloads,
etc.
You do need to specify CC and CXX when running
configure, as well as specify the location of the
special clang_rt.fuzz_no_main library. The path of
that library is dependent on your clang version and
architecture. If using clang-12 on x86_64 platform,
it will look like:
CC=clang-12 CXX=clang++-12 ./configure --with-fuzzer= \
/usr/lib/llvm-12/lib/clang/12.0.0/lib/linux/libclang_rt.fuzzer_no_main-x86_64.a
Then just do the following to demonstrate the fuzzer
tool.
make
test/nvmf/target/llvm_nvme_fuzz.sh --time=60 --fuzzer=0
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iee0997501893ac284a3947a1db7a155c5ceb7849
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10038
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-15 21:54:52 +00:00
|
|
|
if [[ "${CONFIG[FUZZER]}" = "y" && "$CC_TYPE" != "clang" ]]; then
|
|
|
|
echo "--with-fuzzer requires setting CC and CXX to clang."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-09-06 17:48:39 +00:00
|
|
|
if [[ $arch == x86_64* ]] || [[ $arch == aarch64* ]]; then
|
|
|
|
CONFIG[ISAL]=y
|
|
|
|
# make sure the submodule is initialized
|
2021-04-21 21:52:53 +00:00
|
|
|
if [ ! -f "$rootdir"/isa-l/autogen.sh ]; then
|
2022-09-06 17:48:39 +00:00
|
|
|
echo "ISA-L is required but was not found, please init the submodule with:"
|
2021-04-21 21:52:53 +00:00
|
|
|
echo " git submodule update --init"
|
2022-09-06 17:48:39 +00:00
|
|
|
echo "and then re-run this script."
|
2021-04-21 21:52:53 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-06 17:48:39 +00:00
|
|
|
# for x86 only, check the nasm version for ISA-L and IPSEC
|
|
|
|
if [[ $arch == x86_64* ]]; then
|
|
|
|
ver=$(nasm -v 2> /dev/null | awk '{print $3}' | awk -Fr '{print $1}')
|
|
|
|
if lt "$ver" 2.14; then
|
|
|
|
CONFIG[ISAL]=n
|
|
|
|
# IPSEC has nasm requirement and DPDK crypto relies on IPSEC
|
|
|
|
CONFIG[IPSEC_MB]=n
|
|
|
|
echo "WARNING: ISA-L & DPDK crypto cannot be used as nasm ver must be 2.14 or newer."
|
|
|
|
fi
|
|
|
|
fi
|
2022-10-04 19:14:10 +00:00
|
|
|
# check gas version on aarch64
|
|
|
|
if [[ $arch == aarch64* ]]; then
|
|
|
|
ver=$(as --version 2> /dev/null | awk 'NR==1{print $7}')
|
|
|
|
if lt "$ver" 2.24; then
|
|
|
|
# ISA-L, compression & crypto require gas version 2.24 or newer.
|
|
|
|
CONFIG[ISAL]=n
|
|
|
|
echo "Notice: ISA-L, compression & crypto require GAS version 2.24 or newer. Turning off default ISA-L and crypto features."
|
|
|
|
elif lt "$ver" 2.34; then
|
|
|
|
#For gas v2.24~v2.34, sve2 instructions are not supported. To workaround it, sve2 optimization should be disabled
|
|
|
|
ISAL_CRYPTO_OPTS+=("--disable-sve2")
|
|
|
|
fi
|
|
|
|
fi
|
2022-09-06 17:48:39 +00:00
|
|
|
else
|
|
|
|
# for PPC
|
|
|
|
CONFIG[ISAL]=n
|
|
|
|
echo "WARNING: ISA-L cannot be used due to architecture incompatibility."
|
|
|
|
fi
|
2021-04-21 21:52:53 +00:00
|
|
|
|
2022-09-06 17:48:39 +00:00
|
|
|
# now either configure ISA-L or disable unavailable features
|
|
|
|
if [[ "${CONFIG[ISAL]}" = "y" ]]; then
|
2021-04-21 21:52:53 +00:00
|
|
|
cd $rootdir/isa-l
|
|
|
|
ISAL_LOG=$rootdir/isa-l/spdk-isal.log
|
|
|
|
if [[ -n "${CONFIG[CROSS_PREFIX]}" ]]; then
|
|
|
|
ISAL_OPTS=("--host=${CONFIG[CROSS_PREFIX]}")
|
|
|
|
else
|
|
|
|
ISAL_OPTS=()
|
|
|
|
fi
|
|
|
|
echo -n "Configuring ISA-L (logfile: $ISAL_LOG)..."
|
|
|
|
./autogen.sh &> $ISAL_LOG
|
|
|
|
./configure CFLAGS="-fPIC -g -O2" "${ISAL_OPTS[@]}" --enable-shared=no >> $ISAL_LOG 2>&1
|
|
|
|
echo "done."
|
|
|
|
cd $rootdir
|
2022-09-06 17:48:39 +00:00
|
|
|
else
|
|
|
|
echo "Without ISA-L, there is no software support for crypto or compression,"
|
|
|
|
echo "so these features will be disabled."
|
|
|
|
CONFIG[CRYPTO]=n
|
2022-10-28 23:07:51 +00:00
|
|
|
CONFIG[VBDEV_COMPRESS]=n
|
2022-10-28 21:56:55 +00:00
|
|
|
CONFIG[DPDK_COMPRESSDEV]=n
|
2021-04-21 21:52:53 +00:00
|
|
|
fi
|
|
|
|
|
2022-10-04 19:14:10 +00:00
|
|
|
# ISA-L-crypto complements ISA-L functionality, it is only enabled together with ISA-L
|
|
|
|
if [[ "${CONFIG[ISAL]}" = "y" ]]; then
|
|
|
|
if [ ! -f "$rootdir"/isa-l-crypto/autogen.sh ]; then
|
|
|
|
echo "ISA-L-crypto is required but was not found, please init the submodule with:"
|
|
|
|
echo " git submodule update --init"
|
|
|
|
echo "and then re-run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $rootdir/isa-l-crypto
|
|
|
|
ISAL_CRYPTO_LOG=$rootdir/isa-l-crypto/spdk-isal-crypto.log
|
|
|
|
if [[ -n "${CONFIG[CROSS_PREFIX]}" ]]; then
|
|
|
|
ISAL_CRYPTO_OPTS+=("--host=${CONFIG[CROSS_PREFIX]}")
|
|
|
|
fi
|
|
|
|
ISAL_CRYPTO_OPTS+=("--enable-shared=no")
|
|
|
|
echo -n "Configuring ISA-L-crypto (logfile: $ISAL_CRYPTO_LOG)..."
|
|
|
|
./autogen.sh &> $ISAL_CRYPTO_LOG
|
|
|
|
./configure CFLAGS="-fPIC -g -O2" "${ISAL_CRYPTO_OPTS[@]}" >> $ISAL_CRYPTO_LOG 2>&1
|
|
|
|
echo "done."
|
|
|
|
cd $rootdir
|
|
|
|
CONFIG[ISAL_CRYPTO]=y
|
|
|
|
else
|
|
|
|
CONFIG[ISAL_CRYPTO]=n
|
|
|
|
fi
|
|
|
|
|
2022-01-05 09:14:39 +00:00
|
|
|
if [[ "${CONFIG[SMA]}" = "y" ]]; then
|
|
|
|
if ! python3 -c 'import grpc; import grpc_tools' 2> /dev/null; then
|
|
|
|
echo "--with-sma requires grpcio and grpcio-tools python packages."
|
|
|
|
echo "Please install then re-run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach:
Avahi Daemon needs to be running to provide the mDNS server service. In the SPDK, Avahi-client library based client API is implemented.
The client API will connect to the Avahi-daemon and receive events for new discovery and removal of an existing discovery entry.
Following sets on new RPCs have been introduced.
scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
User shall initiate an mDNS based discovery using this RPC. This will start a Avahi-client based poller
looking for new discovery events from the Avahi server. On a new discovery of the discovery controller,
the existing bdev_nvme_start_discovery API will be invoked with the trid of the discovery controller learnt.
This will enable automatic connection of the initiator to the subsystems discovered from the discovery controller.
Multiple mdns discovery instances can be run by specifying a unique bdev-prefix and a unique servicename to discover as parameters.
scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
This will stop the Avahi poller that was started for the specified service.Internally bdev_nvme_stop_discovery
API will be invoked for each of the discovery controllers learnt automatically by this instance of mdns discovery service.
This will result in termination of connections to all the subsystems learnt by this mdns discovery instance.
scripts/rpc.py bdev_nvme_get_mdns_discovery_info
This RPC will display the list of mdns discovery instances running and the trid of the controllers discovered by these instances.
Test Result:
root@ubuntu-pm-18-226:~/param-spdk/spdk/build/bin# ./nvmf_tgt -i 1 -s 2048 -m 0xF
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[
{
"name": "cdc_auto",
"svcname": "_nvme-disc._tcp",
"referrals": [
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
}
}
]
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[
{
"name": "cdc_auto0",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
},
{
"name": "cdc_auto1",
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.21",
"trsvcid": "8009",
"subnqn": "nqn.2014-08.org.nvmexpress.discovery"
},
"referrals": []
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[
{
"name": "cdc_auto02n1",
"aliases": [
"600110d6-1681-1681-0403-000045805c45"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-1681-1681-0403-000045805c45",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T0",
"serial_number": "00-681681dc681681dc",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto00n1",
"aliases": [
"600110da-09a6-09a6-0302-00005eeb19b4"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 2048,
"uuid": "600110da-09a6-09a6-0302-00005eeb19b4",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.2.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0"
},
"ctrlr_data": {
"cntlid": 1,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P2T0",
"serial_number": "00-ab09a6f5ab09a6f5",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n1",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8c"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8c",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 1,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
},
{
"name": "cdc_auto01n2",
"aliases": [
"600110d6-dce8-dce8-0403-00010b2d3d8d"
],
"product_name": "NVMe disk",
"block_size": 512,
"num_blocks": 32768,
"uuid": "600110d6-dce8-dce8-0403-00010b2d3d8d",
"assigned_rate_limits": {
"rw_ios_per_sec": 0,
"rw_mbytes_per_sec": 0,
"r_mbytes_per_sec": 0,
"w_mbytes_per_sec": 0
},
"claimed": false,
"zoned": false,
"supported_io_types": {
"read": true,
"write": true,
"unmap": true,
"write_zeroes": true,
"flush": true,
"reset": true,
"compare": true,
"compare_and_write": true,
"abort": true,
"nvme_admin": true,
"nvme_io": true
},
"driver_specific": {
"nvme": [
{
"trid": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "66.1.1.40",
"trsvcid": "4420",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
},
"ctrlr_data": {
"cntlid": 3,
"vendor_id": "0x0000",
"model_number": "SANBlaze VLUN P3T1",
"serial_number": "01-6ddce86d6ddce86d",
"firmware_revision": "V10.5",
"subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
"oacs": {
"security": 0,
"format": 1,
"firmware": 0,
"ns_manage": 1
},
"multi_ctrlr": true,
"ana_reporting": true
},
"vs": {
"nvme_version": "2.0"
},
"ns_data": {
"id": 2,
"ana_state": "optimized",
"can_share": true
}
}
],
"mp_policy": "active_passive"
}
}
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com>
Change-Id: Ic2c2e614e2549a655c7f81ae844b80d8505a4f02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15703
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-30 20:11:23 +00:00
|
|
|
if [[ "${CONFIG[AVAHI]}" = "y" ]]; then
|
|
|
|
if ! echo -e '#include <avahi-client/client.h>\n#include <avahi-common/malloc.h>\n' \
|
|
|
|
'int main(void) { return 0; }\n' \
|
|
|
|
| "${BUILD_CMD[@]}" -lavahi-client -lavahi-common - 2> /dev/null; then
|
|
|
|
echo "--with-avahi requires libavahi-client and libavahi-common."
|
|
|
|
echo "Please install then re-run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2023-03-31 14:55:52 +00:00
|
|
|
if [[ -n ${CONFIG[MAX_LCORES]} ]]; then
|
2023-04-12 13:01:41 +00:00
|
|
|
if [[ ! ${CONFIG[MAX_LCORES]} =~ ^([1-9][0-9]*|detect)$ ]] || ((CONFIG[MAX_LCORES] > 1024)); then
|
|
|
|
echo "ERROR: Max number of lcores must be a decimal number in range [1..1024] or 'detect' (given: ${CONFIG[MAX_LCORES]})"
|
2023-03-31 14:55:52 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
configure: add gcc version check for ARM Neoverse-N1 platform
When doing debug build on ARM Neoverse-N1 platform, if gcc version is
lower than 8.4.0, we may met following errors:
/tmp/cc24qua1.s: Assembler messages:
/tmp/cc24qua1.s:53: Error: selected processor does not support `casp x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:85: Error: selected processor does not support `caspa x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:117: Error: selected processor does not support `caspl x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:149: Error: selected processor does not support `caspal x0,x1,x2,x3,[x4]'
The change also fix the problem by pass armv8.2-a+crypto as target architecture.
Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I2053b9440e06873066480d63e471802df2e69d4e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7949
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-18 07:32:56 +00:00
|
|
|
# For ARM Neoverse-N1 platform, debug build needs gcc version newer than 8.4
|
|
|
|
if [[ "${CONFIG[DEBUG]}" = "y" && $arch = aarch64* && "$CC_TYPE" = "gcc" ]]; then
|
|
|
|
GCC_VERSION=$($CC -dumpfullversion)
|
|
|
|
PART_NUM=$(grep -i -m 1 "CPU part" /proc/cpuinfo | awk '{print $4}')
|
|
|
|
|
|
|
|
if [[ "$(printf '%s\n' "8.4.0" "$GCC_VERSION" | sort -V | head -n1)" != "8.4.0" ]]; then
|
|
|
|
if [[ $PART_NUM = 0xd0c ]]; then
|
|
|
|
echo "WARNING: For ARM Neoverse-N1 platform, debug build needs GCC version newer than 8.4."
|
|
|
|
echo " Will work around this by using armv8.2-a+crypto as target architecture for now."
|
|
|
|
CONFIG[ARCH]=armv8.2-a+crypto
|
configure: add gcc version check for ARM octeontx2 platform
When doing debug build on ARM octeontx2 platform, if gcc version is
lower than 8.4.0, we may met following errors:
/tmp/cc0XoOUM.s: Assembler messages:
/tmp/cc0XoOUM.s:56: Error: selected processor does not support `casp
x0,x1,x2,x3,[x4]'
/tmp/cc0XoOUM.s:88: Error: selected processor does not support `caspa
x0,x1,x2,x3,[x4]'
/tmp/cc0XoOUM.s:120: Error: selected processor does not support `caspl
x0,x1,x2,x3,[x4]'
/tmp/cc0XoOUM.s:152: Error: selected processor does not support `caspal
x0,x1,x2,x3,[x4]'
This change is based on existing solution available for ARM Neoverse-N1
platform
Reference commit id - fcc3894
Signed-off-by: Sunil Shahu <sunil.shahu@dell.com>
Change-Id: I01fab06fc40a82416e6a650c64cc25a1cd2a5dc0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15592
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-22 14:42:17 +00:00
|
|
|
elif [[ $PART_NUM = 0x0b2 ]]; then
|
|
|
|
echo "WARNING: For ARM octeontx2 platform, debug build needs GCC version newer than 8.4."
|
|
|
|
echo " Will work around this by using armv8.2-a+crypto as target architecture for now."
|
|
|
|
CONFIG[ARCH]=armv8.2-a+crypto
|
configure: add gcc version check for ARM Neoverse-N1 platform
When doing debug build on ARM Neoverse-N1 platform, if gcc version is
lower than 8.4.0, we may met following errors:
/tmp/cc24qua1.s: Assembler messages:
/tmp/cc24qua1.s:53: Error: selected processor does not support `casp x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:85: Error: selected processor does not support `caspa x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:117: Error: selected processor does not support `caspl x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:149: Error: selected processor does not support `caspal x0,x1,x2,x3,[x4]'
The change also fix the problem by pass armv8.2-a+crypto as target architecture.
Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I2053b9440e06873066480d63e471802df2e69d4e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7949
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-18 07:32:56 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-10-03 17:58:52 +00:00
|
|
|
# We are now ready to generate final configuration. But first do sanity
|
|
|
|
# check to see if all keys in CONFIG array have its reflection in CONFIG file.
|
2021-01-21 12:05:25 +00:00
|
|
|
if (($(grep -cE "^\s*CONFIG_[[:alnum:]_]+=" "$rootdir/CONFIG") != ${#CONFIG[@]})); then
|
2018-10-03 17:58:52 +00:00
|
|
|
echo ""
|
|
|
|
echo "BUG: Some configuration options are not present in CONFIG file. Please update this file."
|
|
|
|
echo "Missing options in CONFIG (+) file and in current config (-): "
|
|
|
|
diff -u --label "CONFIG file" --label "CONFIG[@]" \
|
2021-05-20 21:16:24 +00:00
|
|
|
<(sed -r -e '/^[[:space:]]*$/d; /^[[:space:]]*#.*/d; s/(CONFIG_[[:alnum:]_]+)=.*/\1/g' CONFIG | sort) \
|
2021-01-21 12:05:25 +00:00
|
|
|
<(printf "CONFIG_%s\n" "${!CONFIG[@]}" | sort)
|
2018-10-03 17:58:52 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-09-21 14:32:36 +00:00
|
|
|
echo -n "Creating mk/config.mk..."
|
2019-08-26 23:02:30 +00:00
|
|
|
cp -f $rootdir/CONFIG $rootdir/mk/config.mk
|
2022-11-03 07:28:06 +00:00
|
|
|
ARGS=$(echo "$@" | sed 's/ /\\ /g')
|
|
|
|
sed -i.bak -r "s#__CONFIGURE_OPTIONS__#${ARGS}#g" $rootdir/mk/config.mk
|
2021-01-21 12:05:25 +00:00
|
|
|
for key in "${!CONFIG[@]}"; do
|
2021-05-20 21:16:24 +00:00
|
|
|
sed -i.bak -r "s#[[:space:]]*CONFIG_${key}=.*#CONFIG_${key}\?=${CONFIG[$key]}#g" $rootdir/mk/config.mk
|
2018-10-03 14:58:36 +00:00
|
|
|
done
|
|
|
|
# On FreeBSD sed -i 'SUFFIX' - SUFFIX is mandatory. So no way but to delete the backed file.
|
2019-08-26 23:02:30 +00:00
|
|
|
rm -f $rootdir/mk/config.mk.bak
|
2019-05-09 06:57:32 +00:00
|
|
|
echo "done."
|
2017-03-30 19:06:49 +00:00
|
|
|
|
2018-03-28 18:24:48 +00:00
|
|
|
# Environment variables
|
2019-05-09 06:57:32 +00:00
|
|
|
echo -n "Creating mk/cc.flags.mk..."
|
2019-08-26 23:02:30 +00:00
|
|
|
rm -f $rootdir/mk/cc.flags.mk
|
|
|
|
[ -n "$CFLAGS" ] && echo "CFLAGS?=$CFLAGS" > $rootdir/mk/cc.flags.mk
|
|
|
|
[ -n "$CXXFLAGS" ] && echo "CXXFLAGS?=$CXXFLAGS" >> $rootdir/mk/cc.flags.mk
|
|
|
|
[ -n "$LDFLAGS" ] && echo "LDFLAGS?=$LDFLAGS" >> $rootdir/mk/cc.flags.mk
|
|
|
|
[ -n "$DESTDIR" ] && echo "DESTDIR?=$DESTDIR" >> $rootdir/mk/cc.flags.mk
|
2017-04-03 21:01:12 +00:00
|
|
|
echo "done."
|
2018-09-21 14:32:36 +00:00
|
|
|
|
2020-03-02 19:38:44 +00:00
|
|
|
# Create .sh with build config for easy sourcing|lookup during the tests.
|
|
|
|
for conf in "${!CONFIG[@]}"; do
|
|
|
|
echo "CONFIG_$conf=${CONFIG[$conf]}"
|
2021-01-21 11:54:00 +00:00
|
|
|
done > "$rootdir/test/common/build_config.sh"
|
2020-03-02 19:38:44 +00:00
|
|
|
|
2020-03-11 08:38:46 +00:00
|
|
|
if [[ $sys_name == "FreeBSD" ]]; then
|
2017-07-13 18:01:45 +00:00
|
|
|
echo "Type 'gmake' to build."
|
2017-05-28 19:35:46 +00:00
|
|
|
else
|
2017-07-13 18:01:45 +00:00
|
|
|
echo "Type 'make' to build."
|
2017-05-28 19:35:46 +00:00
|
|
|
fi
|
2017-03-30 19:06:49 +00:00
|
|
|
|
|
|
|
exit 0
|