From 885331fe163ef48678b2cc4a9b02b7e51879d4de Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Tue, 22 Jun 2021 11:15:20 +0300 Subject: [PATCH] perf: Ignore trtypes that were not requested by user If perf is connecting to a subsystem with listeners of different transport types (e.g. TCP and RDMA) and the user request a specific trtype via CLI (e.g. TCP), discovery process will call probe_cb for every transport type. As result, probe_cb in perf will return `true` and undesired controllers will be created and used in IO path. This patch adds a check for trtype and trstring to ignore controllers that are not of a requested type. Signed-off-by: Alexey Marchuk Change-Id: Id87afd03c7b38edfbbfecb5ad2239fe3e9ac9f83 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8465 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Ziye Yang Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- examples/nvme/perf/perf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 9205eaa01..dbe27c18a 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -5,6 +5,7 @@ * All rights reserved. * * Copyright (c) 2019-2021 Mellanox Technologies LTD. All rights reserved. + * Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -2601,6 +2602,11 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, } } + if (trid->trtype != trid_entry->trid.trtype && + strcasecmp(trid->trstring, trid_entry->trid.trstring)) { + return false; + } + /* Set io_queue_size to UINT16_MAX, NVMe driver * will then reduce this to MQES to maximize * the io_queue_size as much as possible.