From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 88F3DA04FD; Wed, 8 Jun 2022 13:58:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AA0042BB0; Wed, 8 Jun 2022 13:58:52 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2075.outbound.protection.outlook.com [40.107.94.75]) by mails.dpdk.org (Postfix) with ESMTP id AAC0F42BA6 for ; Wed, 8 Jun 2022 13:58:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GWMxjiXo5Czo5ZWBBZyuT2xHs2zSkyjz9F5VQ72iz72bMo4utwexhb4GYful+x0vg8EiXZFYti7ZErO4sogqfgiohG91ATmi59cQQPElU8hxXNWg937DtMdNXDGgxbZMPCSzFCkMH8gktMmxUs3KqtnKx1rt0yKt1gDYr1w04LG5HYNS+L+rHsO3GzWPC63ECXPji96fXFLwrsB23haQNeCCrENbnWmj+/SQ/JFEYZyEDqNjnWbQ6InWg8qTdQrIpCZAV3rM/Reyry3Yi+v7/n25RWgdK4qplbsOeWrD/vM8ci4i9DAGLHIoC3CDQPifClnBVsbP2yctcIvNJtKKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OQRJmcV4/6qzXTt5nOLGyqiTMniE3zH44MOOTvo3VSQ=; b=KXgRZg96ysGIMq8ZjUyKSIR8c/D2Jy/LkGh9k73SKiyZOvvrzmvVBEsjMkIq4tZOsv+I/vhi/kS76kMEXBZxkcubfiYuJF4cww0SM8E/CbKFLAa0vvnw5JgRwYPLCYLJFsjp0K1jK86dS/jFeux3j0RhSFKZlIY5KsG8dhLZd9zbL5kBiCw49JkT85uu2vF25aBwP/q8AH09d3hkQfVOQh2bfUsAc9hSSiVnLD1tGvODOwaZJAh6InhFN2NKRIwy/bz2C1fbeXL+OkE/HfLQ/HZacdHQyol35v5nFBVXrBuEDaXBLA8uDUItzh/YhlSW77hWpAvj0xPp6QDqm+WazQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OQRJmcV4/6qzXTt5nOLGyqiTMniE3zH44MOOTvo3VSQ=; b=La4uYlPBUyot4qgo+XO4RDlYQ1NkWY+o1Yjb0RmursAGvlXzR9Ffi7HX8p6qDHXj9oh8CMhzBkSCzp6mAtFaW2IUeKBIpJeo3RFmMGlOM5XEmx+OVhHstLAHl/WOk5VM1xz8vI1r4WSrZ9qQ8BBUsqgGv7cja2GcrlMe4g3knovWpWEs1ADLhLrTk++9Wc9W3YKYFbe3XkMxuoMA9B2zJ1EMfvZ+pLoHdXfxdeKzJkULMNpwzNsvctTMQdv2MHpyiEo+dMKjfeYUJ104Zyksfq5EtAykKHeme8Bl3GEcE4xTfNv1JaFk1sMTEpoZYTyFJ9gMyVv8ojDEllzZeg44nw== Received: from DS7PR03CA0246.namprd03.prod.outlook.com (2603:10b6:5:3b3::11) by MN2PR12MB3853.namprd12.prod.outlook.com (2603:10b6:208:162::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Wed, 8 Jun 2022 11:58:48 +0000 Received: from DM6NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::86) by DS7PR03CA0246.outlook.office365.com (2603:10b6:5:3b3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.18 via Frontend Transport; Wed, 8 Jun 2022 11:58:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT046.mail.protection.outlook.com (10.13.172.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5332.12 via Frontend Transport; Wed, 8 Jun 2022 11:58:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 8 Jun 2022 11:58:47 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 8 Jun 2022 04:58:45 -0700 From: Gregory Etelson To: , CC: , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 2/2] common/mlx5: update log format after devx_obj_create error Date: Wed, 8 Jun 2022 14:58:26 +0300 Message-ID: <20220608115826.11783-2-getelson@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220608115826.11783-1-getelson@nvidia.com> References: <20220608115826.11783-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 000895d0-d038-4a3e-b837-08da49463f3d X-MS-TrafficTypeDiagnostic: MN2PR12MB3853:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uVay50MC+mhP7j+9Bo314XfL1iKig1X7cbaP0npf9/ga9uL7k/nykCsIwtDggavCbSoCPTyO26DbhjSstXPLX5fQ8NvTMSsJVj87Glle6RJvcCiaNS3paZ7YTJHYjo/J/A2ifzxWZdKFDbrbVvEL+3oKLbvUOrYn336U5o3dQpQfK+PuJAjSofyUXNhSXwJXzdCoVu1mKfJOhw1oLmDj5B31zoEr6rWKK6mYGB4qMt2JGQNSXYUtgmEmuExbxBZdokOWAgRW2w67CZUZB90CAMshQNspDE4VSolkobO8OfdJ8q5zz7vxnv4lHFOWl1ZiQ02LCwAWupUTYvih0CgvPrvlap+Q8+lmXWTwJeoExyDRC8ZDA8pvNgm1WT5M5JPq+g0m6sWa5B2IXsD9xzQ0q20F2EEZhCx6GOqRlFn85CLr3F+JO1oa/CVbzqSQBaIgFk5gg948/IGH0nEzfImO5zpRV9X5yXgbXitC176slfCEw+5EvQlmX9wft3K/Y/JLXphTIfsHlmH8bu/McnTfXj1ZomZbOLQXz96YT7BzFJGGcq9ADqkBE0rEJRvEH/BNZc3yDb1SxHp2kRduwwxgH5/PG4VNGaEO3Mm4iB6EXG1kTFDaTGp06hWv+JvoT+dTHpWaawEd9w6r/ZTgQ1ytGeLGJ+GKuLaY9E3omPGdV65tdu8t30mK2oy7ZCaabUQ9eq8axjURT7H4FBf3odP5jw== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(1076003)(6666004)(316002)(81166007)(54906003)(356005)(110136005)(36756003)(70206006)(8676002)(15650500001)(7049001)(186003)(16526019)(2616005)(107886003)(47076005)(426003)(336012)(7696005)(70586007)(2906002)(26005)(6286002)(4326008)(86362001)(82310400005)(40460700003)(508600001)(83380400001)(5660300002)(55016003)(36860700001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2022 11:58:48.2175 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 000895d0-d038-4a3e-b837-08da49463f3d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3853 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Application can fetch syndrome value after FW operation failure starting from Mellanox OFED-5.6. The patch updates log data after devx_obj_create error. Signed-off-by: Gregory Etelson Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 77 ++++++++++------------------ 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index bc06aeccc7..d4220a863b 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -199,8 +199,7 @@ mlx5_devx_cmd_flow_counter_alloc(void *ctx, uint32_t bulk_n_128) dcs->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!dcs->obj) { - DRV_LOG(ERR, "Can't allocate counters - error %d", errno); - rte_errno = errno; + mlx5_devx_err_log(out, "allocate counters", NULL, 0); mlx5_free(dcs); return NULL; } @@ -378,9 +377,9 @@ mlx5_devx_cmd_mkey_create(void *ctx, mkey->obj = mlx5_glue->devx_obj_create(ctx, in, in_size_dw * 4, out, sizeof(out)); if (!mkey->obj) { - DRV_LOG(ERR, "Can't create %sdirect mkey - error %d", - klm_num ? "an in" : "a ", errno); - rte_errno = errno; + mlx5_devx_err_log(out, + klm_num ? "create indirect mkey" : "create direct key", + NULL, 0); mlx5_free(mkey); return NULL; } @@ -709,9 +708,7 @@ mlx5_devx_cmd_create_flex_parser(void *ctx, parse_flex_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!parse_flex_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create FLEX PARSE GRAPH object " - "by using DevX."); + mlx5_devx_err_log(out, "create FLEX PARSE GRAPH", NULL, 0); mlx5_free(parse_flex_obj); return NULL; } @@ -1283,8 +1280,7 @@ mlx5_devx_cmd_create_rq(void *ctx, rq->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!rq->obj) { - DRV_LOG(ERR, "Failed to create RQ using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create RQ", NULL, 0); mlx5_free(rq); return NULL; } @@ -1383,8 +1379,7 @@ mlx5_devx_cmd_create_rmp(void *ctx, rmp->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!rmp->obj) { - DRV_LOG(ERR, "Failed to create RMP using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create RMP", NULL, 0); mlx5_free(rmp); return NULL; } @@ -1452,8 +1447,7 @@ mlx5_devx_cmd_create_tir(void *ctx, tir->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!tir->obj) { - DRV_LOG(ERR, "Failed to create TIR using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create TIR", NULL, 0); mlx5_free(tir); return NULL; } @@ -1591,8 +1585,7 @@ mlx5_devx_cmd_create_rqt(void *ctx, rqt->obj = mlx5_glue->devx_obj_create(ctx, in, inlen, out, sizeof(out)); mlx5_free(in); if (!rqt->obj) { - DRV_LOG(ERR, "Failed to create RQT using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create RQT", NULL, 0); mlx5_free(rqt); return NULL; } @@ -1706,8 +1699,7 @@ mlx5_devx_cmd_create_sq(void *ctx, sq->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!sq->obj) { - DRV_LOG(ERR, "Failed to create SQ using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create SQ", NULL, 0); mlx5_free(sq); return NULL; } @@ -1790,8 +1782,7 @@ mlx5_devx_cmd_create_tis(void *ctx, tis->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!tis->obj) { - DRV_LOG(ERR, "Failed to create TIS using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create TIS", NULL, 0); mlx5_free(tis); return NULL; } @@ -1825,8 +1816,7 @@ mlx5_devx_cmd_create_td(void *ctx) td->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!td->obj) { - DRV_LOG(ERR, "Failed to create TIS using DevX"); - rte_errno = errno; + mlx5_devx_err_log(out, "create TIS", NULL, 0); mlx5_free(td); return NULL; } @@ -1946,8 +1936,7 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) cq_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!cq_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create CQ using DevX errno=%d.", errno); + mlx5_devx_err_log(out, "create CQ", NULL, 0); mlx5_free(cq_obj); return NULL; } @@ -2023,8 +2012,7 @@ mlx5_devx_cmd_create_virtq(void *ctx, virtq_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!virtq_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create VIRTQ Obj using DevX."); + mlx5_devx_err_log(out, "create VIRTQ", NULL, 0); mlx5_free(virtq_obj); return NULL; } @@ -2218,8 +2206,7 @@ mlx5_devx_cmd_create_qp(void *ctx, qp_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!qp_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create QP Obj using DevX."); + mlx5_devx_err_log(out, "create QP", NULL, 0); mlx5_free(qp_obj); return NULL; } @@ -2333,9 +2320,8 @@ mlx5_devx_cmd_create_virtio_q_counters(void *ctx) couners_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!couners_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create virtio queue counters Obj using" - " DevX."); + mlx5_devx_err_log(out, "create virtio queue counters Obj", + NULL, 0); mlx5_free(couners_obj); return NULL; } @@ -2417,8 +2403,7 @@ mlx5_devx_cmd_create_flow_hit_aso_obj(void *ctx, uint32_t pd) flow_hit_aso_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!flow_hit_aso_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create FLOW_HIT_ASO obj using DevX."); + mlx5_devx_err_log(out, "create FLOW_HIT_ASO", NULL, 0); mlx5_free(flow_hit_aso_obj); return NULL; } @@ -2505,8 +2490,7 @@ mlx5_devx_cmd_create_flow_meter_aso_obj(void *ctx, uint32_t pd, ctx, in, sizeof(in), out, sizeof(out)); if (!flow_meter_aso_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create FLOW_METER_ASO obj using DevX."); + mlx5_devx_err_log(out, "create FLOW_METTER_ASO", NULL, 0); mlx5_free(flow_meter_aso_obj); return NULL; } @@ -2556,8 +2540,7 @@ mlx5_devx_cmd_create_conn_track_offload_obj(void *ctx, uint32_t pd, ct_aso_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!ct_aso_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create CONN_TRACK_OFFLOAD obj by using DevX."); + mlx5_devx_err_log(out, "create CONN_TRACK_OFFLOAD", NULL, 0); mlx5_free(ct_aso_obj); return NULL; } @@ -2609,9 +2592,7 @@ mlx5_devx_cmd_create_geneve_tlv_option(void *ctx, geneve_tlv_opt_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!geneve_tlv_opt_obj->obj) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create Geneve tlv option " - "Obj using DevX."); + mlx5_devx_err_log(out, "create GENEVE TLV", NULL, 0); mlx5_free(geneve_tlv_opt_obj); return NULL; } @@ -2673,9 +2654,7 @@ mlx5_devx_cmd_queue_counter_alloc(void *ctx) dcs->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (!dcs->obj) { - DRV_LOG(DEBUG, "Can't allocate q counter set by DevX - error " - "%d.", errno); - rte_errno = errno; + mlx5_devx_err_log(out, "create q counter set", NULL, 0); mlx5_free(dcs); return NULL; } @@ -2762,8 +2741,7 @@ mlx5_devx_cmd_create_dek_obj(void *ctx, struct mlx5_devx_dek_attr *attr) dek_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (dek_obj->obj == NULL) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create DEK obj using DevX."); + mlx5_devx_err_log(out, "create DEK", NULL, 0); mlx5_free(dek_obj); return NULL; } @@ -2810,8 +2788,7 @@ mlx5_devx_cmd_create_import_kek_obj(void *ctx, import_kek_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (import_kek_obj->obj == NULL) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create IMPORT_KEK object using DevX."); + mlx5_devx_err_log(out, "create IMPORT_KEK", NULL, 0); mlx5_free(import_kek_obj); return NULL; } @@ -2859,8 +2836,7 @@ mlx5_devx_cmd_create_credential_obj(void *ctx, credential_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (credential_obj->obj == NULL) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create CREDENTIAL object using DevX."); + mlx5_devx_err_log(out, "create CREDENTIAL", NULL, 0); mlx5_free(credential_obj); return NULL; } @@ -2911,8 +2887,7 @@ mlx5_devx_cmd_create_crypto_login_obj(void *ctx, crypto_login_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out)); if (crypto_login_obj->obj == NULL) { - rte_errno = errno; - DRV_LOG(ERR, "Failed to create CRYPTO_LOGIN obj using DevX."); + mlx5_devx_err_log(out, "create CRYPTO_LOGIN", NULL, 0); mlx5_free(crypto_login_obj); return NULL; } -- 2.35.1