unit/lib/init: Use short int for the %d directivescan-build under fedora40 reports the following:subsystem_ut.c:69:76: error: ‘%d’ directive output may be truncatedwriting between 1 and 10 bytes
unit/lib/init: Use short int for the %d directivescan-build under fedora40 reports the following:subsystem_ut.c:69:76: error: ‘%d’ directive output may be truncatedwriting between 1 and 10 bytes into a region of size 7[-Werror=format-truncation=]The subsystem_name at minimum requires 10 bytes and there's a spacefor 6 more. However, %d under int may output up to 10 bytes.Changing it to short int drops the max output to 5 bytes which fitsinto the existing buffer nicely.Change-Id: I501e3f13dc6f1e53f00b0ca6460af5b475b8c8cdSigned-off-by: Michal Berger <michal.berger@intel.com>Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24647Reviewed-by: Karol Latecki <karol.latecki@intel.com>Community-CI: Mellanox Build BotTested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Jim Harris <jim.harris@samsung.com>Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
show more ...
test/unit: use spdk_ut_run_tests()Replaced direct calls to the CUnit's functions to run the tests withspdk_ut_run_tests(). That way, each test will have the ability to runa specific test case.
test/unit: use spdk_ut_run_tests()Replaced direct calls to the CUnit's functions to run the tests withspdk_ut_run_tests(). That way, each test will have the ability to runa specific test case.The blob.c unit test wasn't changed, because it runs all tests multipletimes with different parameter combinations, so it cannot be easilyconverted. In the future, each such combination could be split into aseparate test suite, which would make it compatible withspdk_ut_run_tests().Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>Change-Id: I4463f808f89844e9bf32b5b31eda197c5d729d1dReviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19288Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>Community-CI: Mellanox Build BotReviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
test/unit: move spdk_cunit.h to include/spdk_internalIt'll make it easier to include this file outside of unit tests.Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>Change-Id: I171ddb864
test/unit: move spdk_cunit.h to include/spdk_internalIt'll make it easier to include this file outside of unit tests.Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>Change-Id: I171ddb8649f67b5786f08647560e2907603d0574Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19284Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>Community-CI: Mellanox Build BotTested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
subsystem: assert all subsystems initialized on app threadThis requires creating and setting SPDK threads in thesubsystem unit tests as well.Signed-off-by: Jim Harris <james.r.harris@intel.com>
subsystem: assert all subsystems initialized on app threadThis requires creating and setting SPDK threads in thesubsystem unit tests as well.Signed-off-by: Jim Harris <james.r.harris@intel.com>Change-Id: I31acfb1d7e418f011acc9b48933032d8bf8a1c53Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15511Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
update Intel copyright noticesper Intel policy to include file commit date using git cmdbelow. The policy does not apply to non-Intel (C) notices.git log --follow -C90% --format=%ad --date defa
update Intel copyright noticesper Intel policy to include file commit date using git cmdbelow. The policy does not apply to non-Intel (C) notices.git log --follow -C90% --format=%ad --date default <file> | tail -1and then pull just the 4 digit year from the result.Intel copyrights were not added to files where Intel either hadno contribution ot the contribution lacked substance (ie licenseheader updates, formatting changes, etc). Contribution date used"--follow -C95%" to get the most accurate date.Note that several files in this patch didn't end the license/(c)block with a blank comment line so these were added as the vastmajority of files do have this last blank line. Simply there forconsistency.Signed-off-by: paul luse <paul.e.luse@intel.com>Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Jim Harris <james.r.harris@intel.com>Reviewed-by: Ben Walker <benjamin.walker@intel.com>Community-CI: Mellanox Build Bot
Replace most BSD 3-clause license text with SPDX identifier.Many open source projects have moved to using SPDX identifiersto specify license information, reducing the amount ofboilerplate code in
Replace most BSD 3-clause license text with SPDX identifier.Many open source projects have moved to using SPDX identifiersto specify license information, reducing the amount ofboilerplate code in every source file. This patch replacesthe bulk of SPDK .c, .cpp and Makefiles with the BSD-3-Clauseidentifier.Almost all of these files share the exact same license text,and this patch only modifies the files that contain themost common license text. There can be slight variationsbecause the third clause contains company names - most say"Intel Corporation", but there are instances for Nvidia,Samsung, Eideticom and even "the copyright holder".Used a bash script to automate replacement of the license textwith SPDX identifier which is checked into scripts/spdx.sh.Signed-off-by: Jim Harris <james.r.harris@intel.com>Change-Id: Iaa88ab5e92ea471691dc298cfe41ebfb5d169780Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12904Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>Community-CI: Mellanox Build BotTested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>Reviewed-by: Dong Yi <dongx.yi@intel.com>Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>Reviewed-by: Paul Luse <paul.e.luse@intel.com>Reviewed-by: <qun.wan@intel.com>
spelling: testPart of #2256* achieve* additionally* against* aliases* already* another* arguments* between* capabilities* comparison* compatibility* configuration* continuing* contro
spelling: testPart of #2256* achieve* additionally* against* aliases* already* another* arguments* between* capabilities* comparison* compatibility* configuration* continuing* controlq* cpumask* default* depends* dereferenced* discussed* dissect* driver* environment* everything* excluded* existing* expectation* failed* fails* following* functions* hugepages* identifiers* implicitly* in_capsule* increment* initialization* initiator* integrity* iteration* latencies* libraries* management* namespace* negotiated* negotiation* nonexistent* number* occur* occurred* occurring* offsetting* operations* outstanding* overwhelmed* parameter* parameters* partition* preempts* provisioned* responded* segment* skipped* struct* subsystem* success* successfully* sufficiently* this* threshold* transfer* transferred* unchanged* unexpected* unregistered* useless* utility* value* variable* workloadChange-Id: I21ca7dab4ef575b5767e50aaeabc34314ab13396Signed-off-by: Josh Soref <jsoref@gmail.com>Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10409Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>Reviewed-by: Jim Harris <james.r.harris@intel.com>Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
nvmf: Fix double controller destruction when subsys is deletedWhen a subsystem is being deleted, we disconnect all qpairsand when the last qpair for some controller is disconnected,we start contr
nvmf: Fix double controller destruction when subsys is deletedWhen a subsystem is being deleted, we disconnect all qpairsand when the last qpair for some controller is disconnected,we start controller desctruction process. This process requiresto send a message to subsystem's thread to remove the controllerfrom the list in the subsystem and after that send a message tocontroller's thread to release resources.The problem is that the subsystem also destroys all attachedcontrollers. This order is unpredictable and we may getheap-use-after-free or double free.To fix this problem we can rely on the fact that the subsystemcan only be destroyed in incative state, that means that allqpairs linked to the subsystem are already disconnected andall controllers are already destroyed or in the process ofdestruction.spdk_nvmf_subsystem_destroy API is now can be asyncrhonous,it accepts a callback with cb argument.Change-Id: Ic72d69200bc8302dae2f8cd8ca44bc640c6a8116Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6660Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>Community-CI: Mellanox Build BotReviewed-by: Changpeng Liu <changpeng.liu@intel.com>Reviewed-by: Jim Harris <james.r.harris@intel.com>
test: optimize unit test .gitignore filesJust add a single .gitignore file in test/unitthat covers *_ut. That allows us to eliminate100 .gitignore files in the test/unit directoryhierarchy.Si
test: optimize unit test .gitignore filesJust add a single .gitignore file in test/unitthat covers *_ut. That allows us to eliminate100 .gitignore files in the test/unit directoryhierarchy.Signed-off-by: Jim Harris <james.r.harris@intel.com>Change-Id: Ia190587b4d5c6f1847471be27550cbfb843dc01eReviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9235Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>Community-CI: Mellanox Build BotTested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
event: Shift subsystem initialization code to a separate libraryThis is useful for applications even if they elect not to use the SPDKevent framework.This doesn't shift everything in one go - ju
event: Shift subsystem initialization code to a separate libraryThis is useful for applications even if they elect not to use the SPDKevent framework.This doesn't shift everything in one go - just the subsysteminitialization logic. Configuration file loading also needs to movein a separate patch later.Change-Id: Id419df1045442d416650ed90e5ee78adfdd623d7Signed-off-by: Ben Walker <benjamin.walker@intel.com>Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6641Community-CI: Broadcom CICommunity-CI: Mellanox Build BotTested-by: SPDK CI Jenkins <sys_sgci@intel.com>Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>Reviewed-by: Jim Harris <james.r.harris@intel.com>Reviewed-by: Paul Luse <paul.e.luse@intel.com>Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>