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 95CB7A0C4D; Sun, 5 Sep 2021 10:04:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2546840042; Sun, 5 Sep 2021 10:04:55 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2043.outbound.protection.outlook.com [40.107.237.43]) by mails.dpdk.org (Postfix) with ESMTP id 1735A4003D; Sun, 5 Sep 2021 10:04:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jyibpP2OsbGgH/K7KbNGpF5Z5K3LX7KF8KJpnLYYzYVATgdQ+0w+XwQCNih4mGztAo1tLoQB6K2AFEwdTlhWwEz8qxfw9dqeor93gqIPWZVDuOtQgjpS0cvVtGlzbEn+oVfkt/XnL/y+GMgK1v5izjdct3gld7Js65cqkV+HEhRUpXlFwhjg01L4QopLe4pqX3ym5povVZyJWWrZP2lF8cit6sYeTct+Ge5T+p/82r8C1k4yYxwOPZs7WDXzlltWvoGy597zSxEibUiptTBvnsFThzJvB2TghVod0ItXwxfsaK6JF3ly9cI0LzSZwbGGD5fTZhsGeJo5ZH32ll+nAQ== 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; bh=26m58DawlrDvV67lUYPHq6QkvdNSb6TULWjmzUX2yr4=; b=Tsi3n2QcLqBOTINZUvQdpJN8ntwaEIiDlbgK7c/kHdPZitbVNFJgso+Fz9oMGhrsuDJqV78A6yTw3InrMvsuajFvI0goIjzsEMVeXWw3yOyliI8wRuTSgfi1U8nsRo7mBYZekAHAajYEX7+w5FhlgPlecLuTwaeBBfeW8eBl7WLzVa9Hp/uPAVSRkX1TACfmRLmha1IkjoZ/1Kb67zrzE2xzGPzvlSm/LqQYNFadIQdo5MCE51X3moZuwc77zPTjAQrfItdmNpjNbgpRRjTl/XA6TBBMABHZhuVGxwg3U77eBl2uaQNjXc5xhFsj/+m/kLiloZ2ZXPguh7MVmBxurw== 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=quarantine 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=26m58DawlrDvV67lUYPHq6QkvdNSb6TULWjmzUX2yr4=; b=nr/pN1HmGlxY60WPR60oJbkVwRe6SyItUl/UmJHVgzZrQmlLqT6NoOHABnseWjoAg7tP7heiaFjx5ybemkhrBZn4pgOrv51QB++IOlLoDlH7Zfxy2BRoYRJcNPF6Yav4UZL8vKbw2v2B7yHIZEIAzuUyIzJ4D0c4i5HfTltuxa9uq3XNJTFQTJdRe/rfJG9LyeTn5aINp1jaCJW+ffdHXtahNp62QqDdmywceL75WOy1xXg3VmPcBfWepR/XcJxIbGH0YuXBS6KZSzv5gjJR1LcuKxNq1I5J68ciCmIdD6L+tqjJU8UmuEzCCdqBsJKHWMCIKCXMr7d0eCxxEISloA== Received: from CO2PR04CA0153.namprd04.prod.outlook.com (2603:10b6:104::31) by BYAPR12MB3429.namprd12.prod.outlook.com (2603:10b6:a03:a8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Sun, 5 Sep 2021 08:04:51 +0000 Received: from CO1NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:104::4) by CO2PR04CA0153.outlook.office365.com (2603:10b6:104::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Sun, 5 Sep 2021 08:04:51 +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 CO1NAM11FT038.mail.protection.outlook.com (10.13.174.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Sun, 5 Sep 2021 08:04:51 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 5 Sep 2021 08:04:49 +0000 From: Michael Baum To: CC: Matan Azrad , Date: Sun, 5 Sep 2021 11:04:15 +0300 Message-ID: <20210905080415.3836354-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210831204015.3411435-1-michaelba@nvidia.com> References: <20210831204015.3411435-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43150583-fa50-4c32-aa40-08d97043d696 X-MS-TrafficTypeDiagnostic: BYAPR12MB3429: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T4IQUL9mWwtdxCj8AnHzIow/LDXc9p7TYdcm87F/DCxAY6K7GSOg3f7+Kb0r2tPRTnveAWOQk6bVpKAdrNVnqG9RqM0KW91wImZvrdHi6l5oXbOXjMChssxO+ygxaBUhFtpHbNkzh4QoKOILCRkMs0NaXuFoeGKKQc5PxTiIKMw2vsDhsMBLhB5FVXqh9FZGew50BHAUNoJoghLvJrUT4uzijLrrQei4d5f7So7hFJKlZ8voxbDSjRaQ4ESjFZ3h+qqruzbs7QgXQdcVtTc+PAwCozLGGgMsIwo062OMAcVI4u9HFCXb7CYZ7nDYvJdv3rrsDWiRBgVQ1zHg/YwJQ6BDPy2m/ySWBbxbbQq2U1wgBBFZJ2WuPgm6x8IrG1PgoxsdvuaxWqMVoURJVOs0dHpSk8V4EL4aFAjkxUJR1fb6h0W6S0/wwGG5KbZsFy6MfjYUk0IhxAkwCWEAkLb3rM23PDnmsTiTbiW9ledTd86tbMBA+jCXd3j04vmFZkxypw0Ym2vhkQcdQ8ay05meTPOLxPmD9TrMP/JPnTFDHMIq2fIE6pqfcv1PaDtmcKCEtVLbhXzwmehu4rdv84i+5pKS6Qaivi6wcupAXUsvst7Jnq0nx8MTF1gCuwAbx/j2VrS+34bmhLWznRWXLHQr1IEeC71s19kQJhELlm4YIBbDEFt5QGkNZqckJDiWuEzx7uFrv3mgEoZKGQBOXofDvA== 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)(346002)(39860400002)(396003)(136003)(376002)(46966006)(36840700001)(36860700001)(6286002)(55016002)(186003)(26005)(1076003)(82310400003)(82740400003)(7636003)(336012)(16526019)(54906003)(2616005)(7696005)(47076005)(478600001)(83380400001)(6916009)(356005)(316002)(450100002)(70206006)(4326008)(36906005)(6666004)(86362001)(2906002)(5660300002)(36756003)(8936002)(70586007)(426003)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2021 08:04:51.3794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43150583-fa50-4c32-aa40-08d97043d696 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: CO1NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3429 Subject: [dpdk-dev] [PATCH v2] crypto/mlx5: fix timestamp format configuration 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" This patch adds support for the timestamp format settings for the receive and send queues. If the firmware version x.30.1000 or above is installed and the NIC timestamps are configured with the real-time format, the default zero values for newly added fields cause the queue creation to fail. The patch queries the timestamp formats supported by the hardware and sets the configuration values in queue context accordingly. Fixes: 6152534e211e ("crypto/mlx5: support queue pairs operations") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- v2: Align title and description of the patch to a fix format. drivers/crypto/mlx5/mlx5_crypto.c | 2 ++ drivers/crypto/mlx5/mlx5_crypto.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index b3d5200ca3..e01be15ade 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -707,6 +707,7 @@ mlx5_crypto_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, attr.wq_umem_id = qp->umem_obj->umem_id; attr.wq_umem_offset = 0; attr.dbr_umem_id = qp->umem_obj->umem_id; + attr.ts_format = mlx5_ts_format_conv(priv->qp_ts_format); attr.dbr_address = RTE_BIT64(log_nb_desc) * priv->wqe_set_size; qp->qp_obj = mlx5_devx_cmd_create_qp(priv->ctx, &attr); if (qp->qp_obj == NULL) { @@ -1049,6 +1050,7 @@ mlx5_crypto_dev_probe(struct rte_device *dev) priv->ctx = ctx; priv->login_obj = login; priv->crypto_dev = crypto_dev; + priv->qp_ts_format = attr.qp_ts_format; if (mlx5_crypto_hw_global_prepare(priv) != 0) { rte_cryptodev_pmd_destroy(priv->crypto_dev); claim_zero(mlx5_glue->close_device(priv->ctx)); diff --git a/drivers/crypto/mlx5/mlx5_crypto.h b/drivers/crypto/mlx5/mlx5_crypto.h index d49b0001f0..722acb8d19 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.h +++ b/drivers/crypto/mlx5/mlx5_crypto.h @@ -25,6 +25,7 @@ struct mlx5_crypto_priv { volatile uint64_t *uar_addr; uint32_t pdn; /* Protection Domain number. */ uint32_t max_segs_num; /* Maximum supported data segs. */ + uint8_t qp_ts_format; /* Whether QP supports timestamp formats. */ struct ibv_pd *pd; struct mlx5_hlist *dek_hlist; /* Dek hash list. */ struct rte_cryptodev_config dev_config; -- 2.25.1