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 5A789A034F; Fri, 7 May 2021 09:01:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9BA540686; Fri, 7 May 2021 09:01:47 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) by mails.dpdk.org (Postfix) with ESMTP id D43A540040 for ; Fri, 7 May 2021 09:01:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MSigApYYQiLHNTN6SZMXDCwd6226zV+EKBVRA22QjTxBEa8/BkuTpfBuW9Whx754pNDZuzTz0qLwG48PpegH5go/ZL5ZbS1fjsYawEJKhHTGNnv2f14mo+uYvtm27H52Pj+VNG7B2Si3ODHRyr7S4Okdc7RqSiUrumef6O9y8Bqnk6i7+7+dCdQtyGpeAkGcRKmkMbrG2fV9J6Z+GN3HzImSPUGroSGieC3ynsi6HLfiVwAWYDcluvIHIm8iY/9WPG1hzmvslhmGNrwzQnFO9rjdQzkiy0h5GpfXXSt2hizNCXF8Lf/1R3JQGxwoyaPKl76KoK8vMcUo0tDkcX+g6A== 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-SenderADCheck; bh=/soPcsRw0DcYYkjxa0UU3U1BCulXDRzXtHx3BpTN0lI=; b=jc2/mxkzrmfYpM1bGDIOdvZ/QzqGEiyXWwwFozWp3aTMXP5iJYQOjhS5eqxVimmMrsxzhgiDfyo5YNJArBtxN8FMgUFEcZyNCMDgljkYLS/yfLuI9wCj1MB2XS+S4rKxW+Yl1AYVwDHI4HMZTu0KWsmJjb4lFGzOQ92htEG+KevKl9/menaJAPeDPuL+XxcyyY0S6BWFN8CuGtYrgkb3GJpxj5uMMo/dO4iHkCz4WoTdvDFv3h9SeaFTzJKh4Dfts9EQloz+6FA7B8VY7t7OzVuvjq63VL34CxqA4bQBv+rSkmGzcxWsWV2u8XlzS3rVCEc+Tq5feAWyyZbPVMHsNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=/soPcsRw0DcYYkjxa0UU3U1BCulXDRzXtHx3BpTN0lI=; b=j9BbCG8erERbm7IQUDmd3lsPMXdsW2fx48vHaWoppM4Z7m7NbE+0odOI+YRhE19NC2kDMz5qEISKLJ2OofHMGt89HQyhL09A8LlIUmXvh4fik8EePAqHW3PyB3huwcxr2hB0F+DqLJJz5sQ0zILur6phHnFK4o7K0KsSSKy8G27u9ASHhgsby6NeDRFyWo+ZF0VoUcr+QTbWzx2imAjGEFODcwAryUmgMjgxqDNnchjFFCoBbfU7Pd43YPDHpQJfZCC3iELXDQa/i4xX/Z94EOICN7aW316Caz3J4CrMgu74Q9FJwDELg9r98dVThD4Aik1e2i5pVdkueD+IkyC/Eg== Received: from MWHPR02CA0002.namprd02.prod.outlook.com (2603:10b6:300:4b::12) by MWHPR12MB1264.namprd12.prod.outlook.com (2603:10b6:300:d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Fri, 7 May 2021 07:01:45 +0000 Received: from CO1NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:300:4b:cafe::ab) by MWHPR02CA0002.outlook.office365.com (2603:10b6:300:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Fri, 7 May 2021 07:01:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT067.mail.protection.outlook.com (10.13.174.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Fri, 7 May 2021 07:01:45 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 07:01:43 +0000 From: Shiri Kuzin To: CC: , , Date: Fri, 7 May 2021 10:01:22 +0300 Message-ID: <20210507070122.174449-1-shirik@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89ec5a1a-be6d-4449-290f-08d91125f9e7 X-MS-TrafficTypeDiagnostic: MWHPR12MB1264: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: obE87tXGCOP9zh3PtjayzGbMHujlhqPSCuAUDjIeWsUHHTI3oA7e1APmJEflGwddQMMJ+M/DTSHzhfdKmdSKASOsuEfHwcSFz3ltyj1R2tgfOsH3JNDelIvjx5VnejPRfqNR7J7xmkqJmIZvcNJdkY0cK9DSg0bEuqMgZguB5zN3fkzyjh2uf6oYVJc9Nu9mGWCuhlLlijYFgBCMlGTekzJx6vdYvSPSQPvDem12G7F6gsmVQEbJ3tqF9GZAvNoxOBXNtauRVEZPwZaG8uYT5/Q4Oc+P+wS7ssmCXVL2D4u5nkMc+Ylm8VoL5t7zp5MLakkNdfo32LCGelNIoFdMu99tGZVSx4kYLSdN/ilcvDzUjw9RVaZ6D31xzKCSKD+I5FBZ5yr8EEKRipp+pqgyhajDkAZ3OOyjqnsqBl10k61t4RnQTdqMItwMqYljDGHezeW01n2zXY6n3gXrvhdsUOUVBc8JEJzs5Ep4pTGngBEfo7OWMvhKQ1llvrfMTPFyExmhFw6YH9cKIiqSon3mb3dHPokdzQNoer9Eg//Oa13dcWfceqY5KAVtlS6BREMsVZhHoxxr6Uq/nWTU6PZZI9TCETd3hE9aLOBVRLZU+1Npp88rIbDuK582bwmKIBMQ4nYA5Zz0RU3jXVctr/Hdk+EDMJSJxpP/AKRi7q8D2rI= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(396003)(346002)(36840700001)(46966006)(316002)(4326008)(86362001)(7696005)(70586007)(82310400003)(5660300002)(8936002)(47076005)(26005)(8676002)(2906002)(356005)(83380400001)(54906003)(7636003)(478600001)(82740400003)(36860700001)(55016002)(1076003)(6666004)(16526019)(107886003)(36906005)(186003)(70206006)(426003)(6286002)(336012)(2616005)(6916009)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2021 07:01:45.2065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89ec5a1a-be6d-4449-290f-08d91125f9e7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1264 Subject: [dpdk-dev] [PATCH] common/mlx5: fix mkey attributes initialization 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 Sender: "dev" The crypto driver added new fields to the mkey attributes struct: crypto_en and set_remote_rw. The entire mkey struct was not initialized, only specific fields in it, which caused the new added fields not to be initialized resulting in a mkey creation error. This is fixed by initializing the entire mkey attributes struct to 0 which will prevent this issue from reoccurring if any fields are added to the mkey sturct in the future. Fixes: 0111a74e13dd ("common/mlx5: adjust DevX mkey fields for crypto") Signed-off-by: Shiri Kuzin Acked-by: Matan Azrad --- drivers/common/mlx5/windows/mlx5_common_os.c | 7 +------ drivers/net/mlx5/mlx5_flow.c | 5 +---- drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 4 ---- drivers/vdpa/mlx5/mlx5_vdpa_mem.c | 5 +---- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/common/mlx5/windows/mlx5_common_os.c b/drivers/common/mlx5/windows/mlx5_common_os.c index 78975d9d4d..5031bdca26 100644 --- a/drivers/common/mlx5/windows/mlx5_common_os.c +++ b/drivers/common/mlx5/windows/mlx5_common_os.c @@ -168,16 +168,11 @@ mlx5_os_reg_mr(void *pd, IBV_ACCESS_LOCAL_WRITE); if (!obj) return -1; + memset(&mkey_attr, 0, sizeof(mkey_attr)); mkey_attr.addr = (uintptr_t)addr; mkey_attr.size = length; mkey_attr.umem_id = ((struct mlx5_devx_umem *)(obj))->umem_id; mkey_attr.pd = mlx5_pd->pdn; - mkey_attr.log_entity_size = 0; - mkey_attr.pg_access = 0; - mkey_attr.klm_array = NULL; - mkey_attr.klm_num = 0; - mkey_attr.relaxed_ordering_read = 0; - mkey_attr.relaxed_ordering_write = 0; if (!haswell_broadwell_cpu) { mkey_attr.relaxed_ordering_write = attr.relaxed_ordering_write; mkey_attr.relaxed_ordering_read = attr.relaxed_ordering_read; diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 3194cd5633..2811537226 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -7378,14 +7378,11 @@ mlx5_flow_create_counter_stat_mem_mng(struct mlx5_dev_ctx_shared *sh) mlx5_free(mem); return -rte_errno; } + memset(&mkey_attr, 0, sizeof(mkey_attr)); mkey_attr.addr = (uintptr_t)mem; mkey_attr.size = size; mkey_attr.umem_id = mlx5_os_get_umem_id(mem_mng->umem); mkey_attr.pd = sh->pdn; - mkey_attr.log_entity_size = 0; - mkey_attr.pg_access = 0; - mkey_attr.klm_array = NULL; - mkey_attr.klm_num = 0; mkey_attr.relaxed_ordering_write = sh->cmng.relaxed_ordering_write; mkey_attr.relaxed_ordering_read = sh->cmng.relaxed_ordering_read; mem_mng->dm = mlx5_devx_cmd_mkey_create(sh->ctx, &mkey_attr); diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c index 6c4284f7f7..f391813745 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c @@ -41,10 +41,6 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base, .size = log_size, .pd = priv->pdn, .pg_access = 1, - .klm_array = NULL, - .klm_num = 0, - .relaxed_ordering_read = 0, - .relaxed_ordering_write = 0, }; struct mlx5_devx_virtq_attr attr = { .type = MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_PARAMS, diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_mem.c b/drivers/vdpa/mlx5/mlx5_vdpa_mem.c index f8861d5d26..a13bde5a0b 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_mem.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_mem.c @@ -200,6 +200,7 @@ mlx5_vdpa_mem_register(struct mlx5_vdpa_priv *priv) goto error; } DRV_LOG(DEBUG, "Dump fill Mkey = %u.", priv->null_mr->lkey); + memset(&mkey_attr, 0, sizeof(mkey_attr)); for (i = 0; i < mem->nregions; i++) { reg = &mem->regions[i]; entry = rte_zmalloc(__func__, sizeof(*entry), 0); @@ -221,10 +222,6 @@ mlx5_vdpa_mem_register(struct mlx5_vdpa_priv *priv) mkey_attr.umem_id = entry->umem->umem_id; mkey_attr.pd = priv->pdn; mkey_attr.pg_access = 1; - mkey_attr.klm_array = NULL; - mkey_attr.klm_num = 0; - mkey_attr.relaxed_ordering_read = 0; - mkey_attr.relaxed_ordering_write = 0; entry->mkey = mlx5_devx_cmd_mkey_create(priv->ctx, &mkey_attr); if (!entry->mkey) { DRV_LOG(ERR, "Failed to create direct Mkey."); -- 2.27.0